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.4.1",
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.28",
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 if (arguments.length === 1) {
25873 return selection2.property("value");
25875 if (shouldUpdate === void 0) {
25876 shouldUpdate = (a2, b2) => a2 !== b2;
25878 return selection2.each(setValue(value, shouldUpdate));
25881 // modules/util/keybinding.js
25882 function utilKeybinding(namespace) {
25883 var _keybindings = {};
25884 function testBindings(d3_event, isCapturing) {
25885 var didMatch = false;
25886 var bindings = Object.keys(_keybindings).map(function(id2) {
25887 return _keybindings[id2];
25890 for (i3 = 0; i3 < bindings.length; i3++) {
25891 binding = bindings[i3];
25892 if (!binding.event.modifiers.shiftKey)
25894 if (!!binding.capture !== isCapturing)
25896 if (matches(d3_event, binding, true)) {
25897 binding.callback(d3_event);
25904 for (i3 = 0; i3 < bindings.length; i3++) {
25905 binding = bindings[i3];
25906 if (binding.event.modifiers.shiftKey)
25908 if (!!binding.capture !== isCapturing)
25910 if (matches(d3_event, binding, false)) {
25911 binding.callback(d3_event);
25915 function matches(d3_event2, binding2, testShift) {
25916 var event = d3_event2;
25917 var isMatch = false;
25918 var tryKeyCode = true;
25919 if (event.key !== void 0) {
25920 tryKeyCode = event.key.charCodeAt(0) > 127;
25922 if (binding2.event.key === void 0) {
25924 } else if (Array.isArray(binding2.event.key)) {
25925 if (binding2.event.key.map(function(s2) {
25926 return s2.toLowerCase();
25927 }).indexOf(event.key.toLowerCase()) === -1) {
25931 if (event.key.toLowerCase() !== binding2.event.key.toLowerCase()) {
25936 if (!isMatch && (tryKeyCode || binding2.event.modifiers.altKey)) {
25937 isMatch = event.keyCode === binding2.event.keyCode;
25941 if (!(event.ctrlKey && event.altKey)) {
25942 if (event.ctrlKey !== binding2.event.modifiers.ctrlKey)
25944 if (event.altKey !== binding2.event.modifiers.altKey)
25947 if (event.metaKey !== binding2.event.modifiers.metaKey)
25949 if (testShift && event.shiftKey !== binding2.event.modifiers.shiftKey)
25954 function capture(d3_event) {
25955 testBindings(d3_event, true);
25957 function bubble(d3_event) {
25958 var tagName = select_default2(d3_event.target).node().tagName;
25959 if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
25962 testBindings(d3_event, false);
25964 function keybinding(selection2) {
25965 selection2 = selection2 || select_default2(document);
25966 selection2.on("keydown.capture." + namespace, capture, true);
25967 selection2.on("keydown.bubble." + namespace, bubble, false);
25970 keybinding.unbind = function(selection2) {
25972 selection2 = selection2 || select_default2(document);
25973 selection2.on("keydown.capture." + namespace, null);
25974 selection2.on("keydown.bubble." + namespace, null);
25977 keybinding.clear = function() {
25981 keybinding.off = function(codes, capture2) {
25982 var arr = utilArrayUniq([].concat(codes));
25983 for (var i3 = 0; i3 < arr.length; i3++) {
25984 var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
25985 delete _keybindings[id2];
25989 keybinding.on = function(codes, callback, capture2) {
25990 if (typeof callback !== "function") {
25991 return keybinding.off(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");
26013 if (_keybindings[id2]) {
26014 console.warn('warning: duplicate keybinding for "' + id2 + '"');
26016 _keybindings[id2] = binding;
26017 var matches = arr[i3].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g);
26018 for (var j3 = 0; j3 < matches.length; j3++) {
26019 if (matches[j3] === "++")
26021 if (matches[j3] in utilKeybinding.modifierCodes) {
26022 var prop = utilKeybinding.modifierProperties[utilKeybinding.modifierCodes[matches[j3]]];
26023 binding.event.modifiers[prop] = true;
26025 binding.event.key = utilKeybinding.keys[matches[j3]] || matches[j3];
26026 if (matches[j3] in utilKeybinding.keyCodes) {
26027 binding.event.keyCode = utilKeybinding.keyCodes[matches[j3]];
26036 utilKeybinding.modifierCodes = {
26040 // CTRL key, on Mac: ⌃
26043 // ALT key, on Mac: ⌥ (Alt)
26047 // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
26054 utilKeybinding.modifierProperties = {
26060 utilKeybinding.plusKeys = ["plus", "ffplus", "=", "ffequals", "\u2260", "\xB1"];
26061 utilKeybinding.minusKeys = ["_", "-", "ffminus", "dash", "\u2013", "\u2014"];
26062 utilKeybinding.keys = {
26063 // Backspace key, on Mac: ⌫ (Backspace)
26064 "\u232B": "Backspace",
26065 backspace: "Backspace",
26066 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
26079 "pause-break": "Pause",
26080 // Caps Lock key, ⇪
26081 "\u21EA": "CapsLock",
26083 "caps-lock": "CapsLock",
26084 // Escape key, on Mac: ⎋, on Windows: Esc
26085 "\u238B": ["Escape", "Esc"],
26086 escape: ["Escape", "Esc"],
26087 esc: ["Escape", "Esc"],
26089 space: [" ", "Spacebar"],
26090 // Page-Up key, or pgup, on Mac: ↖
26091 "\u2196": "PageUp",
26093 "page-up": "PageUp",
26094 // Page-Down key, or pgdown, on Mac: ↘
26095 "\u2198": "PageDown",
26096 pgdown: "PageDown",
26097 "page-down": "PageDown",
26098 // END key, on Mac: ⇟
26101 // HOME key, on Mac: ⇞
26104 // Insert key, or ins
26107 // Delete key, on Mac: ⌦ (Delete)
26108 "\u2326": ["Delete", "Del"],
26109 del: ["Delete", "Del"],
26110 "delete": ["Delete", "Del"],
26111 // Left Arrow Key, or ←
26112 "\u2190": ["ArrowLeft", "Left"],
26113 left: ["ArrowLeft", "Left"],
26114 "arrow-left": ["ArrowLeft", "Left"],
26115 // Up Arrow Key, or ↑
26116 "\u2191": ["ArrowUp", "Up"],
26117 up: ["ArrowUp", "Up"],
26118 "arrow-up": ["ArrowUp", "Up"],
26119 // Right Arrow Key, or →
26120 "\u2192": ["ArrowRight", "Right"],
26121 right: ["ArrowRight", "Right"],
26122 "arrow-right": ["ArrowRight", "Right"],
26123 // Up Arrow Key, or ↓
26124 "\u2193": ["ArrowDown", "Down"],
26125 down: ["ArrowDown", "Down"],
26126 "arrow-down": ["ArrowDown", "Down"],
26127 // odities, stuff for backward compatibility (browsers and code):
26128 // Num-Multiply, or *
26129 "*": ["*", "Multiply"],
26130 star: ["*", "Multiply"],
26131 asterisk: ["*", "Multiply"],
26132 multiply: ["*", "Multiply"],
26135 "plus": ["+", "Add"],
26136 // Num-Subtract, or -
26137 "-": ["-", "Subtract"],
26138 subtract: ["-", "Subtract"],
26139 "dash": ["-", "Subtract"],
26146 // Period, or ., or full-stop
26149 // Slash, or /, or forward-slash
26151 "forward-slash": "/",
26152 // Tick, or `, or back-quote
26155 // Open bracket, or [
26156 "open-bracket": "[",
26157 // Back slash, or \
26158 "back-slash": "\\",
26159 // Close backet, or ]
26160 "close-bracket": "]",
26161 // Apostrophe, or Quote, or '
26202 utilKeybinding.keyCodes = {
26203 // Backspace key, on Mac: ⌫ (Backspace)
26206 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
26220 // Caps Lock key, ⇪
26224 // Escape key, on Mac: ⎋, on Windows: Esc
26230 // Page-Up key, or pgup, on Mac: ↖
26234 // Page-Down key, or pgdown, on Mac: ↘
26238 // END key, on Mac: ⇟
26241 // HOME key, on Mac: ⇞
26244 // Insert key, or ins
26247 // Delete key, on Mac: ⌦ (Delete)
26251 // Left Arrow Key, or ←
26255 // Up Arrow Key, or ↑
26259 // Right Arrow Key, or →
26263 // Up Arrow Key, or ↓
26267 // odities, printing characters that come out wrong:
26270 // Num-Multiply, or *
26278 // Num-Subtract, or -
26281 // Vertical Bar / Pipe
26296 // Dash / Underscore key
26298 // Period, or ., or full-stop
26302 // Slash, or /, or forward-slash
26305 "forward-slash": 191,
26306 // Tick, or `, or back-quote
26310 // Open bracket, or [
26312 "open-bracket": 219,
26313 // Back slash, or \
26316 // Close backet, or ]
26318 "close-bracket": 221,
26319 // Apostrophe, or Quote, or '
26326 while (++i < 106) {
26327 utilKeybinding.keyCodes["num-" + n] = i;
26333 utilKeybinding.keyCodes[n] = i;
26338 while (++i < 136) {
26339 utilKeybinding.keyCodes["f" + n] = i;
26344 utilKeybinding.keyCodes[String.fromCharCode(i).toLowerCase()] = i;
26347 // modules/util/object.js
26348 function utilObjectOmit(obj, omitKeys) {
26349 return Object.keys(obj).reduce(function(result, key) {
26350 if (omitKeys.indexOf(key) === -1) {
26351 result[key] = obj[key];
26357 // modules/util/rebind.js
26358 function utilRebind(target, source) {
26359 var i3 = 1, n3 = arguments.length, method;
26360 while (++i3 < n3) {
26361 target[method = arguments[i3]] = d3_rebind(target, source, source[method]);
26365 function d3_rebind(target, source, method) {
26366 return function() {
26367 var value = method.apply(source, arguments);
26368 return value === source ? target : value;
26372 // modules/util/session_mutex.js
26373 function utilSessionMutex(name) {
26377 var expires = /* @__PURE__ */ new Date();
26378 expires.setSeconds(expires.getSeconds() + 5);
26379 document.cookie = name + "=1; expires=" + expires.toUTCString() + "; sameSite=strict";
26381 mutex.lock = function() {
26384 var cookie = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1");
26388 intervalID = window.setInterval(renew, 4e3);
26391 mutex.unlock = function() {
26394 document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict";
26395 clearInterval(intervalID);
26398 mutex.locked = function() {
26399 return !!intervalID;
26404 // modules/util/tiler.js
26405 function utilTiler() {
26406 var _size = [256, 256];
26408 var _tileSize = 256;
26409 var _zoomExtent = [0, 20];
26410 var _translate = [_size[0] / 2, _size[1] / 2];
26412 var _skipNullIsland = false;
26413 function clamp3(num, min3, max3) {
26414 return Math.max(min3, Math.min(num, max3));
26416 function nearNullIsland(tile) {
26421 var center = Math.pow(2, z2 - 1);
26422 var width = Math.pow(2, z2 - 6);
26423 var min3 = center - width / 2;
26424 var max3 = center + width / 2 - 1;
26425 return x2 >= min3 && x2 <= max3 && y2 >= min3 && y2 <= max3;
26429 function tiler9() {
26430 var z2 = geoScaleToZoom(_scale / (2 * Math.PI), _tileSize);
26431 var z0 = clamp3(Math.round(z2), _zoomExtent[0], _zoomExtent[1]);
26433 var tileMax = Math.pow(2, z0) - 1;
26434 var log2ts = Math.log(_tileSize) * Math.LOG2E;
26435 var k2 = Math.pow(2, z2 - z0 + log2ts);
26437 (_translate[0] - _scale / 2) / k2,
26438 (_translate[1] - _scale / 2) / k2
26441 clamp3(Math.floor(-origin[0]) - _margin, tileMin, tileMax + 1),
26442 clamp3(Math.ceil(_size[0] / k2 - origin[0]) + _margin, tileMin, tileMax + 1)
26445 clamp3(Math.floor(-origin[1]) - _margin, tileMin, tileMax + 1),
26446 clamp3(Math.ceil(_size[1] / k2 - origin[1]) + _margin, tileMin, tileMax + 1)
26449 for (var i3 = 0; i3 < rows.length; i3++) {
26451 for (var j3 = 0; j3 < cols.length; j3++) {
26453 if (i3 >= _margin && i3 <= rows.length - _margin && j3 >= _margin && j3 <= cols.length - _margin) {
26454 tiles.unshift([x2, y2, z0]);
26456 tiles.push([x2, y2, z0]);
26460 tiles.translate = origin;
26464 tiler9.getTiles = function(projection2) {
26466 projection2.scale() * Math.PI - projection2.translate()[0],
26467 projection2.scale() * Math.PI - projection2.translate()[1]
26469 this.size(projection2.clipExtent()[1]).scale(projection2.scale() * 2 * Math.PI).translate(projection2.translate());
26470 var tiles = tiler9();
26471 var ts = tiles.scale;
26472 return tiles.map(function(tile) {
26473 if (_skipNullIsland && nearNullIsland(tile)) {
26476 var x2 = tile[0] * ts - origin[0];
26477 var y2 = tile[1] * ts - origin[1];
26479 id: tile.toString(),
26482 projection2.invert([x2, y2 + ts]),
26483 projection2.invert([x2 + ts, y2])
26486 }).filter(Boolean);
26488 tiler9.getGeoJSON = function(projection2) {
26489 var features = tiler9.getTiles(projection2).map(function(tile) {
26498 coordinates: [tile.extent.polygon()]
26503 type: "FeatureCollection",
26507 tiler9.tileSize = function(val) {
26508 if (!arguments.length)
26513 tiler9.zoomExtent = function(val) {
26514 if (!arguments.length)
26515 return _zoomExtent;
26519 tiler9.size = function(val) {
26520 if (!arguments.length)
26525 tiler9.scale = function(val) {
26526 if (!arguments.length)
26531 tiler9.translate = function(val) {
26532 if (!arguments.length)
26537 tiler9.margin = function(val) {
26538 if (!arguments.length)
26543 tiler9.skipNullIsland = function(val) {
26544 if (!arguments.length)
26545 return _skipNullIsland;
26546 _skipNullIsland = val;
26552 // modules/util/trigger_event.js
26553 function utilTriggerEvent(target, type2, eventProperties) {
26554 target.each(function() {
26555 var evt = document.createEvent("HTMLEvents");
26556 evt.initEvent(type2, true, true);
26557 for (var prop in eventProperties) {
26558 evt[prop] = eventProperties[prop];
26560 this.dispatchEvent(evt);
26564 // modules/core/localizer.js
26565 var _mainLocalizer = coreLocalizer();
26566 var _t = _mainLocalizer.t;
26567 function coreLocalizer() {
26568 let localizer = {};
26569 let _dataLanguages = {};
26570 let _dataLocales = {};
26571 let _localeStrings = {};
26572 let _localeCode = "en-US";
26573 let _localeCodes = ["en-US", "en"];
26574 let _languageCode = "en";
26575 let _textDirection = "ltr";
26576 let _usesMetric = false;
26577 let _languageNames = {};
26578 let _scriptNames = {};
26579 localizer.localeCode = () => _localeCode;
26580 localizer.localeCodes = () => _localeCodes;
26581 localizer.languageCode = () => _languageCode;
26582 localizer.textDirection = () => _textDirection;
26583 localizer.usesMetric = () => _usesMetric;
26584 localizer.languageNames = () => _languageNames;
26585 localizer.scriptNames = () => _scriptNames;
26586 let _preferredLocaleCodes = [];
26587 localizer.preferredLocaleCodes = function(codes) {
26588 if (!arguments.length)
26589 return _preferredLocaleCodes;
26590 if (typeof codes === "string") {
26591 _preferredLocaleCodes = codes.split(/,|;| /gi).filter(Boolean);
26593 _preferredLocaleCodes = codes;
26598 localizer.ensureLoaded = () => {
26600 return _loadPromise;
26601 let filesToFetch = [
26603 // load the list of languages
26605 // load the list of supported locales
26607 const localeDirs = {
26608 general: "locales",
26609 tagging: presetsCdnUrl + "dist/translations"
26611 let fileMap = _mainFileFetcher.fileMap();
26612 for (let scopeId in localeDirs) {
26613 const key = `locales_index_${scopeId}`;
26614 if (!fileMap[key]) {
26615 fileMap[key] = localeDirs[scopeId] + "/index.min.json";
26617 filesToFetch.push(key);
26619 return _loadPromise = Promise.all(filesToFetch.map((key) => _mainFileFetcher.get(key))).then((results) => {
26620 _dataLanguages = results[0];
26621 _dataLocales = results[1];
26622 let indexes = results.slice(2);
26623 let requestedLocales = (_preferredLocaleCodes || []).concat(utilDetect().browserLocales).concat(["en"]);
26624 _localeCodes = localesToUseFrom(requestedLocales);
26625 _localeCode = _localeCodes[0];
26626 let loadStringsPromises = [];
26627 indexes.forEach((index, i3) => {
26628 const fullCoverageIndex = _localeCodes.findIndex(function(locale2) {
26629 return index[locale2] && index[locale2].pct === 1;
26631 _localeCodes.slice(0, fullCoverageIndex + 1).forEach(function(code) {
26632 let scopeId = Object.keys(localeDirs)[i3];
26633 let directory = Object.values(localeDirs)[i3];
26635 loadStringsPromises.push(localizer.loadLocale(code, scopeId, directory));
26638 return Promise.all(loadStringsPromises);
26640 updateForCurrentLocale();
26641 }).catch((err) => console.error(err));
26643 function localesToUseFrom(requestedLocales) {
26644 let supportedLocales = _dataLocales;
26646 for (let i3 in requestedLocales) {
26647 let locale2 = requestedLocales[i3];
26648 if (supportedLocales[locale2])
26649 toUse.push(locale2);
26650 if (locale2.includes("-")) {
26651 let langPart = locale2.split("-")[0];
26652 if (supportedLocales[langPart])
26653 toUse.push(langPart);
26656 return utilArrayUniq(toUse);
26658 function updateForCurrentLocale() {
26661 _languageCode = _localeCode.split("-")[0];
26662 const currentData = _dataLocales[_localeCode] || _dataLocales[_languageCode];
26663 const hash = utilStringQs(window.location.hash);
26664 if (hash.rtl === "true") {
26665 _textDirection = "rtl";
26666 } else if (hash.rtl === "false") {
26667 _textDirection = "ltr";
26669 _textDirection = currentData && currentData.rtl ? "rtl" : "ltr";
26671 let locale2 = _localeCode;
26672 if (locale2.toLowerCase() === "en-us")
26674 _languageNames = _localeStrings.general[locale2].languageNames || _localeStrings.general[_languageCode].languageNames;
26675 _scriptNames = _localeStrings.general[locale2].scriptNames || _localeStrings.general[_languageCode].scriptNames;
26676 _usesMetric = _localeCode.slice(-3).toLowerCase() !== "-us";
26678 localizer.loadLocale = (locale2, scopeId, directory) => {
26679 if (locale2.toLowerCase() === "en-us")
26681 if (_localeStrings[scopeId] && _localeStrings[scopeId][locale2]) {
26682 return Promise.resolve(locale2);
26684 let fileMap = _mainFileFetcher.fileMap();
26685 const key = `locale_${scopeId}_${locale2}`;
26686 if (!fileMap[key]) {
26687 fileMap[key] = `${directory}/${locale2}.min.json`;
26689 return _mainFileFetcher.get(key).then((d2) => {
26690 if (!_localeStrings[scopeId])
26691 _localeStrings[scopeId] = {};
26692 _localeStrings[scopeId][locale2] = d2[locale2];
26696 localizer.pluralRule = function(number3) {
26697 return pluralRule(number3, _localeCode);
26699 function pluralRule(number3, localeCode) {
26700 const rules = "Intl" in window && Intl.PluralRules && new Intl.PluralRules(localeCode);
26702 return rules.select(number3);
26708 localizer.tInfo = function(origStringId, replacements, locale2) {
26709 let stringId = origStringId.trim();
26710 let scopeId = "general";
26711 if (stringId[0] === "_") {
26712 let split = stringId.split(".");
26713 scopeId = split[0].slice(1);
26714 stringId = split.slice(1).join(".");
26716 locale2 = locale2 || _localeCode;
26717 let path = stringId.split(".").map((s2) => s2.replace(/<TX_DOT>/g, ".")).reverse();
26718 let stringsKey = locale2;
26719 if (stringsKey.toLowerCase() === "en-us")
26721 let result = _localeStrings && _localeStrings[scopeId] && _localeStrings[scopeId][stringsKey];
26722 while (result !== void 0 && path.length) {
26723 result = result[path.pop()];
26725 if (result !== void 0) {
26726 if (replacements) {
26727 if (typeof result === "object" && Object.keys(result).length) {
26728 const number3 = Object.values(replacements).find(function(value) {
26729 return typeof value === "number";
26731 if (number3 !== void 0) {
26732 const rule = pluralRule(number3, locale2);
26733 if (result[rule]) {
26734 result = result[rule];
26736 result = Object.values(result)[0];
26740 if (typeof result === "string") {
26741 for (let key in replacements) {
26742 let value = replacements[key];
26743 if (typeof value === "number") {
26744 if (value.toLocaleString) {
26745 value = value.toLocaleString(locale2, {
26748 minimumFractionDigits: 0
26751 value = value.toString();
26754 const token = `{${key}}`;
26755 const regex = new RegExp(token, "g");
26756 result = result.replace(regex, value);
26760 if (typeof result === "string") {
26767 let index = _localeCodes.indexOf(locale2);
26768 if (index >= 0 && index < _localeCodes.length - 1) {
26769 let fallback = _localeCodes[index + 1];
26770 return localizer.tInfo(origStringId, replacements, fallback);
26772 if (replacements && "default" in replacements) {
26774 text: replacements.default,
26778 const missing = `Missing ${locale2} translation: ${origStringId}`;
26779 if (typeof console !== "undefined")
26780 console.error(missing);
26786 localizer.hasTextForStringId = function(stringId) {
26787 return !!localizer.tInfo(stringId, { default: "nothing found" }).locale;
26789 localizer.t = function(stringId, replacements, locale2) {
26790 return localizer.tInfo(stringId, replacements, locale2).text;
26792 localizer.t.html = function(stringId, replacements, locale2) {
26793 replacements = Object.assign({}, replacements);
26794 for (var k2 in replacements) {
26795 if (typeof replacements[k2] === "string") {
26796 replacements[k2] = escape_default(replacements[k2]);
26798 if (typeof replacements[k2] === "object" && typeof replacements[k2].html === "string") {
26799 replacements[k2] = replacements[k2].html;
26802 const info = localizer.tInfo(stringId, replacements, locale2);
26804 return `<span class="localized-text" lang="${info.locale || "und"}">${info.text}</span>`;
26809 localizer.t.append = function(stringId, replacements, locale2) {
26810 const ret = function(selection2) {
26811 const info = localizer.tInfo(stringId, replacements, locale2);
26812 return selection2.append("span").attr("class", "localized-text").attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
26814 ret.stringId = stringId;
26817 localizer.languageName = (code, options2) => {
26818 if (_languageNames && _languageNames[code]) {
26819 return _languageNames[code];
26821 if (options2 && options2.localOnly)
26823 const langInfo = _dataLanguages[code];
26825 if (langInfo.nativeName) {
26826 return localizer.t("translate.language_and_code", { language: langInfo.nativeName, code });
26827 } else if (langInfo.base && langInfo.script) {
26828 const base = langInfo.base;
26829 if (_languageNames && _languageNames[base]) {
26830 const scriptCode = langInfo.script;
26831 const script = _scriptNames && _scriptNames[scriptCode] || scriptCode;
26832 return localizer.t("translate.language_and_code", { language: _languageNames[base], code: script });
26833 } else if (_dataLanguages[base] && _dataLanguages[base].nativeName) {
26834 return localizer.t("translate.language_and_code", { language: _dataLanguages[base].nativeName, code });
26840 localizer.floatFormatter = (locale2) => {
26841 if (!("Intl" in window && "NumberFormat" in Intl && "formatToParts" in Intl.NumberFormat.prototype)) {
26842 return (number3, fractionDigits) => {
26843 return fractionDigits === void 0 ? number3.toString() : number3.toFixed(fractionDigits);
26846 return (number3, fractionDigits) => number3.toLocaleString(locale2, {
26847 minimumFractionDigits: fractionDigits,
26848 maximumFractionDigits: fractionDigits === void 0 ? 20 : fractionDigits
26852 localizer.floatParser = (locale2) => {
26853 const polyfill = (string) => +string.trim();
26854 if (!("Intl" in window && "NumberFormat" in Intl))
26856 const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
26857 if (!("formatToParts" in format2))
26859 const parts = format2.formatToParts(-12345.6);
26860 const numerals = Array.from({ length: 10 }).map((_2, i3) => format2.format(i3));
26861 const index = new Map(numerals.map((d2, i3) => [d2, i3]));
26862 const literalPart = parts.find((d2) => d2.type === "literal");
26863 const literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
26864 const groupPart = parts.find((d2) => d2.type === "group");
26865 const group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
26866 const decimalPart = parts.find((d2) => d2.type === "decimal");
26867 const decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
26868 const numeral = new RegExp(`[${numerals.join("")}]`, "g");
26869 const getIndex = (d2) => index.get(d2);
26870 return (string) => {
26871 string = string.trim();
26873 string = string.replace(literal, "");
26875 string = string.replace(group, "");
26877 string = string.replace(decimal, ".");
26878 string = string.replace(numeral, getIndex);
26879 return string ? +string : NaN;
26882 localizer.decimalPlaceCounter = (locale2) => {
26883 var literal, group, decimal;
26884 if ("Intl" in window && "NumberFormat" in Intl) {
26885 const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
26886 if ("formatToParts" in format2) {
26887 const parts = format2.formatToParts(-12345.6);
26888 const literalPart = parts.find((d2) => d2.type === "literal");
26889 literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
26890 const groupPart = parts.find((d2) => d2.type === "group");
26891 group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
26892 const decimalPart = parts.find((d2) => d2.type === "decimal");
26893 decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
26896 return (string) => {
26897 string = string.trim();
26899 string = string.replace(literal, "");
26901 string = string.replace(group, "");
26902 const parts = string.split(decimal || ".");
26903 return parts && parts[1] && parts[1].length || 0;
26909 // modules/presets/collection.js
26910 function presetCollection(collection) {
26911 const MAXRESULTS = 50;
26914 _this.collection = collection;
26915 _this.item = (id2) => {
26918 const found = _this.collection.find((d2) => d2.id === id2);
26920 _memo[id2] = found;
26923 _this.index = (id2) => _this.collection.findIndex((d2) => d2.id === id2);
26924 _this.matchGeometry = (geometry) => {
26925 return presetCollection(
26926 _this.collection.filter((d2) => d2.matchGeometry(geometry))
26929 _this.matchAllGeometry = (geometries) => {
26930 return presetCollection(
26931 _this.collection.filter((d2) => d2 && d2.matchAllGeometry(geometries))
26934 _this.matchAnyGeometry = (geometries) => {
26935 return presetCollection(
26936 _this.collection.filter((d2) => geometries.some((geom) => d2.matchGeometry(geom)))
26939 _this.fallback = (geometry) => {
26940 let id2 = geometry;
26941 if (id2 === "vertex")
26943 return _this.item(id2);
26945 _this.search = (value, geometry, loc) => {
26948 value = value.toLowerCase().trim();
26949 function leading(a2) {
26950 const index = a2.indexOf(value);
26951 return index === 0 || a2[index - 1] === " ";
26953 function leadingStrict(a2) {
26954 const index = a2.indexOf(value);
26955 return index === 0;
26957 function sortPresets(nameProp, aliasesProp) {
26958 return function sortNames(a2, b2) {
26959 let aCompare = a2[nameProp]();
26960 let bCompare = b2[nameProp]();
26962 const findMatchingAlias = (strings) => {
26963 if (strings.some((s2) => s2 === value)) {
26964 return strings.find((s2) => s2 === value);
26966 return strings.filter((s2) => s2.includes(value)).sort((a3, b3) => a3.length - b3.length)[0];
26969 aCompare = findMatchingAlias([aCompare].concat(a2[aliasesProp]()));
26970 bCompare = findMatchingAlias([bCompare].concat(b2[aliasesProp]()));
26972 if (value === aCompare)
26974 if (value === bCompare)
26976 let i3 = b2.originalScore - a2.originalScore;
26979 i3 = aCompare.indexOf(value) - bCompare.indexOf(value);
26982 return aCompare.length - bCompare.length;
26985 let pool = _this.collection;
26986 if (Array.isArray(loc)) {
26987 const validHere = _sharedLocationManager.locationSetsAt(loc);
26988 pool = pool.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
26990 const searchable = pool.filter((a2) => a2.searchable !== false && a2.suggestion !== true);
26991 const suggestions = pool.filter((a2) => a2.suggestion === true);
26992 const leadingNames = searchable.filter((a2) => leading(a2.searchName()) || a2.searchAliases().some(leading)).sort(sortPresets("searchName", "searchAliases"));
26993 const leadingSuggestions = suggestions.filter((a2) => leadingStrict(a2.searchName())).sort(sortPresets("searchName"));
26994 const leadingNamesStripped = searchable.filter((a2) => leading(a2.searchNameStripped()) || a2.searchAliasesStripped().some(leading)).sort(sortPresets("searchNameStripped", "searchAliasesStripped"));
26995 const leadingSuggestionsStripped = suggestions.filter((a2) => leadingStrict(a2.searchNameStripped())).sort(sortPresets("searchNameStripped"));
26996 const leadingTerms = searchable.filter((a2) => (a2.terms() || []).some(leading));
26997 const leadingSuggestionTerms = suggestions.filter((a2) => (a2.terms() || []).some(leading));
26998 const leadingTagValues = searchable.filter((a2) => Object.values(a2.tags || {}).filter((val) => val !== "*").some(leading));
26999 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);
27000 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);
27001 const similarTerms = searchable.filter((a2) => {
27002 return (a2.terms() || []).some((b2) => {
27003 return utilEditDistance(value, b2) + Math.min(value.length - b2.length, 0) < 3;
27006 let leadingTagKeyValues = [];
27007 if (value.includes("=")) {
27008 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]))));
27010 let results = leadingNames.concat(
27011 leadingSuggestions,
27012 leadingNamesStripped,
27013 leadingSuggestionsStripped,
27015 leadingSuggestionTerms,
27018 similarSuggestions,
27020 leadingTagKeyValues
27021 ).slice(0, MAXRESULTS - 1);
27023 if (typeof geometry === "string") {
27024 results.push(_this.fallback(geometry));
27026 geometry.forEach((geom) => results.push(_this.fallback(geom)));
27029 return presetCollection(utilArrayUniq(results));
27034 // modules/presets/category.js
27035 function presetCategory(categoryID, category, allPresets) {
27036 let _this = Object.assign({}, category);
27038 let _searchNameStripped;
27039 _this.id = categoryID;
27040 _this.members = presetCollection(
27041 (category.members || []).map((presetID) => allPresets[presetID]).filter(Boolean)
27043 _this.geometry = _this.members.collection.reduce((acc, preset) => {
27044 for (let i3 in preset.geometry) {
27045 const geometry = preset.geometry[i3];
27046 if (acc.indexOf(geometry) === -1) {
27047 acc.push(geometry);
27052 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
27053 _this.matchAllGeometry = (geometries) => _this.members.collection.some((preset) => preset.matchAllGeometry(geometries));
27054 _this.matchScore = () => -1;
27055 _this.name = () => _t(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
27056 _this.nameLabel = () => _t.append(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
27057 _this.terms = () => [];
27058 _this.searchName = () => {
27059 if (!_searchName) {
27060 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
27062 return _searchName;
27064 _this.searchNameStripped = () => {
27065 if (!_searchNameStripped) {
27066 _searchNameStripped = _this.searchName();
27067 if (_searchNameStripped.normalize)
27068 _searchNameStripped = _searchNameStripped.normalize("NFD");
27069 _searchNameStripped = _searchNameStripped.replace(/[\u0300-\u036f]/g, "");
27071 return _searchNameStripped;
27073 _this.searchAliases = () => [];
27074 _this.searchAliasesStripped = () => [];
27078 // modules/presets/field.js
27079 function presetField(fieldID, field, allFields) {
27080 allFields = allFields || {};
27081 let _this = Object.assign({}, field);
27082 _this.id = fieldID;
27083 _this.safeid = utilSafeClassName(fieldID);
27084 _this.matchGeometry = (geom) => !_this.geometry || _this.geometry.indexOf(geom) !== -1;
27085 _this.matchAllGeometry = (geometries) => {
27086 return !_this.geometry || geometries.every((geom) => _this.geometry.indexOf(geom) !== -1);
27088 _this.t = (scope, options2) => _t(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27089 _this.t.html = (scope, options2) => _t.html(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27090 _this.t.append = (scope, options2) => _t.append(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27091 _this.hasTextForStringId = (scope) => _mainLocalizer.hasTextForStringId(`_tagging.presets.fields.${fieldID}.${scope}`);
27092 _this.resolveReference = (which) => {
27093 const referenceRegex = /^\{(.*)\}$/;
27094 const match = (field[which] || "").match(referenceRegex);
27096 const field2 = allFields[match[1]];
27100 console.error(`Unable to resolve referenced field: ${match[1]}`);
27104 _this.title = () => _this.overrideLabel || _this.resolveReference("label").t("label", { "default": fieldID });
27105 _this.label = () => _this.overrideLabel ? (selection2) => selection2.text(_this.overrideLabel) : _this.resolveReference("label").t.append("label", { "default": fieldID });
27106 _this.placeholder = () => _this.resolveReference("placeholder").t("placeholder", { "default": "" });
27107 _this.originalTerms = (_this.terms || []).join();
27108 _this.terms = () => _this.resolveReference("label").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
27109 _this.increment = _this.type === "number" ? _this.increment || 1 : void 0;
27113 // modules/presets/preset.js
27114 var import_lodash = __toESM(require_lodash());
27115 function presetPreset(presetID, preset, addable, allFields, allPresets) {
27116 allFields = allFields || {};
27117 allPresets = allPresets || {};
27118 let _this = Object.assign({}, preset);
27119 let _addable = addable || false;
27121 let _searchNameStripped;
27122 let _searchAliases;
27123 let _searchAliasesStripped;
27124 const referenceRegex = /^\{(.*)\}$/;
27125 _this.id = presetID;
27126 _this.safeid = utilSafeClassName(presetID);
27127 _this.originalTerms = (_this.terms || []).join();
27128 _this.originalName = _this.name || "";
27129 _this.originalAliases = (_this.aliases || []).join("\n");
27130 _this.originalScore = _this.matchScore || 1;
27131 _this.originalReference = _this.reference || {};
27132 _this.originalFields = _this.fields || [];
27133 _this.originalMoreFields = _this.moreFields || [];
27134 _this.fields = (loc) => resolveFields("fields", loc);
27135 _this.moreFields = (loc) => resolveFields("moreFields", loc);
27136 _this.tags = _this.tags || {};
27137 _this.addTags = _this.addTags || _this.tags;
27138 _this.removeTags = _this.removeTags || _this.addTags;
27139 _this.geometry = _this.geometry || [];
27140 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
27141 _this.matchAllGeometry = (geoms) => geoms.every(_this.matchGeometry);
27142 _this.matchScore = (entityTags) => {
27143 const tags = _this.tags;
27146 for (let k2 in tags) {
27148 if (entityTags[k2] === tags[k2]) {
27149 score += _this.originalScore;
27150 } else if (tags[k2] === "*" && k2 in entityTags) {
27151 score += _this.originalScore / 2;
27156 const addTags = _this.addTags;
27157 for (let k2 in addTags) {
27158 if (!seen[k2] && entityTags[k2] === addTags[k2]) {
27159 score += _this.originalScore;
27162 if (_this.searchable === false) {
27167 _this.t = (scope, options2) => {
27168 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
27169 return _t(textID, options2);
27171 _this.t.append = (scope, options2) => {
27172 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
27173 return _t.append(textID, options2);
27175 function resolveReference(which) {
27176 const match = (_this[which] || "").match(referenceRegex);
27178 const preset2 = allPresets[match[1]];
27182 console.error(`Unable to resolve referenced preset: ${match[1]}`);
27186 _this.name = () => {
27187 return resolveReference("originalName").t("name", { "default": _this.originalName || presetID });
27189 _this.nameLabel = () => {
27190 return resolveReference("originalName").t.append("name", { "default": _this.originalName || presetID });
27192 _this.subtitle = () => {
27193 if (_this.suggestion) {
27194 let path = presetID.split("/");
27196 return _t("_tagging.presets.presets." + path.join("/") + ".name");
27200 _this.subtitleLabel = () => {
27201 if (_this.suggestion) {
27202 let path = presetID.split("/");
27204 return _t.append("_tagging.presets.presets." + path.join("/") + ".name");
27208 _this.aliases = () => {
27209 return resolveReference("originalName").t("aliases", { "default": _this.originalAliases }).trim().split(/\s*[\r\n]+\s*/);
27211 _this.terms = () => {
27212 return resolveReference("originalName").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
27214 _this.searchName = () => {
27215 if (!_searchName) {
27216 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
27218 return _searchName;
27220 _this.searchNameStripped = () => {
27221 if (!_searchNameStripped) {
27222 _searchNameStripped = stripDiacritics(_this.searchName());
27224 return _searchNameStripped;
27226 _this.searchAliases = () => {
27227 if (!_searchAliases) {
27228 _searchAliases = _this.aliases().map((alias) => alias.toLowerCase());
27230 return _searchAliases;
27232 _this.searchAliasesStripped = () => {
27233 if (!_searchAliasesStripped) {
27234 _searchAliasesStripped = _this.searchAliases();
27235 _searchAliasesStripped = _searchAliasesStripped.map(stripDiacritics);
27237 return _searchAliasesStripped;
27239 _this.isFallback = () => {
27240 const tagCount = Object.keys(_this.tags).length;
27241 return tagCount === 0 || tagCount === 1 && _this.tags.hasOwnProperty("area");
27243 _this.addable = function(val) {
27244 if (!arguments.length)
27249 _this.reference = () => {
27250 const qid = _this.tags.wikidata || _this.tags["flag:wikidata"] || _this.tags["brand:wikidata"] || _this.tags["network:wikidata"] || _this.tags["operator:wikidata"];
27254 let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, "name"))[0];
27255 let value = _this.originalReference.value || _this.tags[key];
27256 if (value === "*") {
27259 return { key, value };
27262 _this.unsetTags = (tags, geometry, ignoringKeys, skipFieldDefaults, loc) => {
27263 let removeTags = ignoringKeys ? utilObjectOmit(_this.removeTags, ignoringKeys) : _this.removeTags;
27264 tags = utilObjectOmit(tags, Object.keys(removeTags));
27265 if (geometry && !skipFieldDefaults) {
27266 _this.fields(loc).forEach((field) => {
27267 if (field.matchGeometry(geometry) && field.key && field.default === tags[field.key] && (!ignoringKeys || ignoringKeys.indexOf(field.key) === -1)) {
27268 delete tags[field.key];
27275 _this.setTags = (tags, geometry, skipFieldDefaults, loc) => {
27276 const addTags = _this.addTags;
27277 tags = Object.assign({}, tags);
27278 for (let k2 in addTags) {
27279 if (addTags[k2] === "*") {
27280 if (_this.tags[k2] || !tags[k2]) {
27284 tags[k2] = addTags[k2];
27287 if (!addTags.hasOwnProperty("area")) {
27289 if (geometry === "area") {
27290 let needsAreaTag = true;
27291 for (let k2 in addTags) {
27292 if (_this.geometry.indexOf("line") === -1 && k2 in osmAreaKeys || k2 in osmAreaKeysExceptions && addTags[k2] in osmAreaKeysExceptions[k2]) {
27293 needsAreaTag = false;
27297 if (needsAreaTag) {
27302 if (geometry && !skipFieldDefaults) {
27303 _this.fields(loc).forEach((field) => {
27304 if (field.matchGeometry(geometry) && field.key && !tags[field.key] && field.default) {
27305 tags[field.key] = field.default;
27311 function resolveFields(which, loc) {
27312 const fieldIDs = which === "fields" ? _this.originalFields : _this.originalMoreFields;
27314 fieldIDs.forEach((fieldID) => {
27315 const match = fieldID.match(referenceRegex);
27316 if (match !== null) {
27317 resolved = resolved.concat(inheritFields(allPresets[match[1]], which));
27318 } else if (allFields[fieldID]) {
27319 resolved.push(allFields[fieldID]);
27321 console.log(`Cannot resolve "${fieldID}" found in ${_this.id}.${which}`);
27324 if (!resolved.length) {
27325 const endIndex = _this.id.lastIndexOf("/");
27326 const parentID = endIndex && _this.id.substring(0, endIndex);
27328 let parent = allPresets[parentID];
27330 const validHere = _sharedLocationManager.locationSetsAt(loc);
27331 if (parent?.locationSetID && !validHere[parent.locationSetID]) {
27332 const candidateIDs = Object.keys(allPresets).filter((k2) => k2.startsWith(parentID));
27333 parent = allPresets[candidateIDs.find((candidateID) => {
27334 const candidate = allPresets[candidateID];
27335 return validHere[candidate.locationSetID] && (0, import_lodash.isEqual)(candidate.tags, parent.tags);
27339 resolved = inheritFields(parent, which);
27342 return utilArrayUniq(resolved);
27343 function inheritFields(parent, which2) {
27346 if (which2 === "fields") {
27347 return parent.fields().filter(shouldInherit);
27348 } else if (which2 === "moreFields") {
27349 return parent.moreFields();
27354 function shouldInherit(f3) {
27355 if (f3.key && _this.tags[f3.key] !== void 0 && // inherit anyway if multiple values are allowed or just a checkbox
27356 f3.type !== "multiCombo" && f3.type !== "semiCombo" && f3.type !== "manyCombo" && f3.type !== "check")
27361 function stripDiacritics(s2) {
27363 s2 = s2.normalize("NFD");
27364 s2 = s2.replace(/[\u0300-\u036f]/g, "");
27370 // modules/presets/index.js
27371 var _mainPresetIndex = presetIndex();
27372 function presetIndex() {
27373 const dispatch14 = dispatch_default("favoritePreset", "recentsChange");
27374 const MAXRECENTS = 30;
27375 const POINT = presetPreset("point", { name: "Point", tags: {}, geometry: ["point", "vertex"], matchScore: 0.1 });
27376 const LINE = presetPreset("line", { name: "Line", tags: {}, geometry: ["line"], matchScore: 0.1 });
27377 const AREA = presetPreset("area", { name: "Area", tags: { area: "yes" }, geometry: ["area"], matchScore: 0.1 });
27378 const RELATION = presetPreset("relation", { name: "Relation", tags: {}, geometry: ["relation"], matchScore: 0.1 });
27379 let _this = presetCollection([POINT, LINE, AREA, RELATION]);
27380 let _presets = { point: POINT, line: LINE, area: AREA, relation: RELATION };
27382 point: presetCollection([POINT]),
27383 vertex: presetCollection([POINT]),
27384 line: presetCollection([LINE]),
27385 area: presetCollection([AREA]),
27386 relation: presetCollection([RELATION])
27389 let _categories = {};
27390 let _universal = [];
27391 let _addablePresetIDs = null;
27394 let _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
27396 _this.ensureLoaded = () => {
27398 return _loadPromise;
27399 return _loadPromise = Promise.all([
27400 _mainFileFetcher.get("preset_categories"),
27401 _mainFileFetcher.get("preset_defaults"),
27402 _mainFileFetcher.get("preset_presets"),
27403 _mainFileFetcher.get("preset_fields")
27404 ]).then((vals) => {
27406 categories: vals[0],
27411 osmSetAreaKeys(_this.areaKeys());
27412 osmSetLineTags(_this.lineTags());
27413 osmSetPointTags(_this.pointTags());
27414 osmSetVertexTags(_this.vertexTags());
27417 _this.merge = (d2) => {
27418 let newLocationSets = [];
27420 Object.keys(d2.fields).forEach((fieldID) => {
27421 let f3 = d2.fields[fieldID];
27423 f3 = presetField(fieldID, f3, _fields);
27424 if (f3.locationSet)
27425 newLocationSets.push(f3);
27426 _fields[fieldID] = f3;
27428 delete _fields[fieldID];
27433 Object.keys(d2.presets).forEach((presetID) => {
27434 let p2 = d2.presets[presetID];
27436 const isAddable = !_addablePresetIDs || _addablePresetIDs.has(presetID);
27437 p2 = presetPreset(presetID, p2, isAddable, _fields, _presets);
27438 if (p2.locationSet)
27439 newLocationSets.push(p2);
27440 _presets[presetID] = p2;
27442 const existing = _presets[presetID];
27443 if (existing && !existing.isFallback()) {
27444 delete _presets[presetID];
27449 if (d2.categories) {
27450 Object.keys(d2.categories).forEach((categoryID) => {
27451 let c2 = d2.categories[categoryID];
27453 c2 = presetCategory(categoryID, c2, _presets);
27454 if (c2.locationSet)
27455 newLocationSets.push(c2);
27456 _categories[categoryID] = c2;
27458 delete _categories[categoryID];
27462 _this.collection = Object.values(_presets).concat(Object.values(_categories));
27464 Object.keys(d2.defaults).forEach((geometry) => {
27465 const def = d2.defaults[geometry];
27466 if (Array.isArray(def)) {
27467 _defaults2[geometry] = presetCollection(
27468 def.map((id2) => _presets[id2] || _categories[id2]).filter(Boolean)
27471 delete _defaults2[geometry];
27475 _universal = Object.values(_fields).filter((field) => field.universal);
27476 _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
27477 _this.collection.forEach((preset) => {
27478 (preset.geometry || []).forEach((geometry) => {
27479 let g3 = _geometryIndex[geometry];
27480 for (let key in preset.tags) {
27481 g3[key] = g3[key] || {};
27482 let value = preset.tags[key];
27483 (g3[key][value] = g3[key][value] || []).push(preset);
27487 if (d2.featureCollection && Array.isArray(d2.featureCollection.features)) {
27488 _sharedLocationManager.mergeCustomGeoJSON(d2.featureCollection);
27490 if (newLocationSets.length) {
27491 _sharedLocationManager.mergeLocationSets(newLocationSets);
27495 _this.match = (entity, resolver) => {
27496 return resolver.transient(entity, "presetMatch", () => {
27497 let geometry = entity.geometry(resolver);
27498 if (geometry === "vertex" && entity.isOnAddressLine(resolver)) {
27499 geometry = "point";
27501 const entityExtent = entity.extent(resolver);
27502 return _this.matchTags(entity.tags, geometry, entityExtent.center());
27505 _this.matchTags = (tags, geometry, loc) => {
27506 const keyIndex = _geometryIndex[geometry];
27507 let bestScore = -1;
27509 let matchCandidates = [];
27510 for (let k2 in tags) {
27511 let indexMatches = [];
27512 let valueIndex = keyIndex[k2];
27515 let keyValueMatches = valueIndex[tags[k2]];
27516 if (keyValueMatches)
27517 indexMatches.push(...keyValueMatches);
27518 let keyStarMatches = valueIndex["*"];
27519 if (keyStarMatches)
27520 indexMatches.push(...keyStarMatches);
27521 if (indexMatches.length === 0)
27523 for (let i3 = 0; i3 < indexMatches.length; i3++) {
27524 const candidate = indexMatches[i3];
27525 const score = candidate.matchScore(tags);
27526 if (score === -1) {
27529 matchCandidates.push({ score, candidate });
27530 if (score > bestScore) {
27532 bestMatch = candidate;
27536 if (bestMatch && bestMatch.locationSetID && bestMatch.locationSetID !== "+[Q2]" && Array.isArray(loc)) {
27537 const validHere = _sharedLocationManager.locationSetsAt(loc);
27538 if (!validHere[bestMatch.locationSetID]) {
27539 matchCandidates.sort((a2, b2) => a2.score < b2.score ? 1 : -1);
27540 for (let i3 = 0; i3 < matchCandidates.length; i3++) {
27541 const candidateScore = matchCandidates[i3];
27542 if (!candidateScore.candidate.locationSetID || validHere[candidateScore.candidate.locationSetID]) {
27543 bestMatch = candidateScore.candidate;
27544 bestScore = candidateScore.score;
27550 if (!bestMatch || bestMatch.isFallback()) {
27551 for (let k2 in tags) {
27552 if (/^addr:/.test(k2) && keyIndex["addr:*"] && keyIndex["addr:*"]["*"]) {
27553 bestMatch = keyIndex["addr:*"]["*"][0];
27558 return bestMatch || _this.fallback(geometry);
27560 _this.allowsVertex = (entity, resolver) => {
27561 if (entity.type !== "node")
27563 if (Object.keys(entity.tags).length === 0)
27565 return resolver.transient(entity, "vertexMatch", () => {
27566 if (entity.isOnAddressLine(resolver))
27568 const geometries = osmNodeGeometriesForTags(entity.tags);
27569 if (geometries.vertex)
27571 if (geometries.point)
27576 _this.areaKeys = () => {
27583 traffic_calming: true,
27587 const presets = _this.collection.filter((p2) => !p2.suggestion && !p2.replacement);
27588 presets.forEach((p2) => {
27589 const keys2 = p2.tags && Object.keys(p2.tags);
27590 const key = keys2 && keys2.length && keys2[0];
27595 if (p2.geometry.indexOf("area") !== -1) {
27596 areaKeys[key] = areaKeys[key] || {};
27599 presets.forEach((p2) => {
27601 for (key in p2.addTags) {
27602 const value = p2.addTags[key];
27603 if (key in areaKeys && // probably an area...
27604 p2.geometry.indexOf("line") !== -1 && // but sometimes a line
27606 areaKeys[key][value] = true;
27612 _this.lineTags = () => {
27613 return _this.collection.filter((lineTags, d2) => {
27614 if (d2.suggestion || d2.replacement || d2.searchable === false)
27616 const keys2 = d2.tags && Object.keys(d2.tags);
27617 const key = keys2 && keys2.length && keys2[0];
27620 if (d2.geometry.indexOf("line") !== -1) {
27621 lineTags[key] = lineTags[key] || [];
27622 lineTags[key].push(d2.tags);
27627 _this.pointTags = () => {
27628 return _this.collection.reduce((pointTags, d2) => {
27629 if (d2.suggestion || d2.replacement || d2.searchable === false)
27631 const keys2 = d2.tags && Object.keys(d2.tags);
27632 const key = keys2 && keys2.length && keys2[0];
27635 if (d2.geometry.indexOf("point") !== -1) {
27636 pointTags[key] = pointTags[key] || {};
27637 pointTags[key][d2.tags[key]] = true;
27642 _this.vertexTags = () => {
27643 return _this.collection.reduce((vertexTags, d2) => {
27644 if (d2.suggestion || d2.replacement || d2.searchable === false)
27646 const keys2 = d2.tags && Object.keys(d2.tags);
27647 const key = keys2 && keys2.length && keys2[0];
27650 if (d2.geometry.indexOf("vertex") !== -1) {
27651 vertexTags[key] = vertexTags[key] || {};
27652 vertexTags[key][d2.tags[key]] = true;
27657 _this.field = (id2) => _fields[id2];
27658 _this.universal = () => _universal;
27659 _this.defaults = (geometry, n3, startWithRecents, loc, extraPresets) => {
27661 if (startWithRecents) {
27662 recents = _this.recent().matchGeometry(geometry).collection.slice(0, 4);
27665 if (_addablePresetIDs) {
27666 defaults = Array.from(_addablePresetIDs).map(function(id2) {
27667 var preset = _this.item(id2);
27668 if (preset && preset.matchGeometry(geometry))
27671 }).filter(Boolean);
27673 defaults = _defaults2[geometry].collection.concat(_this.fallback(geometry));
27675 let result = presetCollection(
27676 utilArrayUniq(recents.concat(defaults).concat(extraPresets || [])).slice(0, n3 - 1)
27678 if (Array.isArray(loc)) {
27679 const validHere = _sharedLocationManager.locationSetsAt(loc);
27680 result.collection = result.collection.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
27684 _this.addablePresetIDs = function(val) {
27685 if (!arguments.length)
27686 return _addablePresetIDs;
27687 if (Array.isArray(val))
27688 val = new Set(val);
27689 _addablePresetIDs = val;
27690 if (_addablePresetIDs) {
27691 _this.collection.forEach((p2) => {
27693 p2.addable(_addablePresetIDs.has(p2.id));
27696 _this.collection.forEach((p2) => {
27703 _this.recent = () => {
27704 return presetCollection(
27705 utilArrayUniq(_this.getRecents().map((d2) => d2.preset).filter((d2) => d2.searchable !== false))
27708 function RibbonItem(preset, source) {
27710 item.preset = preset;
27711 item.source = source;
27712 item.isFavorite = () => item.source === "favorite";
27713 item.isRecent = () => item.source === "recent";
27714 item.matches = (preset2) => item.preset.id === preset2.id;
27715 item.minified = () => ({ pID: item.preset.id });
27718 function ribbonItemForMinified(d2, source) {
27719 if (d2 && d2.pID) {
27720 const preset = _this.item(d2.pID);
27723 return RibbonItem(preset, source);
27727 _this.getGenericRibbonItems = () => {
27728 return ["point", "line", "area"].map((id2) => RibbonItem(_this.item(id2), "generic"));
27730 _this.getAddable = () => {
27731 if (!_addablePresetIDs)
27733 return _addablePresetIDs.map((id2) => {
27734 const preset = _this.item(id2);
27736 return RibbonItem(preset, "addable");
27738 }).filter(Boolean);
27740 function setRecents(items) {
27742 const minifiedItems = items.map((d2) => d2.minified());
27743 corePreferences("preset_recents", JSON.stringify(minifiedItems));
27744 dispatch14.call("recentsChange");
27746 _this.getRecents = () => {
27748 _recents = (JSON.parse(corePreferences("preset_recents")) || []).reduce((acc, d2) => {
27749 let item = ribbonItemForMinified(d2, "recent");
27750 if (item && item.preset.addable())
27757 _this.addRecent = (preset, besidePreset, after) => {
27758 const recents = _this.getRecents();
27759 const beforeItem = _this.recentMatching(besidePreset);
27760 let toIndex = recents.indexOf(beforeItem);
27763 const newItem = RibbonItem(preset, "recent");
27764 recents.splice(toIndex, 0, newItem);
27765 setRecents(recents);
27767 _this.removeRecent = (preset) => {
27768 const item = _this.recentMatching(preset);
27770 let items = _this.getRecents();
27771 items.splice(items.indexOf(item), 1);
27775 _this.recentMatching = (preset) => {
27776 const items = _this.getRecents();
27777 for (let i3 in items) {
27778 if (items[i3].matches(preset)) {
27784 _this.moveItem = (items, fromIndex, toIndex) => {
27785 if (fromIndex === toIndex || fromIndex < 0 || toIndex < 0 || fromIndex >= items.length || toIndex >= items.length)
27787 items.splice(toIndex, 0, items.splice(fromIndex, 1)[0]);
27790 _this.moveRecent = (item, beforeItem) => {
27791 const recents = _this.getRecents();
27792 const fromIndex = recents.indexOf(item);
27793 const toIndex = recents.indexOf(beforeItem);
27794 const items = _this.moveItem(recents, fromIndex, toIndex);
27798 _this.setMostRecent = (preset) => {
27799 if (preset.searchable === false)
27801 let items = _this.getRecents();
27802 let item = _this.recentMatching(preset);
27804 items.splice(items.indexOf(item), 1);
27806 item = RibbonItem(preset, "recent");
27808 while (items.length >= MAXRECENTS) {
27811 items.unshift(item);
27814 function setFavorites(items) {
27815 _favorites = items;
27816 const minifiedItems = items.map((d2) => d2.minified());
27817 corePreferences("preset_favorites", JSON.stringify(minifiedItems));
27818 dispatch14.call("favoritePreset");
27820 _this.addFavorite = (preset, besidePreset, after) => {
27821 const favorites = _this.getFavorites();
27822 const beforeItem = _this.favoriteMatching(besidePreset);
27823 let toIndex = favorites.indexOf(beforeItem);
27826 const newItem = RibbonItem(preset, "favorite");
27827 favorites.splice(toIndex, 0, newItem);
27828 setFavorites(favorites);
27830 _this.toggleFavorite = (preset) => {
27831 const favs = _this.getFavorites();
27832 const favorite = _this.favoriteMatching(preset);
27834 favs.splice(favs.indexOf(favorite), 1);
27836 if (favs.length === 10) {
27839 favs.push(RibbonItem(preset, "favorite"));
27841 setFavorites(favs);
27843 _this.removeFavorite = (preset) => {
27844 const item = _this.favoriteMatching(preset);
27846 const items = _this.getFavorites();
27847 items.splice(items.indexOf(item), 1);
27848 setFavorites(items);
27851 _this.getFavorites = () => {
27853 let rawFavorites = JSON.parse(corePreferences("preset_favorites"));
27854 if (!rawFavorites) {
27856 corePreferences("preset_favorites", JSON.stringify(rawFavorites));
27858 _favorites = rawFavorites.reduce((output, d2) => {
27859 const item = ribbonItemForMinified(d2, "favorite");
27860 if (item && item.preset.addable())
27867 _this.favoriteMatching = (preset) => {
27868 const favs = _this.getFavorites();
27869 for (let index in favs) {
27870 if (favs[index].matches(preset)) {
27871 return favs[index];
27876 return utilRebind(_this, dispatch14, "on");
27879 // modules/util/util.js
27880 function utilTagText(entity) {
27881 var obj = entity && entity.tags || {};
27882 return Object.keys(obj).map(function(k2) {
27883 return k2 + "=" + obj[k2];
27886 function utilTotalExtent(array2, graph) {
27887 var extent = geoExtent();
27889 for (var i3 = 0; i3 < array2.length; i3++) {
27891 entity = typeof val === "string" ? graph.hasEntity(val) : val;
27893 extent._extend(entity.extent(graph));
27898 function utilTagDiff(oldTags, newTags) {
27900 var keys2 = utilArrayUnion(Object.keys(oldTags), Object.keys(newTags)).sort();
27901 keys2.forEach(function(k2) {
27902 var oldVal = oldTags[k2];
27903 var newVal = newTags[k2];
27904 if ((oldVal || oldVal === "") && (newVal === void 0 || newVal !== oldVal)) {
27910 display: "- " + k2 + "=" + oldVal
27913 if ((newVal || newVal === "") && (oldVal === void 0 || newVal !== oldVal)) {
27919 display: "+ " + k2 + "=" + newVal
27925 function utilEntitySelector(ids) {
27926 return ids.length ? "." + ids.join(",.") : "nothing";
27928 function utilEntityOrMemberSelector(ids, graph) {
27929 var seen = new Set(ids);
27930 ids.forEach(collectShallowDescendants);
27931 return utilEntitySelector(Array.from(seen));
27932 function collectShallowDescendants(id2) {
27933 var entity = graph.hasEntity(id2);
27934 if (!entity || entity.type !== "relation")
27936 entity.members.map(function(member) {
27938 }).forEach(function(id3) {
27943 function utilEntityOrDeepMemberSelector(ids, graph) {
27944 return utilEntitySelector(utilEntityAndDeepMemberIDs(ids, graph));
27946 function utilEntityAndDeepMemberIDs(ids, graph) {
27947 var seen = /* @__PURE__ */ new Set();
27948 ids.forEach(collectDeepDescendants);
27949 return Array.from(seen);
27950 function collectDeepDescendants(id2) {
27954 var entity = graph.hasEntity(id2);
27955 if (!entity || entity.type !== "relation")
27957 entity.members.map(function(member) {
27959 }).forEach(collectDeepDescendants);
27962 function utilDeepMemberSelector(ids, graph, skipMultipolgonMembers) {
27963 var idsSet = new Set(ids);
27964 var seen = /* @__PURE__ */ new Set();
27965 var returners = /* @__PURE__ */ new Set();
27966 ids.forEach(collectDeepDescendants);
27967 return utilEntitySelector(Array.from(returners));
27968 function collectDeepDescendants(id2) {
27972 if (!idsSet.has(id2)) {
27973 returners.add(id2);
27975 var entity = graph.hasEntity(id2);
27976 if (!entity || entity.type !== "relation")
27978 if (skipMultipolgonMembers && entity.isMultipolygon())
27980 entity.members.map(function(member) {
27982 }).forEach(collectDeepDescendants);
27985 function utilHighlightEntities(ids, highlighted, context) {
27986 context.surface().selectAll(utilEntityOrDeepMemberSelector(ids, context.graph())).classed("highlighted", highlighted);
27988 function utilGetAllNodes(ids, graph) {
27989 var seen = /* @__PURE__ */ new Set();
27990 var nodes = /* @__PURE__ */ new Set();
27991 ids.forEach(collectNodes);
27992 return Array.from(nodes);
27993 function collectNodes(id2) {
27997 var entity = graph.hasEntity(id2);
28000 if (entity.type === "node") {
28002 } else if (entity.type === "way") {
28003 entity.nodes.forEach(collectNodes);
28005 entity.members.map(function(member) {
28007 }).forEach(collectNodes);
28011 function utilDisplayName(entity) {
28012 var localizedNameKey = "name:" + _mainLocalizer.languageCode().toLowerCase();
28013 var name = entity.tags[localizedNameKey] || entity.tags.name || "";
28017 direction: entity.tags.direction,
28018 from: entity.tags.from,
28019 network: entity.tags.cycle_network || entity.tags.network,
28020 ref: entity.tags.ref,
28021 to: entity.tags.to,
28022 via: entity.tags.via
28024 var keyComponents = [];
28025 if (tags.network) {
28026 keyComponents.push("network");
28029 keyComponents.push("ref");
28031 if (entity.tags.route) {
28032 if (tags.direction) {
28033 keyComponents.push("direction");
28034 } else if (tags.from && tags.to) {
28035 keyComponents.push("from");
28036 keyComponents.push("to");
28038 keyComponents.push("via");
28042 if (keyComponents.length) {
28043 name = _t("inspector.display_name." + keyComponents.join("_"), tags);
28047 function utilDisplayNameForPath(entity) {
28048 var name = utilDisplayName(entity);
28049 var isFirefox = utilDetect().browser.toLowerCase().indexOf("firefox") > -1;
28050 var isNewChromium = Number(utilDetect().version.split(".")[0]) >= 96;
28051 if (!isFirefox && !isNewChromium && name && rtlRegex.test(name)) {
28052 name = fixRTLTextForSvg(name);
28056 function utilDisplayType(id2) {
28058 n: _t("inspector.node"),
28059 w: _t("inspector.way"),
28060 r: _t("inspector.relation")
28063 function utilDisplayLabel(entity, graphOrGeometry, verbose) {
28065 var displayName = utilDisplayName(entity);
28066 var preset = typeof graphOrGeometry === "string" ? _mainPresetIndex.matchTags(entity.tags, graphOrGeometry) : _mainPresetIndex.match(entity, graphOrGeometry);
28067 var presetName = preset && (preset.suggestion ? preset.subtitle() : preset.name());
28069 result = [presetName, displayName].filter(Boolean).join(" ");
28071 result = displayName || presetName;
28073 return result || utilDisplayType(entity.id);
28075 function utilEntityRoot(entityType) {
28082 function utilCombinedTags(entityIDs, graph) {
28084 var tagCounts = {};
28085 var allKeys = /* @__PURE__ */ new Set();
28086 var entities = entityIDs.map(function(entityID) {
28087 return graph.hasEntity(entityID);
28088 }).filter(Boolean);
28089 entities.forEach(function(entity) {
28090 var keys2 = Object.keys(entity.tags).filter(Boolean);
28091 keys2.forEach(function(key2) {
28095 entities.forEach(function(entity) {
28096 allKeys.forEach(function(key2) {
28097 var value = entity.tags[key2];
28098 if (!tags.hasOwnProperty(key2)) {
28099 tags[key2] = value;
28101 if (!Array.isArray(tags[key2])) {
28102 if (tags[key2] !== value) {
28103 tags[key2] = [tags[key2], value];
28106 if (tags[key2].indexOf(value) === -1) {
28107 tags[key2].push(value);
28111 var tagHash = key2 + "=" + value;
28112 if (!tagCounts[tagHash])
28113 tagCounts[tagHash] = 0;
28114 tagCounts[tagHash] += 1;
28117 for (var key in tags) {
28118 if (!Array.isArray(tags[key]))
28120 tags[key] = tags[key].sort(function(val12, val2) {
28122 var count2 = tagCounts[key2 + "=" + val2];
28123 var count1 = tagCounts[key2 + "=" + val12];
28124 if (count2 !== count1) {
28125 return count2 - count1;
28127 if (val2 && val12) {
28128 return val12.localeCompare(val2);
28130 return val12 ? 1 : -1;
28135 function utilStringQs(str2) {
28137 while (i3 < str2.length && (str2[i3] === "?" || str2[i3] === "#"))
28139 str2 = str2.slice(i3);
28140 return str2.split("&").reduce(function(obj, pair3) {
28141 var parts = pair3.split("=");
28142 if (parts.length === 2) {
28143 obj[parts[0]] = null === parts[1] ? "" : decodeURIComponent(parts[1]);
28148 function utilQsString(obj, noencode) {
28149 function softEncode(s2) {
28150 return encodeURIComponent(s2).replace(/(%2F|%3A|%2C|%7B|%7D)/g, decodeURIComponent);
28152 return Object.keys(obj).sort().map(function(key) {
28153 return encodeURIComponent(key) + "=" + (noencode ? softEncode(obj[key]) : encodeURIComponent(obj[key]));
28156 function utilPrefixDOMProperty(property) {
28157 var prefixes2 = ["webkit", "ms", "moz", "o"];
28159 var n3 = prefixes2.length;
28160 var s2 = document.body;
28161 if (property in s2)
28163 property = property.slice(0, 1).toUpperCase() + property.slice(1);
28164 while (++i3 < n3) {
28165 if (prefixes2[i3] + property in s2) {
28166 return prefixes2[i3] + property;
28171 function utilPrefixCSSProperty(property) {
28172 var prefixes2 = ["webkit", "ms", "Moz", "O"];
28174 var n3 = prefixes2.length;
28175 var s2 = document.body.style;
28176 if (property.toLowerCase() in s2) {
28177 return property.toLowerCase();
28179 while (++i3 < n3) {
28180 if (prefixes2[i3] + property in s2) {
28181 return "-" + prefixes2[i3].toLowerCase() + property.replace(/([A-Z])/g, "-$1").toLowerCase();
28186 var transformProperty;
28187 function utilSetTransform(el, x2, y2, scale) {
28188 var prop = transformProperty = transformProperty || utilPrefixCSSProperty("Transform");
28189 var translate = utilDetect().opera ? "translate(" + x2 + "px," + y2 + "px)" : "translate3d(" + x2 + "px," + y2 + "px,0)";
28190 return el.style(prop, translate + (scale ? " scale(" + scale + ")" : ""));
28192 function utilEditDistance(a2, b2) {
28193 a2 = (0, import_diacritics.remove)(a2.toLowerCase());
28194 b2 = (0, import_diacritics.remove)(b2.toLowerCase());
28195 if (a2.length === 0)
28197 if (b2.length === 0)
28201 for (i3 = 0; i3 <= b2.length; i3++) {
28204 for (j3 = 0; j3 <= a2.length; j3++) {
28205 matrix[0][j3] = j3;
28207 for (i3 = 1; i3 <= b2.length; i3++) {
28208 for (j3 = 1; j3 <= a2.length; j3++) {
28209 if (b2.charAt(i3 - 1) === a2.charAt(j3 - 1)) {
28210 matrix[i3][j3] = matrix[i3 - 1][j3 - 1];
28212 matrix[i3][j3] = Math.min(
28213 matrix[i3 - 1][j3 - 1] + 1,
28216 matrix[i3][j3 - 1] + 1,
28218 matrix[i3 - 1][j3] + 1
28224 return matrix[b2.length][a2.length];
28226 function utilFastMouse(container) {
28227 var rect = container.getBoundingClientRect();
28228 var rectLeft = rect.left;
28229 var rectTop = rect.top;
28230 var clientLeft = +container.clientLeft;
28231 var clientTop = +container.clientTop;
28232 return function(e3) {
28234 e3.clientX - rectLeft - clientLeft,
28235 e3.clientY - rectTop - clientTop
28239 function utilAsyncMap(inputs, func, callback) {
28240 var remaining = inputs.length;
28243 inputs.forEach(function(d2, i3) {
28244 func(d2, function done(err, data) {
28246 results[i3] = data;
28249 callback(errors, results);
28253 function utilWrap(index, length) {
28255 index += Math.ceil(-index / length) * length;
28257 return index % length;
28259 function utilFunctor(value) {
28260 if (typeof value === "function")
28262 return function() {
28266 function utilNoAuto(selection2) {
28267 var isText = selection2.size() && selection2.node().tagName.toLowerCase() === "textarea";
28268 return selection2.attr("autocomplete", "new-password").attr("autocorrect", "off").attr("autocapitalize", "off").attr("spellcheck", isText ? "true" : "false");
28270 function utilHashcode(str2) {
28272 if (str2.length === 0) {
28275 for (var i3 = 0; i3 < str2.length; i3++) {
28276 var char = str2.charCodeAt(i3);
28277 hash = (hash << 5) - hash + char;
28278 hash = hash & hash;
28282 function utilSafeClassName(str2) {
28283 return str2.toLowerCase().replace(/[^a-z0-9]+/g, "_");
28285 function utilUniqueDomId(val) {
28286 return "ideditor-" + utilSafeClassName(val.toString()) + "-" + (/* @__PURE__ */ new Date()).getTime().toString();
28288 function utilUnicodeCharsCount(str2) {
28289 return Array.from(str2).length;
28291 function utilUnicodeCharsTruncated(str2, limit) {
28292 return Array.from(str2).slice(0, limit).join("");
28294 function toNumericID(id2) {
28295 var match = id2.match(/^[cnwr](-?\d+)$/);
28297 return parseInt(match[1], 10);
28301 function compareNumericIDs(left, right) {
28302 if (isNaN(left) && isNaN(right))
28308 if (Math.sign(left) !== Math.sign(right))
28309 return -Math.sign(left);
28310 if (Math.sign(left) < 0)
28311 return Math.sign(right - left);
28312 return Math.sign(left - right);
28314 function utilCompareIDs(left, right) {
28315 return compareNumericIDs(toNumericID(left), toNumericID(right));
28317 function utilOldestID(ids) {
28318 if (ids.length === 0) {
28321 var oldestIDIndex = 0;
28322 var oldestID = toNumericID(ids[0]);
28323 for (var i3 = 1; i3 < ids.length; i3++) {
28324 var num = toNumericID(ids[i3]);
28325 if (compareNumericIDs(oldestID, num) === 1) {
28326 oldestIDIndex = i3;
28330 return ids[oldestIDIndex];
28332 function utilCleanOsmString(val, maxChars) {
28333 if (val === void 0 || val === null) {
28336 val = val.toString();
28340 val = val.normalize("NFC");
28341 return utilUnicodeCharsTruncated(val, maxChars);
28344 // modules/osm/entity.js
28345 function osmEntity(attrs) {
28346 if (this instanceof osmEntity)
28348 if (attrs && attrs.type) {
28349 return osmEntity[attrs.type].apply(this, arguments);
28350 } else if (attrs && attrs.id) {
28351 return osmEntity[osmEntity.id.type(attrs.id)].apply(this, arguments);
28353 return new osmEntity().initialize(arguments);
28355 osmEntity.id = function(type2) {
28356 return osmEntity.id.fromOSM(type2, osmEntity.id.next[type2]--);
28358 osmEntity.id.next = {
28364 osmEntity.id.fromOSM = function(type2, id2) {
28365 return type2[0] + id2;
28367 osmEntity.id.toOSM = function(id2) {
28368 var match = id2.match(/^[cnwr](-?\d+)$/);
28374 osmEntity.id.type = function(id2) {
28375 return { "c": "changeset", "n": "node", "w": "way", "r": "relation" }[id2[0]];
28377 osmEntity.key = function(entity) {
28378 return entity.id + "v" + (entity.v || 0);
28380 var _deprecatedTagValuesByKey;
28381 osmEntity.deprecatedTagValuesByKey = function(dataDeprecated) {
28382 if (!_deprecatedTagValuesByKey) {
28383 _deprecatedTagValuesByKey = {};
28384 dataDeprecated.forEach(function(d2) {
28385 var oldKeys = Object.keys(d2.old);
28386 if (oldKeys.length === 1) {
28387 var oldKey = oldKeys[0];
28388 var oldValue = d2.old[oldKey];
28389 if (oldValue !== "*") {
28390 if (!_deprecatedTagValuesByKey[oldKey]) {
28391 _deprecatedTagValuesByKey[oldKey] = [oldValue];
28393 _deprecatedTagValuesByKey[oldKey].push(oldValue);
28399 return _deprecatedTagValuesByKey;
28401 osmEntity.prototype = {
28403 initialize: function(sources) {
28404 for (var i3 = 0; i3 < sources.length; ++i3) {
28405 var source = sources[i3];
28406 for (var prop in source) {
28407 if (Object.prototype.hasOwnProperty.call(source, prop)) {
28408 if (source[prop] === void 0) {
28411 this[prop] = source[prop];
28416 if (!this.id && this.type) {
28417 this.id = osmEntity.id(this.type);
28419 if (!this.hasOwnProperty("visible")) {
28420 this.visible = true;
28423 Object.freeze(this);
28424 Object.freeze(this.tags);
28426 Object.freeze(this.loc);
28428 Object.freeze(this.nodes);
28430 Object.freeze(this.members);
28434 copy: function(resolver, copies) {
28435 if (copies[this.id])
28436 return copies[this.id];
28437 var copy2 = osmEntity(this, { id: void 0, user: void 0, version: void 0 });
28438 copies[this.id] = copy2;
28441 osmId: function() {
28442 return osmEntity.id.toOSM(this.id);
28444 isNew: function() {
28445 var osmId = osmEntity.id.toOSM(this.id);
28446 return osmId.length === 0 || osmId[0] === "-";
28448 update: function(attrs) {
28449 return osmEntity(this, attrs, { v: 1 + (this.v || 0) });
28451 mergeTags: function(tags) {
28452 var merged = Object.assign({}, this.tags);
28453 var changed = false;
28454 for (var k2 in tags) {
28455 var t1 = merged[k2];
28460 } else if (t1 !== t2) {
28462 merged[k2] = utilUnicodeCharsTruncated(
28463 utilArrayUnion(t1.split(/;\s*/), t2.split(/;\s*/)).join(";"),
28465 // avoid exceeding character limit; see also context.maxCharsForTagValue()
28469 return changed ? this.update({ tags: merged }) : this;
28471 intersects: function(extent, resolver) {
28472 return this.extent(resolver).intersects(extent);
28474 hasNonGeometryTags: function() {
28475 return Object.keys(this.tags).some(function(k2) {
28476 return k2 !== "area";
28479 hasParentRelations: function(resolver) {
28480 return resolver.parentRelations(this).length > 0;
28482 hasInterestingTags: function() {
28483 return Object.keys(this.tags).some(osmIsInterestingTag);
28485 isHighwayIntersection: function() {
28488 isDegenerate: function() {
28491 deprecatedTags: function(dataDeprecated) {
28492 var tags = this.tags;
28493 if (Object.keys(tags).length === 0)
28495 var deprecated = [];
28496 dataDeprecated.forEach(function(d2) {
28497 var oldKeys = Object.keys(d2.old);
28499 var hasExistingValues = Object.keys(d2.replace).some(function(replaceKey) {
28500 if (!tags[replaceKey] || d2.old[replaceKey])
28502 var replaceValue = d2.replace[replaceKey];
28503 if (replaceValue === "*")
28505 if (replaceValue === tags[replaceKey])
28509 if (hasExistingValues)
28512 var matchesDeprecatedTags = oldKeys.every(function(oldKey) {
28515 if (d2.old[oldKey] === "*")
28517 if (d2.old[oldKey] === tags[oldKey])
28519 var vals = tags[oldKey].split(";").filter(Boolean);
28520 if (vals.length === 0) {
28522 } else if (vals.length > 1) {
28523 return vals.indexOf(d2.old[oldKey]) !== -1;
28525 if (tags[oldKey] === d2.old[oldKey]) {
28526 if (d2.replace && d2.old[oldKey] === d2.replace[oldKey]) {
28527 var replaceKeys = Object.keys(d2.replace);
28528 return !replaceKeys.every(function(replaceKey) {
28529 return tags[replaceKey] === d2.replace[replaceKey];
28538 if (matchesDeprecatedTags) {
28539 deprecated.push(d2);
28546 // modules/osm/lanes.js
28547 function osmLanes(entity) {
28548 if (entity.type !== "way")
28550 if (!entity.tags.highway)
28552 var tags = entity.tags;
28553 var isOneWay = entity.isOneWay();
28554 var laneCount = getLaneCount(tags, isOneWay);
28555 var maxspeed = parseMaxspeed(tags);
28556 var laneDirections = parseLaneDirections(tags, isOneWay, laneCount);
28557 var forward = laneDirections.forward;
28558 var backward = laneDirections.backward;
28559 var bothways = laneDirections.bothways;
28560 var turnLanes = {};
28561 turnLanes.unspecified = parseTurnLanes(tags["turn:lanes"]);
28562 turnLanes.forward = parseTurnLanes(tags["turn:lanes:forward"]);
28563 turnLanes.backward = parseTurnLanes(tags["turn:lanes:backward"]);
28564 var maxspeedLanes = {};
28565 maxspeedLanes.unspecified = parseMaxspeedLanes(tags["maxspeed:lanes"], maxspeed);
28566 maxspeedLanes.forward = parseMaxspeedLanes(tags["maxspeed:lanes:forward"], maxspeed);
28567 maxspeedLanes.backward = parseMaxspeedLanes(tags["maxspeed:lanes:backward"], maxspeed);
28569 psvLanes.unspecified = parseMiscLanes(tags["psv:lanes"]);
28570 psvLanes.forward = parseMiscLanes(tags["psv:lanes:forward"]);
28571 psvLanes.backward = parseMiscLanes(tags["psv:lanes:backward"]);
28573 busLanes.unspecified = parseMiscLanes(tags["bus:lanes"]);
28574 busLanes.forward = parseMiscLanes(tags["bus:lanes:forward"]);
28575 busLanes.backward = parseMiscLanes(tags["bus:lanes:backward"]);
28576 var taxiLanes = {};
28577 taxiLanes.unspecified = parseMiscLanes(tags["taxi:lanes"]);
28578 taxiLanes.forward = parseMiscLanes(tags["taxi:lanes:forward"]);
28579 taxiLanes.backward = parseMiscLanes(tags["taxi:lanes:backward"]);
28581 hovLanes.unspecified = parseMiscLanes(tags["hov:lanes"]);
28582 hovLanes.forward = parseMiscLanes(tags["hov:lanes:forward"]);
28583 hovLanes.backward = parseMiscLanes(tags["hov:lanes:backward"]);
28585 hgvLanes.unspecified = parseMiscLanes(tags["hgv:lanes"]);
28586 hgvLanes.forward = parseMiscLanes(tags["hgv:lanes:forward"]);
28587 hgvLanes.backward = parseMiscLanes(tags["hgv:lanes:backward"]);
28588 var bicyclewayLanes = {};
28589 bicyclewayLanes.unspecified = parseBicycleWay(tags["bicycleway:lanes"]);
28590 bicyclewayLanes.forward = parseBicycleWay(tags["bicycleway:lanes:forward"]);
28591 bicyclewayLanes.backward = parseBicycleWay(tags["bicycleway:lanes:backward"]);
28597 mapToLanesObj(lanesObj, turnLanes, "turnLane");
28598 mapToLanesObj(lanesObj, maxspeedLanes, "maxspeed");
28599 mapToLanesObj(lanesObj, psvLanes, "psv");
28600 mapToLanesObj(lanesObj, busLanes, "bus");
28601 mapToLanesObj(lanesObj, taxiLanes, "taxi");
28602 mapToLanesObj(lanesObj, hovLanes, "hov");
28603 mapToLanesObj(lanesObj, hgvLanes, "hgv");
28604 mapToLanesObj(lanesObj, bicyclewayLanes, "bicycleway");
28625 function getLaneCount(tags, isOneWay) {
28628 count = parseInt(tags.lanes, 10);
28633 switch (tags.highway) {
28636 count = isOneWay ? 2 : 4;
28639 count = isOneWay ? 1 : 2;
28644 function parseMaxspeed(tags) {
28645 var maxspeed = tags.maxspeed;
28648 var maxspeedRegex = /^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;
28649 if (!maxspeedRegex.test(maxspeed))
28651 return parseInt(maxspeed, 10);
28653 function parseLaneDirections(tags, isOneWay, laneCount) {
28654 var forward = parseInt(tags["lanes:forward"], 10);
28655 var backward = parseInt(tags["lanes:backward"], 10);
28656 var bothways = parseInt(tags["lanes:both_ways"], 10) > 0 ? 1 : 0;
28657 if (parseInt(tags.oneway, 10) === -1) {
28660 backward = laneCount;
28661 } else if (isOneWay) {
28662 forward = laneCount;
28665 } else if (isNaN(forward) && isNaN(backward)) {
28666 backward = Math.floor((laneCount - bothways) / 2);
28667 forward = laneCount - bothways - backward;
28668 } else if (isNaN(forward)) {
28669 if (backward > laneCount - bothways) {
28670 backward = laneCount - bothways;
28672 forward = laneCount - bothways - backward;
28673 } else if (isNaN(backward)) {
28674 if (forward > laneCount - bothways) {
28675 forward = laneCount - bothways;
28677 backward = laneCount - bothways - forward;
28685 function parseTurnLanes(tag) {
28688 var validValues = [
28701 return tag.split("|").map(function(s2) {
28704 return s2.split(";").map(function(d2) {
28705 return validValues.indexOf(d2) === -1 ? "unknown" : d2;
28709 function parseMaxspeedLanes(tag, maxspeed) {
28712 return tag.split("|").map(function(s2) {
28715 var m2 = parseInt(s2, 10);
28716 if (s2 === "" || m2 === maxspeed)
28718 return isNaN(m2) ? "unknown" : m2;
28721 function parseMiscLanes(tag) {
28724 var validValues = [
28729 return tag.split("|").map(function(s2) {
28732 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
28735 function parseBicycleWay(tag) {
28738 var validValues = [
28744 return tag.split("|").map(function(s2) {
28747 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
28750 function mapToLanesObj(lanesObj, data, key) {
28751 if (data.forward) {
28752 data.forward.forEach(function(l2, i3) {
28753 if (!lanesObj.forward[i3])
28754 lanesObj.forward[i3] = {};
28755 lanesObj.forward[i3][key] = l2;
28758 if (data.backward) {
28759 data.backward.forEach(function(l2, i3) {
28760 if (!lanesObj.backward[i3])
28761 lanesObj.backward[i3] = {};
28762 lanesObj.backward[i3][key] = l2;
28765 if (data.unspecified) {
28766 data.unspecified.forEach(function(l2, i3) {
28767 if (!lanesObj.unspecified[i3])
28768 lanesObj.unspecified[i3] = {};
28769 lanesObj.unspecified[i3][key] = l2;
28774 // modules/osm/way.js
28775 function osmWay() {
28776 if (!(this instanceof osmWay)) {
28777 return new osmWay().initialize(arguments);
28778 } else if (arguments.length) {
28779 this.initialize(arguments);
28782 osmEntity.way = osmWay;
28783 osmWay.prototype = Object.create(osmEntity.prototype);
28784 Object.assign(osmWay.prototype, {
28787 copy: function(resolver, copies) {
28788 if (copies[this.id])
28789 return copies[this.id];
28790 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
28791 var nodes = this.nodes.map(function(id2) {
28792 return resolver.entity(id2).copy(resolver, copies).id;
28794 copy2 = copy2.update({ nodes });
28795 copies[this.id] = copy2;
28798 extent: function(resolver) {
28799 return resolver.transient(this, "extent", function() {
28800 var extent = geoExtent();
28801 for (var i3 = 0; i3 < this.nodes.length; i3++) {
28802 var node = resolver.hasEntity(this.nodes[i3]);
28804 extent._extend(node.extent());
28810 first: function() {
28811 return this.nodes[0];
28814 return this.nodes[this.nodes.length - 1];
28816 contains: function(node) {
28817 return this.nodes.indexOf(node) >= 0;
28819 affix: function(node) {
28820 if (this.nodes[0] === node)
28822 if (this.nodes[this.nodes.length - 1] === node)
28825 layer: function() {
28826 if (isFinite(this.tags.layer)) {
28827 return Math.max(-10, Math.min(+this.tags.layer, 10));
28829 if (this.tags.covered === "yes")
28831 if (this.tags.location === "overground")
28833 if (this.tags.location === "underground")
28835 if (this.tags.location === "underwater")
28837 if (this.tags.power === "line")
28839 if (this.tags.power === "minor_line")
28841 if (this.tags.aerialway)
28843 if (this.tags.bridge)
28845 if (this.tags.cutting)
28847 if (this.tags.tunnel)
28849 if (this.tags.waterway)
28851 if (this.tags.man_made === "pipeline")
28853 if (this.tags.boundary)
28857 // the approximate width of the line based on its tags except its `width` tag
28858 impliedLineWidthMeters: function() {
28859 var averageWidths = {
28861 // width is for single lane
28888 // width includes ties and rail bed, not just track gauge
28910 for (var key in averageWidths) {
28911 if (this.tags[key] && averageWidths[key][this.tags[key]]) {
28912 var width = averageWidths[key][this.tags[key]];
28913 if (key === "highway") {
28914 var laneCount = this.tags.lanes && parseInt(this.tags.lanes, 10);
28916 laneCount = this.isOneWay() ? 1 : 2;
28917 return width * laneCount;
28924 isOneWay: function() {
28929 "reversible": true,
28930 "alternating": true,
28934 if (values[this.tags.oneway] !== void 0) {
28935 return values[this.tags.oneway];
28937 for (var key in this.tags) {
28938 if (key in osmOneWayTags && this.tags[key] in osmOneWayTags[key]) {
28944 // Some identifier for tag that implies that this way is "sided",
28945 // i.e. the right side is the 'inside' (e.g. the right side of a
28946 // natural=cliff is lower).
28947 sidednessIdentifier: function() {
28948 for (const realKey in this.tags) {
28949 const value = this.tags[realKey];
28950 const key = osmRemoveLifecyclePrefix(realKey);
28951 if (key in osmRightSideIsInsideTags && value in osmRightSideIsInsideTags[key]) {
28952 if (osmRightSideIsInsideTags[key][value] === true) {
28955 return osmRightSideIsInsideTags[key][value];
28961 isSided: function() {
28962 if (this.tags.two_sided === "yes") {
28965 return this.sidednessIdentifier() !== null;
28967 lanes: function() {
28968 return osmLanes(this);
28970 isClosed: function() {
28971 return this.nodes.length > 1 && this.first() === this.last();
28973 isConvex: function(resolver) {
28974 if (!this.isClosed() || this.isDegenerate())
28976 var nodes = utilArrayUniq(resolver.childNodes(this));
28977 var coords = nodes.map(function(n3) {
28982 for (var i3 = 0; i3 < coords.length; i3++) {
28983 var o2 = coords[(i3 + 1) % coords.length];
28984 var a2 = coords[i3];
28985 var b2 = coords[(i3 + 2) % coords.length];
28986 var res = geoVecCross(a2, b2, o2);
28987 curr = res > 0 ? 1 : res < 0 ? -1 : 0;
28990 } else if (prev && curr !== prev) {
28997 // returns an object with the tag that implies this is an area, if any
28998 tagSuggestingArea: function() {
28999 return osmTagSuggestingArea(this.tags);
29001 isArea: function() {
29002 if (this.tags.area === "yes")
29004 if (!this.isClosed() || this.tags.area === "no")
29006 return this.tagSuggestingArea() !== null;
29008 isDegenerate: function() {
29009 return new Set(this.nodes).size < (this.isArea() ? 3 : 2);
29011 areAdjacent: function(n1, n22) {
29012 for (var i3 = 0; i3 < this.nodes.length; i3++) {
29013 if (this.nodes[i3] === n1) {
29014 if (this.nodes[i3 - 1] === n22)
29016 if (this.nodes[i3 + 1] === n22)
29022 geometry: function(graph) {
29023 return graph.transient(this, "geometry", function() {
29024 return this.isArea() ? "area" : "line";
29027 // returns an array of objects representing the segments between the nodes in this way
29028 segments: function(graph) {
29029 function segmentExtent(graph2) {
29030 var n1 = graph2.hasEntity(this.nodes[0]);
29031 var n22 = graph2.hasEntity(this.nodes[1]);
29032 return n1 && n22 && geoExtent([
29034 Math.min(n1.loc[0], n22.loc[0]),
29035 Math.min(n1.loc[1], n22.loc[1])
29038 Math.max(n1.loc[0], n22.loc[0]),
29039 Math.max(n1.loc[1], n22.loc[1])
29043 return graph.transient(this, "segments", function() {
29045 for (var i3 = 0; i3 < this.nodes.length - 1; i3++) {
29047 id: this.id + "-" + i3,
29050 nodes: [this.nodes[i3], this.nodes[i3 + 1]],
29051 extent: segmentExtent
29057 // If this way is not closed, append the beginning node to the end of the nodelist to close it.
29058 close: function() {
29059 if (this.isClosed() || !this.nodes.length)
29061 var nodes = this.nodes.slice();
29062 nodes = nodes.filter(noRepeatNodes);
29063 nodes.push(nodes[0]);
29064 return this.update({ nodes });
29066 // If this way is closed, remove any connector nodes from the end of the nodelist to unclose it.
29067 unclose: function() {
29068 if (!this.isClosed())
29070 var nodes = this.nodes.slice();
29071 var connector = this.first();
29072 var i3 = nodes.length - 1;
29073 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29074 nodes.splice(i3, 1);
29075 i3 = nodes.length - 1;
29077 nodes = nodes.filter(noRepeatNodes);
29078 return this.update({ nodes });
29080 // Adds a node (id) in front of the node which is currently at position index.
29081 // If index is undefined, the node will be added to the end of the way for linear ways,
29082 // or just before the final connecting node for circular ways.
29083 // Consecutive duplicates are eliminated including existing ones.
29084 // Circularity is always preserved when adding a node.
29085 addNode: function(id2, index) {
29086 var nodes = this.nodes.slice();
29087 var isClosed = this.isClosed();
29088 var max3 = isClosed ? nodes.length - 1 : nodes.length;
29089 if (index === void 0) {
29092 if (index < 0 || index > max3) {
29093 throw new RangeError("index " + index + " out of range 0.." + max3);
29096 var connector = this.first();
29098 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
29099 nodes.splice(i3, 1);
29103 i3 = nodes.length - 1;
29104 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29105 nodes.splice(i3, 1);
29108 i3 = nodes.length - 1;
29111 nodes.splice(index, 0, id2);
29112 nodes = nodes.filter(noRepeatNodes);
29113 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29114 nodes.push(nodes[0]);
29116 return this.update({ nodes });
29118 // Replaces the node which is currently at position index with the given node (id).
29119 // Consecutive duplicates are eliminated including existing ones.
29120 // Circularity is preserved when updating a node.
29121 updateNode: function(id2, index) {
29122 var nodes = this.nodes.slice();
29123 var isClosed = this.isClosed();
29124 var max3 = nodes.length - 1;
29125 if (index === void 0 || index < 0 || index > max3) {
29126 throw new RangeError("index " + index + " out of range 0.." + max3);
29129 var connector = this.first();
29131 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
29132 nodes.splice(i3, 1);
29136 i3 = nodes.length - 1;
29137 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29138 nodes.splice(i3, 1);
29141 i3 = nodes.length - 1;
29144 nodes.splice(index, 1, id2);
29145 nodes = nodes.filter(noRepeatNodes);
29146 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29147 nodes.push(nodes[0]);
29149 return this.update({ nodes });
29151 // Replaces each occurrence of node id needle with replacement.
29152 // Consecutive duplicates are eliminated including existing ones.
29153 // Circularity is preserved.
29154 replaceNode: function(needleID, replacementID) {
29155 var nodes = this.nodes.slice();
29156 var isClosed = this.isClosed();
29157 for (var i3 = 0; i3 < nodes.length; i3++) {
29158 if (nodes[i3] === needleID) {
29159 nodes[i3] = replacementID;
29162 nodes = nodes.filter(noRepeatNodes);
29163 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29164 nodes.push(nodes[0]);
29166 return this.update({ nodes });
29168 // Removes each occurrence of node id.
29169 // Consecutive duplicates are eliminated including existing ones.
29170 // Circularity is preserved.
29171 removeNode: function(id2) {
29172 var nodes = this.nodes.slice();
29173 var isClosed = this.isClosed();
29174 nodes = nodes.filter(function(node) {
29175 return node !== id2;
29176 }).filter(noRepeatNodes);
29177 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29178 nodes.push(nodes[0]);
29180 return this.update({ nodes });
29182 asJXON: function(changeset_id) {
29185 "@id": this.osmId(),
29186 "@version": this.version || 0,
29187 nd: this.nodes.map(function(id2) {
29188 return { keyAttributes: { ref: osmEntity.id.toOSM(id2) } };
29190 tag: Object.keys(this.tags).map(function(k2) {
29191 return { keyAttributes: { k: k2, v: this.tags[k2] } };
29195 if (changeset_id) {
29196 r2.way["@changeset"] = changeset_id;
29200 asGeoJSON: function(resolver) {
29201 return resolver.transient(this, "GeoJSON", function() {
29202 var coordinates = resolver.childNodes(this).map(function(n3) {
29205 if (this.isArea() && this.isClosed()) {
29208 coordinates: [coordinates]
29212 type: "LineString",
29218 area: function(resolver) {
29219 return resolver.transient(this, "area", function() {
29220 var nodes = resolver.childNodes(this);
29223 coordinates: [nodes.map(function(n3) {
29227 if (!this.isClosed() && nodes.length) {
29228 json.coordinates[0].push(nodes[0].loc);
29230 var area = area_default(json);
29231 if (area > 2 * Math.PI) {
29232 json.coordinates[0] = json.coordinates[0].reverse();
29233 area = area_default(json);
29235 return isNaN(area) ? 0 : area;
29239 function noRepeatNodes(node, i3, arr) {
29240 return i3 === 0 || node !== arr[i3 - 1];
29243 // modules/osm/multipolygon.js
29244 function osmOldMultipolygonOuterMemberOfRelation(entity, graph) {
29245 if (entity.type !== "relation" || !entity.isMultipolygon() || Object.keys(entity.tags).filter(osmIsInterestingTag).length > 1) {
29249 for (var memberIndex in entity.members) {
29250 var member = entity.members[memberIndex];
29251 if (!member.role || member.role === "outer") {
29254 if (member.type !== "way")
29256 if (!graph.hasEntity(member.id))
29258 outerMember = graph.entity(member.id);
29259 if (Object.keys(outerMember.tags).filter(osmIsInterestingTag).length === 0) {
29264 return outerMember;
29266 function osmIsOldMultipolygonOuterMember(entity, graph) {
29267 if (entity.type !== "way" || Object.keys(entity.tags).filter(osmIsInterestingTag).length === 0) {
29270 var parents = graph.parentRelations(entity);
29271 if (parents.length !== 1)
29273 var parent = parents[0];
29274 if (!parent.isMultipolygon() || Object.keys(parent.tags).filter(osmIsInterestingTag).length > 1) {
29277 var members = parent.members, member;
29278 for (var i3 = 0; i3 < members.length; i3++) {
29279 member = members[i3];
29280 if (member.id === entity.id && member.role && member.role !== "outer") {
29283 if (member.id !== entity.id && (!member.role || member.role === "outer")) {
29289 function osmOldMultipolygonOuterMember(entity, graph) {
29290 if (entity.type !== "way")
29292 var parents = graph.parentRelations(entity);
29293 if (parents.length !== 1)
29295 var parent = parents[0];
29296 if (!parent.isMultipolygon() || Object.keys(parent.tags).filter(osmIsInterestingTag).length > 1) {
29299 var members = parent.members, member, outerMember;
29300 for (var i3 = 0; i3 < members.length; i3++) {
29301 member = members[i3];
29302 if (!member.role || member.role === "outer") {
29305 outerMember = member;
29310 var outerEntity = graph.hasEntity(outerMember.id);
29311 if (!outerEntity || !Object.keys(outerEntity.tags).filter(osmIsInterestingTag).length) {
29314 return outerEntity;
29316 function osmJoinWays(toJoin, graph) {
29317 function resolve(member) {
29318 return graph.childNodes(graph.entity(member.id));
29320 function reverse(item2) {
29321 var action = actionReverse(item2.id, { reverseOneway: true });
29322 sequences.actions.push(action);
29323 return item2 instanceof osmWay ? action(graph).entity(item2.id) : item2;
29325 toJoin = toJoin.filter(function(member) {
29326 return member.type === "way" && graph.hasEntity(member.id);
29329 var joinAsMembers = true;
29330 for (i3 = 0; i3 < toJoin.length; i3++) {
29331 if (toJoin[i3] instanceof osmWay) {
29332 joinAsMembers = false;
29336 var sequences = [];
29337 sequences.actions = [];
29338 while (toJoin.length) {
29339 var item = toJoin.shift();
29340 var currWays = [item];
29341 var currNodes = resolve(item).slice();
29342 while (toJoin.length) {
29343 var start2 = currNodes[0];
29344 var end = currNodes[currNodes.length - 1];
29347 for (i3 = 0; i3 < toJoin.length; i3++) {
29349 nodes = resolve(item);
29350 if (joinAsMembers && currWays.length === 1 && nodes[0] !== end && nodes[nodes.length - 1] !== end && (nodes[nodes.length - 1] === start2 || nodes[0] === start2)) {
29351 currWays[0] = reverse(currWays[0]);
29352 currNodes.reverse();
29353 start2 = currNodes[0];
29354 end = currNodes[currNodes.length - 1];
29356 if (nodes[0] === end) {
29357 fn = currNodes.push;
29358 nodes = nodes.slice(1);
29360 } else if (nodes[nodes.length - 1] === end) {
29361 fn = currNodes.push;
29362 nodes = nodes.slice(0, -1).reverse();
29363 item = reverse(item);
29365 } else if (nodes[nodes.length - 1] === start2) {
29366 fn = currNodes.unshift;
29367 nodes = nodes.slice(0, -1);
29369 } else if (nodes[0] === start2) {
29370 fn = currNodes.unshift;
29371 nodes = nodes.slice(1).reverse();
29372 item = reverse(item);
29381 fn.apply(currWays, [item]);
29382 fn.apply(currNodes, nodes);
29383 toJoin.splice(i3, 1);
29385 currWays.nodes = currNodes;
29386 sequences.push(currWays);
29391 // modules/actions/add_member.js
29392 function actionAddMember(relationId, member, memberIndex, insertPair) {
29393 return function action(graph) {
29394 var relation = graph.entity(relationId);
29395 var isPTv2 = /stop|platform/.test(member.role);
29396 if ((isNaN(memberIndex) || insertPair) && member.type === "way" && !isPTv2) {
29397 graph = addWayMember(relation, graph);
29399 if (isPTv2 && isNaN(memberIndex)) {
29402 graph = graph.replace(relation.addMember(member, memberIndex));
29406 function addWayMember(relation, graph) {
29407 var groups, tempWay, insertPairIsReversed, item, i3, j3, k2;
29408 var PTv2members = [];
29410 for (i3 = 0; i3 < relation.members.length; i3++) {
29411 var m2 = relation.members[i3];
29412 if (/stop|platform/.test(m2.role)) {
29413 PTv2members.push(m2);
29418 relation = relation.update({ members });
29420 tempWay = osmWay({ id: "wTemp", nodes: insertPair.nodes });
29421 graph = graph.replace(tempWay);
29422 var tempMember = { id: tempWay.id, type: "way", role: member.role };
29423 var tempRelation = relation.replaceMember({ id: insertPair.originalID }, tempMember, true);
29424 groups = utilArrayGroupBy(tempRelation.members, "type");
29425 groups.way = groups.way || [];
29426 var originalWay = graph.entity(insertPair.originalID);
29427 var insertedWay = graph.entity(insertPair.insertedID);
29428 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];
29430 groups = utilArrayGroupBy(relation.members, "type");
29431 groups.way = groups.way || [];
29432 groups.way.push(member);
29434 members = withIndex(groups.way);
29435 var joined = osmJoinWays(members, graph);
29436 for (i3 = 0; i3 < joined.length; i3++) {
29437 var segment = joined[i3];
29438 var nodes = segment.nodes.slice();
29439 var startIndex = segment[0].index;
29440 for (j3 = 0; j3 < members.length; j3++) {
29441 if (members[j3].index === startIndex) {
29445 for (k2 = 0; k2 < segment.length; k2++) {
29446 item = segment[k2];
29447 var way = graph.entity(item.id);
29448 if (tempWay && item.id === tempWay.id) {
29449 var reverse = nodes[0].id !== insertPair.nodes[0] ^ insertPairIsReversed;
29452 { id: insertPair.insertedID, type: "way", role: item.role },
29453 { id: insertPair.originalID, type: "way", role: item.role }
29457 { id: insertPair.originalID, type: "way", role: item.role },
29458 { id: insertPair.insertedID, type: "way", role: item.role }
29463 if (j3 + k2 >= members.length || item.index !== members[j3 + k2].index) {
29464 moveMember(members, item.index, j3 + k2);
29467 nodes.splice(0, way.nodes.length - 1);
29471 graph = graph.remove(tempWay);
29473 var wayMembers = [];
29474 for (i3 = 0; i3 < members.length; i3++) {
29475 item = members[i3];
29476 if (item.index === -1)
29479 wayMembers.push(item.pair[0]);
29480 wayMembers.push(item.pair[1]);
29482 wayMembers.push(utilObjectOmit(item, ["index"]));
29485 var newMembers = PTv2members.concat(groups.node || [], wayMembers, groups.relation || []);
29486 return graph.replace(relation.update({ members: newMembers }));
29487 function moveMember(arr, findIndex, toIndex) {
29489 for (i4 = 0; i4 < arr.length; i4++) {
29490 if (arr[i4].index === findIndex) {
29494 var item2 = Object.assign({}, arr[i4]);
29495 arr[i4].index = -1;
29496 item2.index = toIndex;
29497 arr.splice(toIndex, 0, item2);
29499 function withIndex(arr) {
29500 var result = new Array(arr.length);
29501 for (var i4 = 0; i4 < arr.length; i4++) {
29502 result[i4] = Object.assign({}, arr[i4]);
29503 result[i4].index = i4;
29510 // modules/actions/add_midpoint.js
29511 function actionAddMidpoint(midpoint, node) {
29512 return function(graph) {
29513 graph = graph.replace(node.move(midpoint.loc));
29514 var parents = utilArrayIntersection(
29515 graph.parentWays(graph.entity(midpoint.edge[0])),
29516 graph.parentWays(graph.entity(midpoint.edge[1]))
29518 parents.forEach(function(way) {
29519 for (var i3 = 0; i3 < way.nodes.length - 1; i3++) {
29520 if (geoEdgeEqual([way.nodes[i3], way.nodes[i3 + 1]], midpoint.edge)) {
29521 graph = graph.replace(graph.entity(way.id).addNode(node.id, i3 + 1));
29530 // modules/actions/add_vertex.js
29531 function actionAddVertex(wayId, nodeId, index) {
29532 return function(graph) {
29533 return graph.replace(graph.entity(wayId).addNode(nodeId, index));
29537 // modules/actions/change_member.js
29538 function actionChangeMember(relationId, member, memberIndex) {
29539 return function(graph) {
29540 return graph.replace(graph.entity(relationId).updateMember(member, memberIndex));
29544 // modules/actions/change_preset.js
29545 function actionChangePreset(entityID, oldPreset, newPreset, skipFieldDefaults) {
29546 return function action(graph) {
29547 var entity = graph.entity(entityID);
29548 var geometry = entity.geometry(graph);
29549 var tags = entity.tags;
29550 const loc = entity.extent(graph).center();
29554 if (newPreset.addTags) {
29555 preserveKeys = preserveKeys.concat(Object.keys(newPreset.addTags));
29557 if (oldPreset && !oldPreset.id.startsWith(newPreset.id)) {
29558 newPreset.fields(loc).concat(newPreset.moreFields(loc)).filter((f3) => f3.matchGeometry(geometry)).map((f3) => f3.key).filter(Boolean).forEach((key) => preserveKeys.push(key));
29562 tags = oldPreset.unsetTags(tags, geometry, preserveKeys, false, loc);
29564 tags = newPreset.setTags(tags, geometry, skipFieldDefaults, loc);
29565 return graph.replace(entity.update({ tags }));
29569 // modules/actions/change_tags.js
29570 function actionChangeTags(entityId, tags) {
29571 return function(graph) {
29572 var entity = graph.entity(entityId);
29573 return graph.replace(entity.update({ tags }));
29577 // modules/osm/node.js
29581 northnortheast: 22,
29589 eastsoutheast: 112,
29593 southsoutheast: 157,
29597 southsouthwest: 202,
29601 westsouthwest: 247,
29605 westnorthwest: 292,
29609 northnorthwest: 337,
29612 function osmNode() {
29613 if (!(this instanceof osmNode)) {
29614 return new osmNode().initialize(arguments);
29615 } else if (arguments.length) {
29616 this.initialize(arguments);
29619 osmEntity.node = osmNode;
29620 osmNode.prototype = Object.create(osmEntity.prototype);
29621 Object.assign(osmNode.prototype, {
29624 extent: function() {
29625 return new geoExtent(this.loc);
29627 geometry: function(graph) {
29628 return graph.transient(this, "geometry", function() {
29629 return graph.isPoi(this) ? "point" : "vertex";
29632 move: function(loc) {
29633 return this.update({ loc });
29635 isDegenerate: function() {
29636 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);
29638 // Inspect tags and geometry to determine which direction(s) this node/vertex points
29639 directions: function(resolver, projection2) {
29642 if (this.isHighwayIntersection(resolver) && (this.tags.stop || "").toLowerCase() === "all") {
29645 val = (this.tags.direction || "").toLowerCase();
29646 var re3 = /:direction$/i;
29647 var keys2 = Object.keys(this.tags);
29648 for (i3 = 0; i3 < keys2.length; i3++) {
29649 if (re3.test(keys2[i3])) {
29650 val = this.tags[keys2[i3]].toLowerCase();
29657 var values = val.split(";");
29659 values.forEach(function(v2) {
29660 if (cardinal[v2] !== void 0) {
29663 if (v2 !== "" && !isNaN(+v2)) {
29667 var lookBackward = this.tags["traffic_sign:backward"] || v2 === "backward" || v2 === "both" || v2 === "all";
29668 var lookForward = this.tags["traffic_sign:forward"] || v2 === "forward" || v2 === "both" || v2 === "all";
29669 if (!lookForward && !lookBackward)
29672 resolver.parentWays(this).forEach(function(parent) {
29673 var nodes = parent.nodes;
29674 for (i3 = 0; i3 < nodes.length; i3++) {
29675 if (nodes[i3] === this.id) {
29676 if (lookForward && i3 > 0) {
29677 nodeIds[nodes[i3 - 1]] = true;
29679 if (lookBackward && i3 < nodes.length - 1) {
29680 nodeIds[nodes[i3 + 1]] = true;
29685 Object.keys(nodeIds).forEach(function(nodeId) {
29687 geoAngle(this, resolver.entity(nodeId), projection2) * (180 / Math.PI) + 90
29691 return utilArrayUniq(results);
29693 isCrossing: function() {
29694 return this.tags.highway === "crossing" || this.tags.railway && this.tags.railway.indexOf("crossing") !== -1;
29696 isEndpoint: function(resolver) {
29697 return resolver.transient(this, "isEndpoint", function() {
29699 return resolver.parentWays(this).filter(function(parent) {
29700 return !parent.isClosed() && !!parent.affix(id2);
29704 isConnected: function(resolver) {
29705 return resolver.transient(this, "isConnected", function() {
29706 var parents = resolver.parentWays(this);
29707 if (parents.length > 1) {
29708 for (var i3 in parents) {
29709 if (parents[i3].geometry(resolver) === "line" && parents[i3].hasInterestingTags())
29712 } else if (parents.length === 1) {
29713 var way = parents[0];
29714 var nodes = way.nodes.slice();
29715 if (way.isClosed()) {
29718 return nodes.indexOf(this.id) !== nodes.lastIndexOf(this.id);
29723 parentIntersectionWays: function(resolver) {
29724 return resolver.transient(this, "parentIntersectionWays", function() {
29725 return resolver.parentWays(this).filter(function(parent) {
29726 return (parent.tags.highway || parent.tags.waterway || parent.tags.railway || parent.tags.aeroway) && parent.geometry(resolver) === "line";
29730 isIntersection: function(resolver) {
29731 return this.parentIntersectionWays(resolver).length > 1;
29733 isHighwayIntersection: function(resolver) {
29734 return resolver.transient(this, "isHighwayIntersection", function() {
29735 return resolver.parentWays(this).filter(function(parent) {
29736 return parent.tags.highway && parent.geometry(resolver) === "line";
29740 isOnAddressLine: function(resolver) {
29741 return resolver.transient(this, "isOnAddressLine", function() {
29742 return resolver.parentWays(this).filter(function(parent) {
29743 return parent.tags.hasOwnProperty("addr:interpolation") && parent.geometry(resolver) === "line";
29747 asJXON: function(changeset_id) {
29750 "@id": this.osmId(),
29751 "@lon": this.loc[0],
29752 "@lat": this.loc[1],
29753 "@version": this.version || 0,
29754 tag: Object.keys(this.tags).map(function(k2) {
29755 return { keyAttributes: { k: k2, v: this.tags[k2] } };
29760 r2.node["@changeset"] = changeset_id;
29763 asGeoJSON: function() {
29766 coordinates: this.loc
29771 // modules/actions/circularize.js
29772 function actionCircularize(wayId, projection2, maxAngle) {
29773 maxAngle = (maxAngle || 20) * Math.PI / 180;
29774 var action = function(graph, t2) {
29775 if (t2 === null || !isFinite(t2))
29777 t2 = Math.min(Math.max(+t2, 0), 1);
29778 var way = graph.entity(wayId);
29779 var origNodes = {};
29780 graph.childNodes(way).forEach(function(node2) {
29781 if (!origNodes[node2.id])
29782 origNodes[node2.id] = node2;
29784 if (!way.isConvex(graph)) {
29785 graph = action.makeConvex(graph);
29787 var nodes = utilArrayUniq(graph.childNodes(way));
29788 var keyNodes = nodes.filter(function(n3) {
29789 return graph.parentWays(n3).length !== 1;
29791 var points = nodes.map(function(n3) {
29792 return projection2(n3.loc);
29794 var keyPoints = keyNodes.map(function(n3) {
29795 return projection2(n3.loc);
29797 var centroid = points.length === 2 ? geoVecInterp(points[0], points[1], 0.5) : centroid_default2(points);
29798 var radius = median(points, function(p2) {
29799 return geoVecLength(centroid, p2);
29801 var sign2 = area_default3(points) > 0 ? 1 : -1;
29802 var ids, i3, j3, k2;
29803 if (!keyNodes.length) {
29804 keyNodes = [nodes[0]];
29805 keyPoints = [points[0]];
29807 if (keyNodes.length === 1) {
29808 var index = nodes.indexOf(keyNodes[0]);
29809 var oppositeIndex = Math.floor((index + nodes.length / 2) % nodes.length);
29810 keyNodes.push(nodes[oppositeIndex]);
29811 keyPoints.push(points[oppositeIndex]);
29813 for (i3 = 0; i3 < keyPoints.length; i3++) {
29814 var nextKeyNodeIndex = (i3 + 1) % keyNodes.length;
29815 var startNode = keyNodes[i3];
29816 var endNode = keyNodes[nextKeyNodeIndex];
29817 var startNodeIndex = nodes.indexOf(startNode);
29818 var endNodeIndex = nodes.indexOf(endNode);
29819 var numberNewPoints = -1;
29820 var indexRange = endNodeIndex - startNodeIndex;
29821 var nearNodes = {};
29822 var inBetweenNodes = [];
29823 var startAngle, endAngle, totalAngle, eachAngle;
29824 var angle2, loc, node, origNode;
29825 if (indexRange < 0) {
29826 indexRange += nodes.length;
29828 var distance = geoVecLength(centroid, keyPoints[i3]) || 1e-4;
29830 centroid[0] + (keyPoints[i3][0] - centroid[0]) / distance * radius,
29831 centroid[1] + (keyPoints[i3][1] - centroid[1]) / distance * radius
29833 loc = projection2.invert(keyPoints[i3]);
29834 node = keyNodes[i3];
29835 origNode = origNodes[node.id];
29836 node = node.move(geoVecInterp(origNode.loc, loc, t2));
29837 graph = graph.replace(node);
29838 startAngle = Math.atan2(keyPoints[i3][1] - centroid[1], keyPoints[i3][0] - centroid[0]);
29839 endAngle = Math.atan2(keyPoints[nextKeyNodeIndex][1] - centroid[1], keyPoints[nextKeyNodeIndex][0] - centroid[0]);
29840 totalAngle = endAngle - startAngle;
29841 if (totalAngle * sign2 > 0) {
29842 totalAngle = -sign2 * (2 * Math.PI - Math.abs(totalAngle));
29846 eachAngle = totalAngle / (indexRange + numberNewPoints);
29847 } while (Math.abs(eachAngle) > maxAngle);
29848 for (j3 = 1; j3 < indexRange; j3++) {
29849 angle2 = startAngle + j3 * eachAngle;
29850 loc = projection2.invert([
29851 centroid[0] + Math.cos(angle2) * radius,
29852 centroid[1] + Math.sin(angle2) * radius
29854 node = nodes[(j3 + startNodeIndex) % nodes.length];
29855 origNode = origNodes[node.id];
29856 nearNodes[node.id] = angle2;
29857 node = node.move(geoVecInterp(origNode.loc, loc, t2));
29858 graph = graph.replace(node);
29860 for (j3 = 0; j3 < numberNewPoints; j3++) {
29861 angle2 = startAngle + (indexRange + j3) * eachAngle;
29862 loc = projection2.invert([
29863 centroid[0] + Math.cos(angle2) * radius,
29864 centroid[1] + Math.sin(angle2) * radius
29866 var min3 = Infinity;
29867 for (var nodeId in nearNodes) {
29868 var nearAngle = nearNodes[nodeId];
29869 var dist = Math.abs(nearAngle - angle2);
29872 origNode = origNodes[nodeId];
29875 node = osmNode({ loc: geoVecInterp(origNode.loc, loc, t2) });
29876 graph = graph.replace(node);
29877 nodes.splice(endNodeIndex + j3, 0, node);
29878 inBetweenNodes.push(node.id);
29880 if (indexRange === 1 && inBetweenNodes.length) {
29881 var startIndex1 = way.nodes.lastIndexOf(startNode.id);
29882 var endIndex1 = way.nodes.lastIndexOf(endNode.id);
29883 var wayDirection1 = endIndex1 - startIndex1;
29884 if (wayDirection1 < -1) {
29887 var parentWays = graph.parentWays(keyNodes[i3]);
29888 for (j3 = 0; j3 < parentWays.length; j3++) {
29889 var sharedWay = parentWays[j3];
29890 if (sharedWay === way)
29892 if (sharedWay.areAdjacent(startNode.id, endNode.id)) {
29893 var startIndex2 = sharedWay.nodes.lastIndexOf(startNode.id);
29894 var endIndex2 = sharedWay.nodes.lastIndexOf(endNode.id);
29895 var wayDirection2 = endIndex2 - startIndex2;
29896 var insertAt = endIndex2;
29897 if (wayDirection2 < -1) {
29900 if (wayDirection1 !== wayDirection2) {
29901 inBetweenNodes.reverse();
29902 insertAt = startIndex2;
29904 for (k2 = 0; k2 < inBetweenNodes.length; k2++) {
29905 sharedWay = sharedWay.addNode(inBetweenNodes[k2], insertAt + k2);
29907 graph = graph.replace(sharedWay);
29912 ids = nodes.map(function(n3) {
29916 way = way.update({ nodes: ids });
29917 graph = graph.replace(way);
29920 action.makeConvex = function(graph) {
29921 var way = graph.entity(wayId);
29922 var nodes = utilArrayUniq(graph.childNodes(way));
29923 var points = nodes.map(function(n3) {
29924 return projection2(n3.loc);
29926 var sign2 = area_default3(points) > 0 ? 1 : -1;
29927 var hull = hull_default(points);
29929 if (sign2 === -1) {
29933 for (i3 = 0; i3 < hull.length - 1; i3++) {
29934 var startIndex = points.indexOf(hull[i3]);
29935 var endIndex = points.indexOf(hull[i3 + 1]);
29936 var indexRange = endIndex - startIndex;
29937 if (indexRange < 0) {
29938 indexRange += nodes.length;
29940 for (j3 = 1; j3 < indexRange; j3++) {
29941 var point2 = geoVecInterp(hull[i3], hull[i3 + 1], j3 / indexRange);
29942 var node = nodes[(j3 + startIndex) % nodes.length].move(projection2.invert(point2));
29943 graph = graph.replace(node);
29948 action.disabled = function(graph) {
29949 if (!graph.entity(wayId).isClosed()) {
29950 return "not_closed";
29952 var way = graph.entity(wayId);
29953 var nodes = utilArrayUniq(graph.childNodes(way));
29954 var points = nodes.map(function(n3) {
29955 return projection2(n3.loc);
29957 var hull = hull_default(points);
29958 var epsilonAngle = Math.PI / 180;
29959 if (hull.length !== points.length || hull.length < 3) {
29962 var centroid = centroid_default2(points);
29963 var radius = geoVecLengthSquare(centroid, points[0]);
29964 var i3, actualPoint;
29965 for (i3 = 0; i3 < hull.length; i3++) {
29966 actualPoint = hull[i3];
29967 var actualDist = geoVecLengthSquare(actualPoint, centroid);
29968 var diff = Math.abs(actualDist - radius);
29969 if (diff > 0.05 * radius) {
29973 for (i3 = 0; i3 < hull.length; i3++) {
29974 actualPoint = hull[i3];
29975 var nextPoint = hull[(i3 + 1) % hull.length];
29976 var startAngle = Math.atan2(actualPoint[1] - centroid[1], actualPoint[0] - centroid[0]);
29977 var endAngle = Math.atan2(nextPoint[1] - centroid[1], nextPoint[0] - centroid[0]);
29978 var angle2 = endAngle - startAngle;
29982 if (angle2 > Math.PI) {
29983 angle2 = 2 * Math.PI - angle2;
29985 if (angle2 > maxAngle + epsilonAngle) {
29989 return "already_circular";
29991 action.transitionable = true;
29995 // modules/actions/delete_way.js
29996 function actionDeleteWay(wayID) {
29997 function canDeleteNode(node, graph) {
29998 if (graph.parentWays(node).length || graph.parentRelations(node).length)
30000 var geometries = osmNodeGeometriesForTags(node.tags);
30001 if (geometries.point)
30003 if (geometries.vertex)
30005 return !node.hasInterestingTags();
30007 var action = function(graph) {
30008 var way = graph.entity(wayID);
30009 graph.parentRelations(way).forEach(function(parent) {
30010 parent = parent.removeMembersWithID(wayID);
30011 graph = graph.replace(parent);
30012 if (parent.isDegenerate()) {
30013 graph = actionDeleteRelation(parent.id)(graph);
30016 new Set(way.nodes).forEach(function(nodeID) {
30017 graph = graph.replace(way.removeNode(nodeID));
30018 var node = graph.entity(nodeID);
30019 if (canDeleteNode(node, graph)) {
30020 graph = graph.remove(node);
30023 return graph.remove(way);
30028 // modules/actions/delete_multiple.js
30029 function actionDeleteMultiple(ids) {
30031 way: actionDeleteWay,
30032 node: actionDeleteNode,
30033 relation: actionDeleteRelation
30035 var action = function(graph) {
30036 ids.forEach(function(id2) {
30037 if (graph.hasEntity(id2)) {
30038 graph = actions[graph.entity(id2).type](id2)(graph);
30046 // modules/actions/delete_relation.js
30047 function actionDeleteRelation(relationID, allowUntaggedMembers) {
30048 function canDeleteEntity(entity, graph) {
30049 return !graph.parentWays(entity).length && !graph.parentRelations(entity).length && (!entity.hasInterestingTags() && !allowUntaggedMembers);
30051 var action = function(graph) {
30052 var relation = graph.entity(relationID);
30053 graph.parentRelations(relation).forEach(function(parent) {
30054 parent = parent.removeMembersWithID(relationID);
30055 graph = graph.replace(parent);
30056 if (parent.isDegenerate()) {
30057 graph = actionDeleteRelation(parent.id)(graph);
30060 var memberIDs = utilArrayUniq(relation.members.map(function(m2) {
30063 memberIDs.forEach(function(memberID) {
30064 graph = graph.replace(relation.removeMembersWithID(memberID));
30065 var entity = graph.entity(memberID);
30066 if (canDeleteEntity(entity, graph)) {
30067 graph = actionDeleteMultiple([memberID])(graph);
30070 return graph.remove(relation);
30075 // modules/actions/delete_node.js
30076 function actionDeleteNode(nodeId) {
30077 var action = function(graph) {
30078 var node = graph.entity(nodeId);
30079 graph.parentWays(node).forEach(function(parent) {
30080 parent = parent.removeNode(nodeId);
30081 graph = graph.replace(parent);
30082 if (parent.isDegenerate()) {
30083 graph = actionDeleteWay(parent.id)(graph);
30086 graph.parentRelations(node).forEach(function(parent) {
30087 parent = parent.removeMembersWithID(nodeId);
30088 graph = graph.replace(parent);
30089 if (parent.isDegenerate()) {
30090 graph = actionDeleteRelation(parent.id)(graph);
30093 return graph.remove(node);
30098 // modules/actions/connect.js
30099 function actionConnect(nodeIDs) {
30100 var action = function(graph) {
30106 var interestingIDs = [];
30107 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30108 node = graph.entity(nodeIDs[i3]);
30109 if (node.hasInterestingTags()) {
30110 if (!node.isNew()) {
30111 interestingIDs.push(node.id);
30115 survivor = graph.entity(utilOldestID(interestingIDs.length > 0 ? interestingIDs : nodeIDs));
30116 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30117 node = graph.entity(nodeIDs[i3]);
30118 if (node.id === survivor.id)
30120 parents = graph.parentWays(node);
30121 for (j3 = 0; j3 < parents.length; j3++) {
30122 graph = graph.replace(parents[j3].replaceNode(node.id, survivor.id));
30124 parents = graph.parentRelations(node);
30125 for (j3 = 0; j3 < parents.length; j3++) {
30126 graph = graph.replace(parents[j3].replaceMember(node, survivor));
30128 survivor = survivor.mergeTags(node.tags);
30129 graph = actionDeleteNode(node.id)(graph);
30131 graph = graph.replace(survivor);
30132 parents = graph.parentWays(survivor);
30133 for (i3 = 0; i3 < parents.length; i3++) {
30134 if (parents[i3].isDegenerate()) {
30135 graph = actionDeleteWay(parents[i3].id)(graph);
30140 action.disabled = function(graph) {
30142 var restrictionIDs = [];
30145 var relations, relation, role;
30147 survivor = graph.entity(utilOldestID(nodeIDs));
30148 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30149 node = graph.entity(nodeIDs[i3]);
30150 relations = graph.parentRelations(node);
30151 for (j3 = 0; j3 < relations.length; j3++) {
30152 relation = relations[j3];
30153 role = relation.memberById(node.id).role || "";
30154 if (relation.hasFromViaTo()) {
30155 restrictionIDs.push(relation.id);
30157 if (seen[relation.id] !== void 0 && seen[relation.id] !== role) {
30160 seen[relation.id] = role;
30164 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30165 node = graph.entity(nodeIDs[i3]);
30166 var parents = graph.parentWays(node);
30167 for (j3 = 0; j3 < parents.length; j3++) {
30168 var parent = parents[j3];
30169 relations = graph.parentRelations(parent);
30170 for (k2 = 0; k2 < relations.length; k2++) {
30171 relation = relations[k2];
30172 if (relation.hasFromViaTo()) {
30173 restrictionIDs.push(relation.id);
30178 restrictionIDs = utilArrayUniq(restrictionIDs);
30179 for (i3 = 0; i3 < restrictionIDs.length; i3++) {
30180 relation = graph.entity(restrictionIDs[i3]);
30181 if (!relation.isComplete(graph))
30183 var memberWays = relation.members.filter(function(m2) {
30184 return m2.type === "way";
30185 }).map(function(m2) {
30186 return graph.entity(m2.id);
30188 memberWays = utilArrayUniq(memberWays);
30189 var f3 = relation.memberByRole("from");
30190 var t2 = relation.memberByRole("to");
30191 var isUturn = f3.id === t2.id;
30192 var nodes = { from: [], via: [], to: [], keyfrom: [], keyto: [] };
30193 for (j3 = 0; j3 < relation.members.length; j3++) {
30194 collectNodes(relation.members[j3], nodes);
30196 nodes.keyfrom = utilArrayUniq(nodes.keyfrom.filter(hasDuplicates));
30197 nodes.keyto = utilArrayUniq(nodes.keyto.filter(hasDuplicates));
30198 var filter2 = keyNodeFilter(nodes.keyfrom, nodes.keyto);
30199 nodes.from = nodes.from.filter(filter2);
30200 nodes.via = nodes.via.filter(filter2);
30201 nodes.to = nodes.to.filter(filter2);
30202 var connectFrom = false;
30203 var connectVia = false;
30204 var connectTo = false;
30205 var connectKeyFrom = false;
30206 var connectKeyTo = false;
30207 for (j3 = 0; j3 < nodeIDs.length; j3++) {
30208 var n3 = nodeIDs[j3];
30209 if (nodes.from.indexOf(n3) !== -1) {
30210 connectFrom = true;
30212 if (nodes.via.indexOf(n3) !== -1) {
30215 if (nodes.to.indexOf(n3) !== -1) {
30218 if (nodes.keyfrom.indexOf(n3) !== -1) {
30219 connectKeyFrom = true;
30221 if (nodes.keyto.indexOf(n3) !== -1) {
30222 connectKeyTo = true;
30225 if (connectFrom && connectTo && !isUturn) {
30226 return "restriction";
30228 if (connectFrom && connectVia) {
30229 return "restriction";
30231 if (connectTo && connectVia) {
30232 return "restriction";
30234 if (connectKeyFrom || connectKeyTo) {
30235 if (nodeIDs.length !== 2) {
30236 return "restriction";
30240 for (j3 = 0; j3 < memberWays.length; j3++) {
30241 way = memberWays[j3];
30242 if (way.contains(nodeIDs[0])) {
30245 if (way.contains(nodeIDs[1])) {
30251 for (j3 = 0; j3 < memberWays.length; j3++) {
30252 way = memberWays[j3];
30253 if (way.areAdjacent(n0, n1)) {
30259 return "restriction";
30263 for (j3 = 0; j3 < memberWays.length; j3++) {
30264 way = memberWays[j3].update({});
30265 for (k2 = 0; k2 < nodeIDs.length; k2++) {
30266 if (nodeIDs[k2] === survivor.id)
30268 if (way.areAdjacent(nodeIDs[k2], survivor.id)) {
30269 way = way.removeNode(nodeIDs[k2]);
30271 way = way.replaceNode(nodeIDs[k2], survivor.id);
30274 if (way.isDegenerate()) {
30275 return "restriction";
30280 function hasDuplicates(n4, i4, arr) {
30281 return arr.indexOf(n4) !== arr.lastIndexOf(n4);
30283 function keyNodeFilter(froms, tos) {
30284 return function(n4) {
30285 return froms.indexOf(n4) === -1 && tos.indexOf(n4) === -1;
30288 function collectNodes(member, collection) {
30289 var entity = graph.hasEntity(member.id);
30292 var role2 = member.role || "";
30293 if (!collection[role2]) {
30294 collection[role2] = [];
30296 if (member.type === "node") {
30297 collection[role2].push(member.id);
30298 if (role2 === "via") {
30299 collection.keyfrom.push(member.id);
30300 collection.keyto.push(member.id);
30302 } else if (member.type === "way") {
30303 collection[role2].push.apply(collection[role2], entity.nodes);
30304 if (role2 === "from" || role2 === "via") {
30305 collection.keyfrom.push(entity.first());
30306 collection.keyfrom.push(entity.last());
30308 if (role2 === "to" || role2 === "via") {
30309 collection.keyto.push(entity.first());
30310 collection.keyto.push(entity.last());
30318 // modules/actions/copy_entities.js
30319 function actionCopyEntities(ids, fromGraph) {
30321 var action = function(graph) {
30322 ids.forEach(function(id3) {
30323 fromGraph.entity(id3).copy(fromGraph, _copies);
30325 for (var id2 in _copies) {
30326 graph = graph.replace(_copies[id2]);
30330 action.copies = function() {
30336 // modules/actions/delete_member.js
30337 function actionDeleteMember(relationId, memberIndex) {
30338 return function(graph) {
30339 var relation = graph.entity(relationId).removeMember(memberIndex);
30340 graph = graph.replace(relation);
30341 if (relation.isDegenerate()) {
30342 graph = actionDeleteRelation(relation.id)(graph);
30348 // modules/actions/discard_tags.js
30349 function actionDiscardTags(difference, discardTags) {
30350 discardTags = discardTags || {};
30351 return (graph) => {
30352 difference.modified().forEach(checkTags);
30353 difference.created().forEach(checkTags);
30355 function checkTags(entity) {
30356 const keys2 = Object.keys(entity.tags);
30357 let didDiscard = false;
30359 for (let i3 = 0; i3 < keys2.length; i3++) {
30360 const k2 = keys2[i3];
30361 if (discardTags[k2] || !entity.tags[k2]) {
30364 tags[k2] = entity.tags[k2];
30368 graph = graph.replace(entity.update({ tags }));
30374 // modules/actions/disconnect.js
30375 function actionDisconnect(nodeId, newNodeId) {
30377 var disconnectableRelationTypes = {
30378 "associatedStreet": true,
30379 "enforcement": true,
30382 var action = function(graph) {
30383 var node = graph.entity(nodeId);
30384 var connections = action.connections(graph);
30385 connections.forEach(function(connection) {
30386 var way = graph.entity(connection.wayID);
30387 var newNode = osmNode({ id: newNodeId, loc: node.loc, tags: node.tags });
30388 graph = graph.replace(newNode);
30389 if (connection.index === 0 && way.isArea()) {
30390 graph = graph.replace(way.replaceNode(way.nodes[0], newNode.id));
30391 } else if (way.isClosed() && connection.index === way.nodes.length - 1) {
30392 graph = graph.replace(way.unclose().addNode(newNode.id));
30394 graph = graph.replace(way.updateNode(newNode.id, connection.index));
30399 action.connections = function(graph) {
30400 var candidates = [];
30401 var keeping = false;
30402 var parentWays = graph.parentWays(graph.entity(nodeId));
30404 for (var i3 = 0; i3 < parentWays.length; i3++) {
30405 way = parentWays[i3];
30406 if (wayIds && wayIds.indexOf(way.id) === -1) {
30410 if (way.isArea() && way.nodes[0] === nodeId) {
30411 candidates.push({ wayID: way.id, index: 0 });
30413 for (var j3 = 0; j3 < way.nodes.length; j3++) {
30414 waynode = way.nodes[j3];
30415 if (waynode === nodeId) {
30416 if (way.isClosed() && parentWays.length > 1 && wayIds && wayIds.indexOf(way.id) !== -1 && j3 === way.nodes.length - 1) {
30419 candidates.push({ wayID: way.id, index: j3 });
30424 return keeping ? candidates : candidates.slice(1);
30426 action.disabled = function(graph) {
30427 var connections = action.connections(graph);
30428 if (connections.length === 0)
30429 return "not_connected";
30430 var parentWays = graph.parentWays(graph.entity(nodeId));
30431 var seenRelationIds = {};
30432 var sharedRelation;
30433 parentWays.forEach(function(way) {
30434 var relations = graph.parentRelations(way);
30435 relations.filter((relation) => !disconnectableRelationTypes[relation.tags.type]).forEach(function(relation) {
30436 if (relation.id in seenRelationIds) {
30438 if (wayIds.indexOf(way.id) !== -1 || wayIds.indexOf(seenRelationIds[relation.id]) !== -1) {
30439 sharedRelation = relation;
30442 sharedRelation = relation;
30445 seenRelationIds[relation.id] = way.id;
30449 if (sharedRelation)
30452 action.limitWays = function(val) {
30453 if (!arguments.length)
30461 // modules/actions/extract.js
30462 function actionExtract(entityID, projection2) {
30463 var extractedNodeID;
30464 var action = function(graph) {
30465 var entity = graph.entity(entityID);
30466 if (entity.type === "node") {
30467 return extractFromNode(entity, graph);
30469 return extractFromWayOrRelation(entity, graph);
30471 function extractFromNode(node, graph) {
30472 extractedNodeID = node.id;
30473 var replacement = osmNode({ loc: node.loc });
30474 graph = graph.replace(replacement);
30475 graph = graph.parentWays(node).reduce(function(accGraph, parentWay) {
30476 return accGraph.replace(parentWay.replaceNode(entityID, replacement.id));
30478 return graph.parentRelations(node).reduce(function(accGraph, parentRel) {
30479 return accGraph.replace(parentRel.replaceMember(node, replacement));
30482 function extractFromWayOrRelation(entity, graph) {
30483 var fromGeometry = entity.geometry(graph);
30484 var keysToCopyAndRetain = ["source", "wheelchair"];
30485 var keysToRetain = ["area"];
30486 var buildingKeysToRetain = ["architect", "building", "height", "layer"];
30487 var extractedLoc = path_default(projection2).centroid(entity.asGeoJSON(graph));
30488 extractedLoc = extractedLoc && projection2.invert(extractedLoc);
30489 if (!extractedLoc || !isFinite(extractedLoc[0]) || !isFinite(extractedLoc[1])) {
30490 extractedLoc = entity.extent(graph).center();
30492 var indoorAreaValues = {
30499 var isBuilding = entity.tags.building && entity.tags.building !== "no" || entity.tags["building:part"] && entity.tags["building:part"] !== "no";
30500 var isIndoorArea = fromGeometry === "area" && entity.tags.indoor && indoorAreaValues[entity.tags.indoor];
30501 var entityTags = Object.assign({}, entity.tags);
30502 var pointTags = {};
30503 for (var key in entityTags) {
30504 if (entity.type === "relation" && key === "type") {
30507 if (keysToRetain.indexOf(key) !== -1) {
30511 if (buildingKeysToRetain.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/))
30514 if (isIndoorArea && key === "indoor") {
30517 pointTags[key] = entityTags[key];
30518 if (keysToCopyAndRetain.indexOf(key) !== -1 || key.match(/^addr:.{1,}/)) {
30520 } else if (isIndoorArea && key === "level") {
30523 delete entityTags[key];
30525 if (!isBuilding && !isIndoorArea && fromGeometry === "area") {
30526 entityTags.area = "yes";
30528 var replacement = osmNode({ loc: extractedLoc, tags: pointTags });
30529 graph = graph.replace(replacement);
30530 extractedNodeID = replacement.id;
30531 return graph.replace(entity.update({ tags: entityTags }));
30533 action.getExtractedNodeID = function() {
30534 return extractedNodeID;
30539 // modules/actions/join.js
30540 function actionJoin(ids) {
30541 function groupEntitiesByGeometry(graph) {
30542 var entities = ids.map(function(id2) {
30543 return graph.entity(id2);
30545 return Object.assign(
30547 utilArrayGroupBy(entities, function(entity) {
30548 return entity.geometry(graph);
30552 var action = function(graph) {
30553 var ways = ids.map(graph.entity, graph);
30554 var survivorID = utilOldestID(ways.map((way) => way.id));
30555 ways.sort(function(a2, b2) {
30556 var aSided = a2.isSided();
30557 var bSided = b2.isSided();
30558 return aSided && !bSided ? -1 : bSided && !aSided ? 1 : 0;
30560 var sequences = osmJoinWays(ways, graph);
30561 var joined = sequences[0];
30562 graph = sequences.actions.reduce(function(g3, action2) {
30563 return action2(g3);
30565 var survivor = graph.entity(survivorID);
30566 survivor = survivor.update({ nodes: joined.nodes.map(function(n3) {
30569 graph = graph.replace(survivor);
30570 joined.forEach(function(way) {
30571 if (way.id === survivorID)
30573 graph.parentRelations(way).forEach(function(parent) {
30574 graph = graph.replace(parent.replaceMember(way, survivor));
30576 survivor = survivor.mergeTags(way.tags);
30577 graph = graph.replace(survivor);
30578 graph = actionDeleteWay(way.id)(graph);
30580 function checkForSimpleMultipolygon() {
30581 if (!survivor.isClosed())
30583 var multipolygons = graph.parentMultipolygons(survivor).filter(function(multipolygon2) {
30584 return multipolygon2.members.length === 1;
30586 if (multipolygons.length !== 1)
30588 var multipolygon = multipolygons[0];
30589 for (var key in survivor.tags) {
30590 if (multipolygon.tags[key] && // don't collapse if tags cannot be cleanly merged
30591 multipolygon.tags[key] !== survivor.tags[key])
30594 survivor = survivor.mergeTags(multipolygon.tags);
30595 graph = graph.replace(survivor);
30596 graph = actionDeleteRelation(
30599 /* allow untagged members */
30601 var tags = Object.assign({}, survivor.tags);
30602 if (survivor.geometry(graph) !== "area") {
30606 survivor = survivor.update({ tags });
30607 graph = graph.replace(survivor);
30609 checkForSimpleMultipolygon();
30612 action.resultingWayNodesLength = function(graph) {
30613 return ids.reduce(function(count, id2) {
30614 return count + graph.entity(id2).nodes.length;
30615 }, 0) - ids.length - 1;
30617 action.disabled = function(graph) {
30618 var geometries = groupEntitiesByGeometry(graph);
30619 if (ids.length < 2 || ids.length !== geometries.line.length) {
30620 return "not_eligible";
30622 var joined = osmJoinWays(ids.map(graph.entity, graph), graph);
30623 if (joined.length > 1) {
30624 return "not_adjacent";
30627 var sortedParentRelations = function(id2) {
30628 return graph.parentRelations(graph.entity(id2)).filter((rel) => !rel.isRestriction() && !rel.isConnectivity()).sort((a2, b2) => a2.id - b2.id);
30630 var relsA = sortedParentRelations(ids[0]);
30631 for (i3 = 1; i3 < ids.length; i3++) {
30632 var relsB = sortedParentRelations(ids[i3]);
30633 if (!utilArrayIdentical(relsA, relsB)) {
30634 return "conflicting_relations";
30637 for (i3 = 0; i3 < ids.length - 1; i3++) {
30638 for (var j3 = i3 + 1; j3 < ids.length; j3++) {
30639 var path1 = graph.childNodes(graph.entity(ids[i3])).map(function(e3) {
30642 var path2 = graph.childNodes(graph.entity(ids[j3])).map(function(e3) {
30645 var intersections = geoPathIntersections(path1, path2);
30646 var common = utilArrayIntersection(
30647 joined[0].nodes.map(function(n3) {
30648 return n3.loc.toString();
30650 intersections.map(function(n3) {
30651 return n3.toString();
30654 if (common.length !== intersections.length) {
30655 return "paths_intersect";
30659 var nodeIds = joined[0].nodes.map(function(n3) {
30664 var conflicting = false;
30665 joined[0].forEach(function(way) {
30666 var parents = graph.parentRelations(way);
30667 parents.forEach(function(parent) {
30668 if ((parent.isRestriction() || parent.isConnectivity()) && parent.members.some(function(m2) {
30669 return nodeIds.indexOf(m2.id) >= 0;
30674 for (var k2 in way.tags) {
30675 if (!(k2 in tags)) {
30676 tags[k2] = way.tags[k2];
30677 } else if (tags[k2] && osmIsInterestingTag(k2) && tags[k2] !== way.tags[k2]) {
30678 conflicting = true;
30683 return relation.isRestriction() ? "restriction" : "connectivity";
30686 return "conflicting_tags";
30692 // modules/actions/merge.js
30693 function actionMerge(ids) {
30694 function groupEntitiesByGeometry(graph) {
30695 var entities = ids.map(function(id2) {
30696 return graph.entity(id2);
30698 return Object.assign(
30699 { point: [], area: [], line: [], relation: [] },
30700 utilArrayGroupBy(entities, function(entity) {
30701 return entity.geometry(graph);
30705 var action = function(graph) {
30706 var geometries = groupEntitiesByGeometry(graph);
30707 var target = geometries.area[0] || geometries.line[0];
30708 var points = geometries.point;
30709 points.forEach(function(point2) {
30710 target = target.mergeTags(point2.tags);
30711 graph = graph.replace(target);
30712 graph.parentRelations(point2).forEach(function(parent) {
30713 graph = graph.replace(parent.replaceMember(point2, target));
30715 var nodes = utilArrayUniq(graph.childNodes(target));
30716 var removeNode = point2;
30717 if (!point2.isNew()) {
30718 var inserted = false;
30719 var canBeReplaced = function(node2) {
30720 return !(graph.parentWays(node2).length > 1 || graph.parentRelations(node2).length);
30722 var replaceNode = function(node2) {
30723 graph = graph.replace(point2.update({ tags: node2.tags, loc: node2.loc }));
30724 target = target.replaceNode(node2.id, point2.id);
30725 graph = graph.replace(target);
30726 removeNode = node2;
30731 for (i3 = 0; i3 < nodes.length; i3++) {
30733 if (canBeReplaced(node) && node.isNew()) {
30738 if (!inserted && point2.hasInterestingTags()) {
30739 for (i3 = 0; i3 < nodes.length; i3++) {
30741 if (canBeReplaced(node) && !node.hasInterestingTags()) {
30747 for (i3 = 0; i3 < nodes.length; i3++) {
30749 if (canBeReplaced(node) && utilCompareIDs(point2.id, node.id) < 0) {
30757 graph = graph.remove(removeNode);
30759 if (target.tags.area === "yes") {
30760 var tags = Object.assign({}, target.tags);
30762 if (osmTagSuggestingArea(tags)) {
30763 target = target.update({ tags });
30764 graph = graph.replace(target);
30769 action.disabled = function(graph) {
30770 var geometries = groupEntitiesByGeometry(graph);
30771 if (geometries.point.length === 0 || geometries.area.length + geometries.line.length !== 1 || geometries.relation.length !== 0) {
30772 return "not_eligible";
30778 // modules/actions/merge_nodes.js
30779 function actionMergeNodes(nodeIDs, loc) {
30780 function chooseLoc(graph) {
30781 if (!nodeIDs.length)
30784 var interestingCount = 0;
30785 var interestingLoc;
30786 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30787 var node = graph.entity(nodeIDs[i3]);
30788 if (node.hasInterestingTags()) {
30789 interestingLoc = ++interestingCount === 1 ? node.loc : null;
30791 sum = geoVecAdd(sum, node.loc);
30793 return interestingLoc || geoVecScale(sum, 1 / nodeIDs.length);
30795 var action = function(graph) {
30796 if (nodeIDs.length < 2)
30800 toLoc = chooseLoc(graph);
30802 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30803 var node = graph.entity(nodeIDs[i3]);
30804 if (node.loc !== toLoc) {
30805 graph = graph.replace(node.move(toLoc));
30808 return actionConnect(nodeIDs)(graph);
30810 action.disabled = function(graph) {
30811 if (nodeIDs.length < 2)
30812 return "not_eligible";
30813 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30814 var entity = graph.entity(nodeIDs[i3]);
30815 if (entity.type !== "node")
30816 return "not_eligible";
30818 return actionConnect(nodeIDs).disabled(graph);
30823 // modules/osm/changeset.js
30824 function osmChangeset() {
30825 if (!(this instanceof osmChangeset)) {
30826 return new osmChangeset().initialize(arguments);
30827 } else if (arguments.length) {
30828 this.initialize(arguments);
30831 osmEntity.changeset = osmChangeset;
30832 osmChangeset.prototype = Object.create(osmEntity.prototype);
30833 Object.assign(osmChangeset.prototype, {
30835 extent: function() {
30836 return new geoExtent();
30838 geometry: function() {
30839 return "changeset";
30841 asJXON: function() {
30845 tag: Object.keys(this.tags).map(function(k2) {
30846 return { "@k": k2, "@v": this.tags[k2] };
30854 // Generate [osmChange](http://wiki.openstreetmap.org/wiki/OsmChange)
30855 // XML. Returns a string.
30856 osmChangeJXON: function(changes) {
30857 var changeset_id = this.id;
30858 function nest(x2, order) {
30860 for (var i3 = 0; i3 < x2.length; i3++) {
30861 var tagName = Object.keys(x2[i3])[0];
30862 if (!groups[tagName])
30863 groups[tagName] = [];
30864 groups[tagName].push(x2[i3][tagName]);
30867 order.forEach(function(o2) {
30869 ordered[o2] = groups[o2];
30873 function sort(changes2) {
30874 function resolve(item) {
30875 return relations.find(function(relation2) {
30876 return item.keyAttributes.type === "relation" && item.keyAttributes.ref === relation2["@id"];
30879 function isNew(item) {
30880 return !sorted[item["@id"]] && !processing.find(function(proc) {
30881 return proc["@id"] === item["@id"];
30884 var processing = [];
30886 var relations = changes2.relation;
30889 for (var i3 = 0; i3 < relations.length; i3++) {
30890 var relation = relations[i3];
30891 if (!sorted[relation["@id"]]) {
30892 processing.push(relation);
30894 while (processing.length > 0) {
30895 var next = processing[0], deps = next.member.map(resolve).filter(Boolean).filter(isNew);
30896 if (deps.length === 0) {
30897 sorted[next["@id"]] = next;
30898 processing.shift();
30900 processing = deps.concat(processing);
30904 changes2.relation = Object.values(sorted);
30907 function rep2(entity) {
30908 return entity.asJXON(changeset_id);
30913 "@generator": "iD",
30914 "create": sort(nest(changes.created.map(rep2), ["node", "way", "relation"])),
30915 "modify": nest(changes.modified.map(rep2), ["node", "way", "relation"]),
30916 "delete": Object.assign(nest(changes.deleted.map(rep2), ["relation", "way", "node"]), { "@if-unused": true })
30920 asGeoJSON: function() {
30925 // modules/osm/note.js
30926 function osmNote() {
30927 if (!(this instanceof osmNote)) {
30928 return new osmNote().initialize(arguments);
30929 } else if (arguments.length) {
30930 this.initialize(arguments);
30933 osmNote.id = function() {
30934 return osmNote.id.next--;
30936 osmNote.id.next = -1;
30937 Object.assign(osmNote.prototype, {
30939 initialize: function(sources) {
30940 for (var i3 = 0; i3 < sources.length; ++i3) {
30941 var source = sources[i3];
30942 for (var prop in source) {
30943 if (Object.prototype.hasOwnProperty.call(source, prop)) {
30944 if (source[prop] === void 0) {
30947 this[prop] = source[prop];
30953 this.id = osmNote.id().toString();
30957 extent: function() {
30958 return new geoExtent(this.loc);
30960 update: function(attrs) {
30961 return osmNote(this, attrs);
30963 isNew: function() {
30964 return this.id < 0;
30966 move: function(loc) {
30967 return this.update({ loc });
30971 // modules/osm/relation.js
30972 function osmRelation() {
30973 if (!(this instanceof osmRelation)) {
30974 return new osmRelation().initialize(arguments);
30975 } else if (arguments.length) {
30976 this.initialize(arguments);
30979 osmEntity.relation = osmRelation;
30980 osmRelation.prototype = Object.create(osmEntity.prototype);
30981 osmRelation.creationOrder = function(a2, b2) {
30982 var aId = parseInt(osmEntity.id.toOSM(a2.id), 10);
30983 var bId = parseInt(osmEntity.id.toOSM(b2.id), 10);
30984 if (aId < 0 || bId < 0)
30988 Object.assign(osmRelation.prototype, {
30991 copy: function(resolver, copies) {
30992 if (copies[this.id])
30993 return copies[this.id];
30994 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
30995 var members = this.members.map(function(member) {
30996 return Object.assign({}, member, { id: resolver.entity(member.id).copy(resolver, copies).id });
30998 copy2 = copy2.update({ members });
30999 copies[this.id] = copy2;
31002 extent: function(resolver, memo) {
31003 return resolver.transient(this, "extent", function() {
31004 if (memo && memo[this.id])
31005 return geoExtent();
31007 memo[this.id] = true;
31008 var extent = geoExtent();
31009 for (var i3 = 0; i3 < this.members.length; i3++) {
31010 var member = resolver.hasEntity(this.members[i3].id);
31012 extent._extend(member.extent(resolver, memo));
31018 geometry: function(graph) {
31019 return graph.transient(this, "geometry", function() {
31020 return this.isMultipolygon() ? "area" : "relation";
31023 isDegenerate: function() {
31024 return this.members.length === 0;
31026 // Return an array of members, each extended with an 'index' property whose value
31027 // is the member index.
31028 indexedMembers: function() {
31029 var result = new Array(this.members.length);
31030 for (var i3 = 0; i3 < this.members.length; i3++) {
31031 result[i3] = Object.assign({}, this.members[i3], { index: i3 });
31035 // Return the first member with the given role. A copy of the member object
31036 // is returned, extended with an 'index' property whose value is the member index.
31037 memberByRole: function(role) {
31038 for (var i3 = 0; i3 < this.members.length; i3++) {
31039 if (this.members[i3].role === role) {
31040 return Object.assign({}, this.members[i3], { index: i3 });
31044 // Same as memberByRole, but returns all members with the given role
31045 membersByRole: function(role) {
31047 for (var i3 = 0; i3 < this.members.length; i3++) {
31048 if (this.members[i3].role === role) {
31049 result.push(Object.assign({}, this.members[i3], { index: i3 }));
31054 // Return the first member with the given id. A copy of the member object
31055 // is returned, extended with an 'index' property whose value is the member index.
31056 memberById: function(id2) {
31057 for (var i3 = 0; i3 < this.members.length; i3++) {
31058 if (this.members[i3].id === id2) {
31059 return Object.assign({}, this.members[i3], { index: i3 });
31063 // Return the first member with the given id and role. A copy of the member object
31064 // is returned, extended with an 'index' property whose value is the member index.
31065 memberByIdAndRole: function(id2, role) {
31066 for (var i3 = 0; i3 < this.members.length; i3++) {
31067 if (this.members[i3].id === id2 && this.members[i3].role === role) {
31068 return Object.assign({}, this.members[i3], { index: i3 });
31072 addMember: function(member, index) {
31073 var members = this.members.slice();
31074 members.splice(index === void 0 ? members.length : index, 0, member);
31075 return this.update({ members });
31077 updateMember: function(member, index) {
31078 var members = this.members.slice();
31079 members.splice(index, 1, Object.assign({}, members[index], member));
31080 return this.update({ members });
31082 removeMember: function(index) {
31083 var members = this.members.slice();
31084 members.splice(index, 1);
31085 return this.update({ members });
31087 removeMembersWithID: function(id2) {
31088 var members = this.members.filter(function(m2) {
31089 return m2.id !== id2;
31091 return this.update({ members });
31093 moveMember: function(fromIndex, toIndex) {
31094 var members = this.members.slice();
31095 members.splice(toIndex, 0, members.splice(fromIndex, 1)[0]);
31096 return this.update({ members });
31098 // Wherever a member appears with id `needle.id`, replace it with a member
31099 // with id `replacement.id`, type `replacement.type`, and the original role,
31100 // By default, adding a duplicate member (by id and role) is prevented.
31101 // Return an updated relation.
31102 replaceMember: function(needle, replacement, keepDuplicates) {
31103 if (!this.memberById(needle.id))
31106 for (var i3 = 0; i3 < this.members.length; i3++) {
31107 var member = this.members[i3];
31108 if (member.id !== needle.id) {
31109 members.push(member);
31110 } else if (keepDuplicates || !this.memberByIdAndRole(replacement.id, member.role)) {
31111 members.push({ id: replacement.id, type: replacement.type, role: member.role });
31114 return this.update({ members });
31116 asJXON: function(changeset_id) {
31119 "@id": this.osmId(),
31120 "@version": this.version || 0,
31121 member: this.members.map(function(member) {
31126 ref: osmEntity.id.toOSM(member.id)
31130 tag: Object.keys(this.tags).map(function(k2) {
31131 return { keyAttributes: { k: k2, v: this.tags[k2] } };
31135 if (changeset_id) {
31136 r2.relation["@changeset"] = changeset_id;
31140 asGeoJSON: function(resolver) {
31141 return resolver.transient(this, "GeoJSON", function() {
31142 if (this.isMultipolygon()) {
31144 type: "MultiPolygon",
31145 coordinates: this.multipolygon(resolver)
31149 type: "FeatureCollection",
31150 properties: this.tags,
31151 features: this.members.map(function(member) {
31152 return Object.assign({ role: member.role }, resolver.entity(member.id).asGeoJSON(resolver));
31158 area: function(resolver) {
31159 return resolver.transient(this, "area", function() {
31160 return area_default(this.asGeoJSON(resolver));
31163 isMultipolygon: function() {
31164 return this.tags.type === "multipolygon";
31166 isComplete: function(resolver) {
31167 for (var i3 = 0; i3 < this.members.length; i3++) {
31168 if (!resolver.hasEntity(this.members[i3].id)) {
31174 hasFromViaTo: function() {
31175 return this.members.some(function(m2) {
31176 return m2.role === "from";
31177 }) && this.members.some(function(m2) {
31178 return m2.role === "via";
31179 }) && this.members.some(function(m2) {
31180 return m2.role === "to";
31183 isRestriction: function() {
31184 return !!(this.tags.type && this.tags.type.match(/^restriction:?/));
31186 isValidRestriction: function() {
31187 if (!this.isRestriction())
31189 var froms = this.members.filter(function(m2) {
31190 return m2.role === "from";
31192 var vias = this.members.filter(function(m2) {
31193 return m2.role === "via";
31195 var tos = this.members.filter(function(m2) {
31196 return m2.role === "to";
31198 if (froms.length !== 1 && this.tags.restriction !== "no_entry")
31200 if (froms.some(function(m2) {
31201 return m2.type !== "way";
31204 if (tos.length !== 1 && this.tags.restriction !== "no_exit")
31206 if (tos.some(function(m2) {
31207 return m2.type !== "way";
31210 if (vias.length === 0)
31212 if (vias.length > 1 && vias.some(function(m2) {
31213 return m2.type !== "way";
31218 isConnectivity: function() {
31219 return !!(this.tags.type && this.tags.type.match(/^connectivity:?/));
31221 // Returns an array [A0, ... An], each Ai being an array of node arrays [Nds0, ... Ndsm],
31222 // where Nds0 is an outer ring and subsequent Ndsi's (if any i > 0) being inner rings.
31224 // This corresponds to the structure needed for rendering a multipolygon path using a
31225 // `evenodd` fill rule, as well as the structure of a GeoJSON MultiPolygon geometry.
31227 // In the case of invalid geometries, this function will still return a result which
31228 // includes the nodes of all way members, but some Nds may be unclosed and some inner
31229 // rings not matched with the intended outer ring.
31231 multipolygon: function(resolver) {
31232 var outers = this.members.filter(function(m2) {
31233 return "outer" === (m2.role || "outer");
31235 var inners = this.members.filter(function(m2) {
31236 return "inner" === m2.role;
31238 outers = osmJoinWays(outers, resolver);
31239 inners = osmJoinWays(inners, resolver);
31240 var sequenceToLineString = function(sequence) {
31241 if (sequence.nodes.length > 2 && sequence.nodes[0] !== sequence.nodes[sequence.nodes.length - 1]) {
31242 sequence.nodes.push(sequence.nodes[0]);
31244 return sequence.nodes.map(function(node) {
31248 outers = outers.map(sequenceToLineString);
31249 inners = inners.map(sequenceToLineString);
31250 var result = outers.map(function(o3) {
31251 return [area_default({ type: "Polygon", coordinates: [o3] }) > 2 * Math.PI ? o3.reverse() : o3];
31253 function findOuter(inner2) {
31255 for (o3 = 0; o3 < outers.length; o3++) {
31256 outer = outers[o3];
31257 if (geoPolygonContainsPolygon(outer, inner2)) {
31261 for (o3 = 0; o3 < outers.length; o3++) {
31262 outer = outers[o3];
31263 if (geoPolygonIntersectsPolygon(outer, inner2, false)) {
31268 for (var i3 = 0; i3 < inners.length; i3++) {
31269 var inner = inners[i3];
31270 if (area_default({ type: "Polygon", coordinates: [inner] }) < 2 * Math.PI) {
31271 inner = inner.reverse();
31273 var o2 = findOuter(inners[i3]);
31274 if (o2 !== void 0) {
31275 result[o2].push(inners[i3]);
31277 result.push([inners[i3]]);
31284 // modules/osm/qa_item.js
31285 var QAItem = class _QAItem {
31286 constructor(loc, service, itemType, id2, props) {
31288 this.service = service.title;
31289 this.itemType = itemType;
31290 this.id = id2 ? id2 : `${_QAItem.id()}`;
31291 this.update(props);
31292 if (service && typeof service.getIcon === "function") {
31293 this.icon = service.getIcon(itemType);
31297 const { loc, service, itemType, id: id2 } = this;
31298 Object.keys(props).forEach((prop) => this[prop] = props[prop]);
31300 this.service = service;
31301 this.itemType = itemType;
31305 // Generic handling for newly created QAItems
31307 return this.nextId--;
31310 QAItem.nextId = -1;
31312 // modules/actions/split.js
31313 function actionSplit(nodeIds, newWayIds) {
31314 if (typeof nodeIds === "string")
31315 nodeIds = [nodeIds];
31317 var _keepHistoryOn = "longest";
31318 var _createdWayIDs = [];
31319 function dist(graph, nA, nB) {
31320 var locA = graph.entity(nA).loc;
31321 var locB = graph.entity(nB).loc;
31322 var epsilon3 = 1e-6;
31323 return locA && locB ? geoSphericalDistance(locA, locB) : epsilon3;
31325 function splitArea(nodes, idxA, graph) {
31326 var lengths = new Array(nodes.length);
31331 function wrap2(index) {
31332 return utilWrap(index, nodes.length);
31335 for (i3 = wrap2(idxA + 1); i3 !== idxA; i3 = wrap2(i3 + 1)) {
31336 length += dist(graph, nodes[i3], nodes[wrap2(i3 - 1)]);
31337 lengths[i3] = length;
31340 for (i3 = wrap2(idxA - 1); i3 !== idxA; i3 = wrap2(i3 - 1)) {
31341 length += dist(graph, nodes[i3], nodes[wrap2(i3 + 1)]);
31342 if (length < lengths[i3]) {
31343 lengths[i3] = length;
31346 for (i3 = 0; i3 < nodes.length; i3++) {
31347 var cost = lengths[i3] / dist(graph, nodes[idxA], nodes[i3]);
31355 function totalLengthBetweenNodes(graph, nodes) {
31356 var totalLength = 0;
31357 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
31358 totalLength += dist(graph, nodes[i3], nodes[i3 + 1]);
31360 return totalLength;
31362 function split(graph, nodeId, wayA, newWayId) {
31363 var wayB = osmWay({ id: newWayId, tags: wayA.tags });
31364 var origNodes = wayA.nodes.slice();
31367 var isArea = wayA.isArea();
31368 var isOuter = osmIsOldMultipolygonOuterMember(wayA, graph);
31369 if (wayA.isClosed()) {
31370 var nodes = wayA.nodes.slice(0, -1);
31371 var idxA = nodes.indexOf(nodeId);
31372 var idxB = splitArea(nodes, idxA, graph);
31374 nodesA = nodes.slice(idxA).concat(nodes.slice(0, idxB + 1));
31375 nodesB = nodes.slice(idxB, idxA + 1);
31377 nodesA = nodes.slice(idxA, idxB + 1);
31378 nodesB = nodes.slice(idxB).concat(nodes.slice(0, idxA + 1));
31381 var idx = wayA.nodes.indexOf(nodeId, 1);
31382 nodesA = wayA.nodes.slice(0, idx + 1);
31383 nodesB = wayA.nodes.slice(idx);
31385 var lengthA = totalLengthBetweenNodes(graph, nodesA);
31386 var lengthB = totalLengthBetweenNodes(graph, nodesB);
31387 if (_keepHistoryOn === "longest" && lengthB > lengthA) {
31388 wayA = wayA.update({ nodes: nodesB });
31389 wayB = wayB.update({ nodes: nodesA });
31390 var temp = lengthA;
31394 wayA = wayA.update({ nodes: nodesA });
31395 wayB = wayB.update({ nodes: nodesB });
31397 if (wayA.tags.step_count) {
31398 var stepCount = Number(wayA.tags.step_count);
31399 if (stepCount && // ensure a number
31400 isFinite(stepCount) && // ensure positive
31401 stepCount > 0 && // ensure integer
31402 Math.round(stepCount) === stepCount) {
31403 var tagsA = Object.assign({}, wayA.tags);
31404 var tagsB = Object.assign({}, wayB.tags);
31405 var ratioA = lengthA / (lengthA + lengthB);
31406 var countA = Math.round(stepCount * ratioA);
31407 tagsA.step_count = countA.toString();
31408 tagsB.step_count = (stepCount - countA).toString();
31409 wayA = wayA.update({ tags: tagsA });
31410 wayB = wayB.update({ tags: tagsB });
31413 graph = graph.replace(wayA);
31414 graph = graph.replace(wayB);
31415 graph.parentRelations(wayA).forEach(function(relation) {
31417 if (relation.hasFromViaTo()) {
31418 var f3 = relation.memberByRole("from");
31419 var v2 = relation.membersByRole("via");
31420 var t2 = relation.memberByRole("to");
31422 if (f3.id === wayA.id || t2.id === wayA.id) {
31424 if (v2.length === 1 && v2[0].type === "node") {
31425 keepB = wayB.contains(v2[0].id);
31427 for (i3 = 0; i3 < v2.length; i3++) {
31428 if (v2[i3].type === "way") {
31429 var wayVia = graph.hasEntity(v2[i3].id);
31430 if (wayVia && utilArrayIntersection(wayB.nodes, wayVia.nodes).length) {
31438 relation = relation.replaceMember(wayA, wayB);
31439 graph = graph.replace(relation);
31442 for (i3 = 0; i3 < v2.length; i3++) {
31443 if (v2[i3].type === "way" && v2[i3].id === wayA.id) {
31449 graph = actionAddMember(relation.id, member, v2[i3].index + 1)(graph);
31455 if (relation === isOuter) {
31456 graph = graph.replace(relation.mergeTags(wayA.tags));
31457 graph = graph.replace(wayA.update({ tags: {} }));
31458 graph = graph.replace(wayB.update({ tags: {} }));
31463 role: relation.memberById(wayA.id).role
31466 originalID: wayA.id,
31467 insertedID: wayB.id,
31470 graph = actionAddMember(relation.id, member, void 0, insertPair)(graph);
31473 if (!isOuter && isArea) {
31474 var multipolygon = osmRelation({
31475 tags: Object.assign({}, wayA.tags, { type: "multipolygon" }),
31477 { id: wayA.id, role: "outer", type: "way" },
31478 { id: wayB.id, role: "outer", type: "way" }
31481 graph = graph.replace(multipolygon);
31482 graph = graph.replace(wayA.update({ tags: {} }));
31483 graph = graph.replace(wayB.update({ tags: {} }));
31485 _createdWayIDs.push(wayB.id);
31488 var action = function(graph) {
31489 _createdWayIDs = [];
31490 var newWayIndex = 0;
31491 for (var i3 = 0; i3 < nodeIds.length; i3++) {
31492 var nodeId = nodeIds[i3];
31493 var candidates = action.waysForNode(nodeId, graph);
31494 for (var j3 = 0; j3 < candidates.length; j3++) {
31495 graph = split(graph, nodeId, candidates[j3], newWayIds && newWayIds[newWayIndex]);
31501 action.getCreatedWayIDs = function() {
31502 return _createdWayIDs;
31504 action.waysForNode = function(nodeId, graph) {
31505 var node = graph.entity(nodeId);
31506 var splittableParents = graph.parentWays(node).filter(isSplittable);
31508 var hasLine = splittableParents.some(function(parent) {
31509 return parent.geometry(graph) === "line";
31512 return splittableParents.filter(function(parent) {
31513 return parent.geometry(graph) === "line";
31517 return splittableParents;
31518 function isSplittable(parent) {
31519 if (_wayIDs && _wayIDs.indexOf(parent.id) === -1)
31521 if (parent.isClosed())
31523 for (var i3 = 1; i3 < parent.nodes.length - 1; i3++) {
31524 if (parent.nodes[i3] === nodeId)
31530 action.ways = function(graph) {
31531 return utilArrayUniq([].concat.apply([], nodeIds.map(function(nodeId) {
31532 return action.waysForNode(nodeId, graph);
31535 action.disabled = function(graph) {
31536 for (var i3 = 0; i3 < nodeIds.length; i3++) {
31537 var nodeId = nodeIds[i3];
31538 var candidates = action.waysForNode(nodeId, graph);
31539 if (candidates.length === 0 || _wayIDs && _wayIDs.length !== candidates.length) {
31540 return "not_eligible";
31544 action.limitWays = function(val) {
31545 if (!arguments.length)
31550 action.keepHistoryOn = function(val) {
31551 if (!arguments.length)
31552 return _keepHistoryOn;
31553 _keepHistoryOn = val;
31559 // modules/core/graph.js
31560 function coreGraph(other, mutable) {
31561 if (!(this instanceof coreGraph))
31562 return new coreGraph(other, mutable);
31563 if (other instanceof coreGraph) {
31564 var base = other.base();
31565 this.entities = Object.assign(Object.create(base.entities), other.entities);
31566 this._parentWays = Object.assign(Object.create(base.parentWays), other._parentWays);
31567 this._parentRels = Object.assign(Object.create(base.parentRels), other._parentRels);
31569 this.entities = /* @__PURE__ */ Object.create({});
31570 this._parentWays = /* @__PURE__ */ Object.create({});
31571 this._parentRels = /* @__PURE__ */ Object.create({});
31572 this.rebase(other || [], [this]);
31574 this.transients = {};
31575 this._childNodes = {};
31576 this.frozen = !mutable;
31578 coreGraph.prototype = {
31579 hasEntity: function(id2) {
31580 return this.entities[id2];
31582 entity: function(id2) {
31583 var entity = this.entities[id2];
31585 entity = this.entities.__proto__[id2];
31588 throw new Error("entity " + id2 + " not found");
31592 geometry: function(id2) {
31593 return this.entity(id2).geometry(this);
31595 transient: function(entity, key, fn) {
31596 var id2 = entity.id;
31597 var transients = this.transients[id2] || (this.transients[id2] = {});
31598 if (transients[key] !== void 0) {
31599 return transients[key];
31601 transients[key] = fn.call(entity);
31602 return transients[key];
31604 parentWays: function(entity) {
31605 var parents = this._parentWays[entity.id];
31608 parents.forEach(function(id2) {
31609 result.push(this.entity(id2));
31614 isPoi: function(entity) {
31615 var parents = this._parentWays[entity.id];
31616 return !parents || parents.size === 0;
31618 isShared: function(entity) {
31619 var parents = this._parentWays[entity.id];
31620 return parents && parents.size > 1;
31622 parentRelations: function(entity) {
31623 var parents = this._parentRels[entity.id];
31626 parents.forEach(function(id2) {
31627 result.push(this.entity(id2));
31632 parentMultipolygons: function(entity) {
31633 return this.parentRelations(entity).filter(function(relation) {
31634 return relation.isMultipolygon();
31637 childNodes: function(entity) {
31638 if (this._childNodes[entity.id])
31639 return this._childNodes[entity.id];
31643 for (var i3 = 0; i3 < entity.nodes.length; i3++) {
31644 nodes[i3] = this.entity(entity.nodes[i3]);
31647 Object.freeze(nodes);
31648 this._childNodes[entity.id] = nodes;
31649 return this._childNodes[entity.id];
31653 "entities": Object.getPrototypeOf(this.entities),
31654 "parentWays": Object.getPrototypeOf(this._parentWays),
31655 "parentRels": Object.getPrototypeOf(this._parentRels)
31658 // Unlike other graph methods, rebase mutates in place. This is because it
31659 // is used only during the history operation that merges newly downloaded
31660 // data into each state. To external consumers, it should appear as if the
31661 // graph always contained the newly downloaded data.
31662 rebase: function(entities, stack, force) {
31663 var base = this.base();
31664 var i3, j3, k2, id2;
31665 for (i3 = 0; i3 < entities.length; i3++) {
31666 var entity = entities[i3];
31667 if (!entity.visible || !force && base.entities[entity.id])
31669 base.entities[entity.id] = entity;
31670 this._updateCalculated(void 0, entity, base.parentWays, base.parentRels);
31671 if (entity.type === "way") {
31672 for (j3 = 0; j3 < entity.nodes.length; j3++) {
31673 id2 = entity.nodes[j3];
31674 for (k2 = 1; k2 < stack.length; k2++) {
31675 var ents = stack[k2].entities;
31676 if (ents.hasOwnProperty(id2) && ents[id2] === void 0) {
31683 for (i3 = 0; i3 < stack.length; i3++) {
31684 stack[i3]._updateRebased();
31687 _updateRebased: function() {
31688 var base = this.base();
31689 Object.keys(this._parentWays).forEach(function(child) {
31690 if (base.parentWays[child]) {
31691 base.parentWays[child].forEach(function(id2) {
31692 if (!this.entities.hasOwnProperty(id2)) {
31693 this._parentWays[child].add(id2);
31698 Object.keys(this._parentRels).forEach(function(child) {
31699 if (base.parentRels[child]) {
31700 base.parentRels[child].forEach(function(id2) {
31701 if (!this.entities.hasOwnProperty(id2)) {
31702 this._parentRels[child].add(id2);
31707 this.transients = {};
31709 // Updates calculated properties (parentWays, parentRels) for the specified change
31710 _updateCalculated: function(oldentity, entity, parentWays, parentRels) {
31711 parentWays = parentWays || this._parentWays;
31712 parentRels = parentRels || this._parentRels;
31713 var type2 = entity && entity.type || oldentity && oldentity.type;
31714 var removed, added, i3;
31715 if (type2 === "way") {
31716 if (oldentity && entity) {
31717 removed = utilArrayDifference(oldentity.nodes, entity.nodes);
31718 added = utilArrayDifference(entity.nodes, oldentity.nodes);
31719 } else if (oldentity) {
31720 removed = oldentity.nodes;
31722 } else if (entity) {
31724 added = entity.nodes;
31726 for (i3 = 0; i3 < removed.length; i3++) {
31727 parentWays[removed[i3]] = new Set(parentWays[removed[i3]]);
31728 parentWays[removed[i3]].delete(oldentity.id);
31730 for (i3 = 0; i3 < added.length; i3++) {
31731 parentWays[added[i3]] = new Set(parentWays[added[i3]]);
31732 parentWays[added[i3]].add(entity.id);
31734 } else if (type2 === "relation") {
31735 var oldentityMemberIDs = oldentity ? oldentity.members.map(function(m2) {
31738 var entityMemberIDs = entity ? entity.members.map(function(m2) {
31741 if (oldentity && entity) {
31742 removed = utilArrayDifference(oldentityMemberIDs, entityMemberIDs);
31743 added = utilArrayDifference(entityMemberIDs, oldentityMemberIDs);
31744 } else if (oldentity) {
31745 removed = oldentityMemberIDs;
31747 } else if (entity) {
31749 added = entityMemberIDs;
31751 for (i3 = 0; i3 < removed.length; i3++) {
31752 parentRels[removed[i3]] = new Set(parentRels[removed[i3]]);
31753 parentRels[removed[i3]].delete(oldentity.id);
31755 for (i3 = 0; i3 < added.length; i3++) {
31756 parentRels[added[i3]] = new Set(parentRels[added[i3]]);
31757 parentRels[added[i3]].add(entity.id);
31761 replace: function(entity) {
31762 if (this.entities[entity.id] === entity)
31764 return this.update(function() {
31765 this._updateCalculated(this.entities[entity.id], entity);
31766 this.entities[entity.id] = entity;
31769 remove: function(entity) {
31770 return this.update(function() {
31771 this._updateCalculated(entity, void 0);
31772 this.entities[entity.id] = void 0;
31775 revert: function(id2) {
31776 var baseEntity = this.base().entities[id2];
31777 var headEntity = this.entities[id2];
31778 if (headEntity === baseEntity)
31780 return this.update(function() {
31781 this._updateCalculated(headEntity, baseEntity);
31782 delete this.entities[id2];
31785 update: function() {
31786 var graph = this.frozen ? coreGraph(this, true) : this;
31787 for (var i3 = 0; i3 < arguments.length; i3++) {
31788 arguments[i3].call(graph, graph);
31791 graph.frozen = true;
31794 // Obliterates any existing entities
31795 load: function(entities) {
31796 var base = this.base();
31797 this.entities = Object.create(base.entities);
31798 for (var i3 in entities) {
31799 this.entities[i3] = entities[i3];
31800 this._updateCalculated(base.entities[i3], this.entities[i3]);
31806 // modules/osm/intersection.js
31807 function osmTurn(turn) {
31808 if (!(this instanceof osmTurn)) {
31809 return new osmTurn(turn);
31811 Object.assign(this, turn);
31813 function osmIntersection(graph, startVertexId, maxDistance) {
31814 maxDistance = maxDistance || 30;
31815 var vgraph = coreGraph();
31817 function memberOfRestriction(entity) {
31818 return graph.parentRelations(entity).some(function(r2) {
31819 return r2.isRestriction();
31822 function isRoad(way2) {
31823 if (way2.isArea() || way2.isDegenerate())
31827 "motorway_link": true,
31829 "trunk_link": true,
31831 "primary_link": true,
31833 "secondary_link": true,
31835 "tertiary_link": true,
31836 "residential": true,
31837 "unclassified": true,
31838 "living_street": true,
31843 return roads[way2.tags.highway];
31845 var startNode = graph.entity(startVertexId);
31846 var checkVertices = [startNode];
31849 var vertexIds = [];
31859 while (checkVertices.length) {
31860 vertex = checkVertices.pop();
31861 checkWays = graph.parentWays(vertex);
31862 var hasWays = false;
31863 for (i3 = 0; i3 < checkWays.length; i3++) {
31864 way = checkWays[i3];
31865 if (!isRoad(way) && !memberOfRestriction(way))
31869 nodes = utilArrayUniq(graph.childNodes(way));
31870 for (j3 = 0; j3 < nodes.length; j3++) {
31872 if (node === vertex)
31874 if (vertices.indexOf(node) !== -1)
31876 if (geoSphericalDistance(node.loc, startNode.loc) > maxDistance)
31878 var hasParents = false;
31879 parents = graph.parentWays(node);
31880 for (k2 = 0; k2 < parents.length; k2++) {
31881 parent = parents[k2];
31882 if (parent === way)
31884 if (ways.indexOf(parent) !== -1)
31886 if (!isRoad(parent))
31892 checkVertices.push(node);
31897 vertices.push(vertex);
31900 vertices = utilArrayUniq(vertices);
31901 ways = utilArrayUniq(ways);
31902 ways.forEach(function(way2) {
31903 graph.childNodes(way2).forEach(function(node2) {
31904 vgraph = vgraph.replace(node2);
31906 vgraph = vgraph.replace(way2);
31907 graph.parentRelations(way2).forEach(function(relation) {
31908 if (relation.isRestriction()) {
31909 if (relation.isValidRestriction(graph)) {
31910 vgraph = vgraph.replace(relation);
31911 } else if (relation.isComplete(graph)) {
31912 actions.push(actionDeleteRelation(relation.id));
31917 ways.forEach(function(w2) {
31918 var way2 = vgraph.entity(w2.id);
31919 if (way2.tags.oneway === "-1") {
31920 var action = actionReverse(way2.id, { reverseOneway: true });
31921 actions.push(action);
31922 vgraph = action(vgraph);
31925 var origCount = osmEntity.id.next.way;
31926 vertices.forEach(function(v2) {
31927 var splitAll = actionSplit([v2.id]).keepHistoryOn("first");
31928 if (!splitAll.disabled(vgraph)) {
31929 splitAll.ways(vgraph).forEach(function(way2) {
31930 var splitOne = actionSplit([v2.id]).limitWays([way2.id]).keepHistoryOn("first");
31931 actions.push(splitOne);
31932 vgraph = splitOne(vgraph);
31936 osmEntity.id.next.way = origCount;
31937 vertexIds = vertices.map(function(v2) {
31942 vertexIds.forEach(function(id2) {
31943 var vertex2 = vgraph.entity(id2);
31944 var parents2 = vgraph.parentWays(vertex2);
31945 vertices.push(vertex2);
31946 ways = ways.concat(parents2);
31948 vertices = utilArrayUniq(vertices);
31949 ways = utilArrayUniq(ways);
31950 vertexIds = vertices.map(function(v2) {
31953 wayIds = ways.map(function(w2) {
31956 function withMetadata(way2, vertexIds2) {
31957 var __oneWay = way2.isOneWay();
31958 var __first = vertexIds2.indexOf(way2.first()) !== -1;
31959 var __last = vertexIds2.indexOf(way2.last()) !== -1;
31960 var __via = __first && __last;
31961 var __from = __first && !__oneWay || __last;
31962 var __to = __first || __last && !__oneWay;
31963 return way2.update({
31973 wayIds.forEach(function(id2) {
31974 var way2 = withMetadata(vgraph.entity(id2), vertexIds);
31975 vgraph = vgraph.replace(way2);
31979 var removeWayIds = [];
31980 var removeVertexIds = [];
31983 checkVertices = vertexIds.slice();
31984 for (i3 = 0; i3 < checkVertices.length; i3++) {
31985 var vertexId = checkVertices[i3];
31986 vertex = vgraph.hasEntity(vertexId);
31988 if (vertexIds.indexOf(vertexId) !== -1) {
31989 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
31991 removeVertexIds.push(vertexId);
31994 parents = vgraph.parentWays(vertex);
31995 if (parents.length < 3) {
31996 if (vertexIds.indexOf(vertexId) !== -1) {
31997 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
32000 if (parents.length === 2) {
32001 var a2 = parents[0];
32002 var b2 = parents[1];
32003 var aIsLeaf = a2 && !a2.__via;
32004 var bIsLeaf = b2 && !b2.__via;
32005 var leaf, survivor;
32006 if (aIsLeaf && !bIsLeaf) {
32009 } else if (!aIsLeaf && bIsLeaf) {
32013 if (leaf && survivor) {
32014 survivor = withMetadata(survivor, vertexIds);
32015 vgraph = vgraph.replace(survivor).remove(leaf);
32016 removeWayIds.push(leaf.id);
32020 parents = vgraph.parentWays(vertex);
32021 if (parents.length < 2) {
32022 if (vertexIds.indexOf(vertexId) !== -1) {
32023 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
32025 removeVertexIds.push(vertexId);
32028 if (parents.length < 1) {
32029 vgraph = vgraph.remove(vertex);
32032 } while (keepGoing);
32033 vertices = vertices.filter(function(vertex2) {
32034 return removeVertexIds.indexOf(vertex2.id) === -1;
32035 }).map(function(vertex2) {
32036 return vgraph.entity(vertex2.id);
32038 ways = ways.filter(function(way2) {
32039 return removeWayIds.indexOf(way2.id) === -1;
32040 }).map(function(way2) {
32041 return vgraph.entity(way2.id);
32043 var intersection = {
32049 intersection.turns = function(fromWayId, maxViaWay) {
32054 var vgraph2 = intersection.graph;
32055 var keyVertexIds = intersection.vertices.map(function(v2) {
32058 var start2 = vgraph2.entity(fromWayId);
32059 if (!start2 || !(start2.__from || start2.__via))
32061 var maxPathLength = maxViaWay * 2 + 3;
32065 function step(entity, currPath, currRestrictions, matchedRestriction) {
32066 currPath = (currPath || []).slice();
32067 if (currPath.length >= maxPathLength)
32069 currPath.push(entity.id);
32070 currRestrictions = (currRestrictions || []).slice();
32071 if (entity.type === "node") {
32072 stepNode(entity, currPath, currRestrictions);
32074 stepWay(entity, currPath, currRestrictions, matchedRestriction);
32077 function stepNode(entity, currPath, currRestrictions) {
32079 var parents2 = vgraph2.parentWays(entity);
32081 for (i4 = 0; i4 < parents2.length; i4++) {
32082 var way2 = parents2[i4];
32083 if (way2.__oneWay && way2.nodes[0] !== entity.id)
32085 if (currPath.indexOf(way2.id) !== -1 && currPath.length >= 3)
32087 var restrict = null;
32088 for (j4 = 0; j4 < currRestrictions.length; j4++) {
32089 var restriction = currRestrictions[j4];
32090 var f3 = restriction.memberByRole("from");
32091 var v2 = restriction.membersByRole("via");
32092 var t2 = restriction.memberByRole("to");
32093 var isNo = /^no_/.test(restriction.tags.restriction);
32094 var isOnly = /^only_/.test(restriction.tags.restriction);
32095 if (!(isNo || isOnly)) {
32098 var matchesFrom = f3.id === fromWayId;
32099 var matchesViaTo = false;
32100 var isAlongOnlyPath = false;
32101 if (t2.id === way2.id) {
32102 if (v2.length === 1 && v2[0].type === "node") {
32103 matchesViaTo = v2[0].id === entity.id && (matchesFrom && currPath.length === 2 || !matchesFrom && currPath.length > 2);
32106 for (k2 = 2; k2 < currPath.length; k2 += 2) {
32107 pathVias.push(currPath[k2]);
32109 var restrictionVias = [];
32110 for (k2 = 0; k2 < v2.length; k2++) {
32111 if (v2[k2].type === "way") {
32112 restrictionVias.push(v2[k2].id);
32115 var diff = utilArrayDifference(pathVias, restrictionVias);
32116 matchesViaTo = !diff.length;
32118 } else if (isOnly) {
32119 for (k2 = 0; k2 < v2.length; k2++) {
32120 if (v2[k2].type === "way" && v2[k2].id === way2.id) {
32121 isAlongOnlyPath = true;
32126 if (matchesViaTo) {
32128 restrict = { id: restriction.id, direct: matchesFrom, from: f3.id, only: true, end: true };
32130 restrict = { id: restriction.id, direct: matchesFrom, from: f3.id, no: true, end: true };
32133 if (isAlongOnlyPath) {
32134 restrict = { id: restriction.id, direct: false, from: f3.id, only: true, end: false };
32135 } else if (isOnly) {
32136 restrict = { id: restriction.id, direct: false, from: f3.id, no: true, end: true };
32139 if (restrict && restrict.direct)
32142 nextWays.push({ way: way2, restrict });
32144 nextWays.forEach(function(nextWay) {
32145 step(nextWay.way, currPath, currRestrictions, nextWay.restrict);
32148 function stepWay(entity, currPath, currRestrictions, matchedRestriction) {
32150 if (currPath.length >= 3) {
32151 var turnPath = currPath.slice();
32152 if (matchedRestriction && matchedRestriction.direct === false) {
32153 for (i4 = 0; i4 < turnPath.length; i4++) {
32154 if (turnPath[i4] === matchedRestriction.from) {
32155 turnPath = turnPath.slice(i4);
32160 var turn = pathToTurn(turnPath);
32162 if (matchedRestriction) {
32163 turn.restrictionID = matchedRestriction.id;
32164 turn.no = matchedRestriction.no;
32165 turn.only = matchedRestriction.only;
32166 turn.direct = matchedRestriction.direct;
32168 turns.push(osmTurn(turn));
32170 if (currPath[0] === currPath[2])
32173 if (matchedRestriction && matchedRestriction.end)
32175 var n1 = vgraph2.entity(entity.first());
32176 var n22 = vgraph2.entity(entity.last());
32177 var dist = geoSphericalDistance(n1.loc, n22.loc);
32178 var nextNodes = [];
32179 if (currPath.length > 1) {
32180 if (dist > maxDistance)
32185 if (!entity.__oneWay && // bidirectional..
32186 keyVertexIds.indexOf(n1.id) !== -1 && // key vertex..
32187 currPath.indexOf(n1.id) === -1) {
32188 nextNodes.push(n1);
32190 if (keyVertexIds.indexOf(n22.id) !== -1 && // key vertex..
32191 currPath.indexOf(n22.id) === -1) {
32192 nextNodes.push(n22);
32194 nextNodes.forEach(function(nextNode) {
32195 var fromRestrictions = vgraph2.parentRelations(entity).filter(function(r2) {
32196 if (!r2.isRestriction())
32198 var f3 = r2.memberByRole("from");
32199 if (!f3 || f3.id !== entity.id)
32201 var isOnly = /^only_/.test(r2.tags.restriction);
32204 var isOnlyVia = false;
32205 var v2 = r2.membersByRole("via");
32206 if (v2.length === 1 && v2[0].type === "node") {
32207 isOnlyVia = v2[0].id === nextNode.id;
32209 for (var i5 = 0; i5 < v2.length; i5++) {
32210 if (v2[i5].type !== "way")
32212 var viaWay = vgraph2.entity(v2[i5].id);
32213 if (viaWay.first() === nextNode.id || viaWay.last() === nextNode.id) {
32221 step(nextNode, currPath, currRestrictions.concat(fromRestrictions), false);
32224 function pathToTurn(path) {
32225 if (path.length < 3)
32227 var fromWayId2, fromNodeId, fromVertexId;
32228 var toWayId, toNodeId, toVertexId;
32229 var viaWayIds, viaNodeId, isUturn;
32230 fromWayId2 = path[0];
32231 toWayId = path[path.length - 1];
32232 if (path.length === 3 && fromWayId2 === toWayId) {
32233 var way2 = vgraph2.entity(fromWayId2);
32237 viaNodeId = fromVertexId = toVertexId = path[1];
32238 fromNodeId = toNodeId = adjacentNode(fromWayId2, viaNodeId);
32241 fromVertexId = path[1];
32242 fromNodeId = adjacentNode(fromWayId2, fromVertexId);
32243 toVertexId = path[path.length - 2];
32244 toNodeId = adjacentNode(toWayId, toVertexId);
32245 if (path.length === 3) {
32246 viaNodeId = path[1];
32248 viaWayIds = path.filter(function(entityId) {
32249 return entityId[0] === "w";
32251 viaWayIds = viaWayIds.slice(1, viaWayIds.length - 1);
32255 key: path.join("_"),
32257 from: { node: fromNodeId, way: fromWayId2, vertex: fromVertexId },
32258 via: { node: viaNodeId, ways: viaWayIds },
32259 to: { node: toNodeId, way: toWayId, vertex: toVertexId },
32262 function adjacentNode(wayId, affixId) {
32263 var nodes2 = vgraph2.entity(wayId).nodes;
32264 return affixId === nodes2[0] ? nodes2[1] : nodes2[nodes2.length - 2];
32268 return intersection;
32270 function osmInferRestriction(graph, turn, projection2) {
32271 var fromWay = graph.entity(turn.from.way);
32272 var fromNode = graph.entity(turn.from.node);
32273 var fromVertex = graph.entity(turn.from.vertex);
32274 var toWay = graph.entity(turn.to.way);
32275 var toNode = graph.entity(turn.to.node);
32276 var toVertex = graph.entity(turn.to.vertex);
32277 var fromOneWay = fromWay.tags.oneway === "yes";
32278 var toOneWay = toWay.tags.oneway === "yes";
32279 var angle2 = (geoAngle(fromVertex, fromNode, projection2) - geoAngle(toVertex, toNode, projection2)) * 180 / Math.PI;
32280 while (angle2 < 0) {
32283 if (fromNode === toNode) {
32284 return "no_u_turn";
32286 if ((angle2 < 23 || angle2 > 336) && fromOneWay && toOneWay) {
32287 return "no_u_turn";
32289 if ((angle2 < 40 || angle2 > 319) && fromOneWay && toOneWay && turn.from.vertex !== turn.to.vertex) {
32290 return "no_u_turn";
32292 if (angle2 < 158) {
32293 return "no_right_turn";
32295 if (angle2 > 202) {
32296 return "no_left_turn";
32298 return "no_straight_on";
32301 // modules/actions/merge_polygon.js
32302 function actionMergePolygon(ids, newRelationId) {
32303 function groupEntities(graph) {
32304 var entities = ids.map(function(id2) {
32305 return graph.entity(id2);
32307 var geometryGroups = utilArrayGroupBy(entities, function(entity) {
32308 if (entity.type === "way" && entity.isClosed()) {
32309 return "closedWay";
32310 } else if (entity.type === "relation" && entity.isMultipolygon()) {
32311 return "multipolygon";
32316 return Object.assign(
32317 { closedWay: [], multipolygon: [], other: [] },
32321 var action = function(graph) {
32322 var entities = groupEntities(graph);
32323 var polygons = entities.multipolygon.reduce(function(polygons2, m2) {
32324 return polygons2.concat(osmJoinWays(m2.members, graph));
32325 }, []).concat(entities.closedWay.map(function(d2) {
32326 var member = [{ id: d2.id }];
32327 member.nodes = graph.childNodes(d2);
32330 var contained = polygons.map(function(w2, i3) {
32331 return polygons.map(function(d2, n3) {
32334 return geoPolygonContainsPolygon(
32335 d2.nodes.map(function(n4) {
32338 w2.nodes.map(function(n4) {
32346 while (polygons.length) {
32347 extractUncontained(polygons);
32348 polygons = polygons.filter(isContained);
32349 contained = contained.filter(isContained).map(filterContained);
32351 function isContained(d2, i3) {
32352 return contained[i3].some(function(val) {
32356 function filterContained(d2) {
32357 return d2.filter(isContained);
32359 function extractUncontained(polygons2) {
32360 polygons2.forEach(function(d2, i3) {
32361 if (!isContained(d2, i3)) {
32362 d2.forEach(function(member) {
32366 role: outer ? "outer" : "inner"
32374 if (entities.multipolygon.length > 0) {
32375 var oldestID = utilOldestID(entities.multipolygon.map((entity) => entity.id));
32376 relation = entities.multipolygon.find((entity) => entity.id === oldestID);
32378 relation = osmRelation({ id: newRelationId, tags: { type: "multipolygon" } });
32380 entities.multipolygon.forEach(function(m2) {
32381 if (m2.id !== relation.id) {
32382 relation = relation.mergeTags(m2.tags);
32383 graph = graph.remove(m2);
32386 entities.closedWay.forEach(function(way) {
32387 function isThisOuter(m2) {
32388 return m2.id === way.id && m2.role !== "inner";
32390 if (members.some(isThisOuter)) {
32391 relation = relation.mergeTags(way.tags);
32392 graph = graph.replace(way.update({ tags: {} }));
32395 return graph.replace(relation.update({
32397 tags: utilObjectOmit(relation.tags, ["area"])
32400 action.disabled = function(graph) {
32401 var entities = groupEntities(graph);
32402 if (entities.other.length > 0 || entities.closedWay.length + entities.multipolygon.length < 2) {
32403 return "not_eligible";
32405 if (!entities.multipolygon.every(function(r2) {
32406 return r2.isComplete(graph);
32408 return "incomplete_relation";
32410 if (!entities.multipolygon.length) {
32411 var sharedMultipolygons = [];
32412 entities.closedWay.forEach(function(way, i3) {
32414 sharedMultipolygons = graph.parentMultipolygons(way);
32416 sharedMultipolygons = utilArrayIntersection(sharedMultipolygons, graph.parentMultipolygons(way));
32419 sharedMultipolygons = sharedMultipolygons.filter(function(relation) {
32420 return relation.members.length === entities.closedWay.length;
32422 if (sharedMultipolygons.length) {
32423 return "not_eligible";
32425 } else if (entities.closedWay.some(function(way) {
32426 return utilArrayIntersection(graph.parentMultipolygons(way), entities.multipolygon).length;
32428 return "not_eligible";
32434 // modules/actions/merge_remote_changes.js
32435 var import_fast_deep_equal = __toESM(require_fast_deep_equal());
32437 // node_modules/node-diff3/index.mjs
32438 function LCS(buffer1, buffer2) {
32439 let equivalenceClasses = {};
32440 for (let j3 = 0; j3 < buffer2.length; j3++) {
32441 const item = buffer2[j3];
32442 if (equivalenceClasses[item]) {
32443 equivalenceClasses[item].push(j3);
32445 equivalenceClasses[item] = [j3];
32448 const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
32449 let candidates = [NULLRESULT];
32450 for (let i3 = 0; i3 < buffer1.length; i3++) {
32451 const item = buffer1[i3];
32452 const buffer2indices = equivalenceClasses[item] || [];
32454 let c2 = candidates[0];
32455 for (let jx = 0; jx < buffer2indices.length; jx++) {
32456 const j3 = buffer2indices[jx];
32458 for (s2 = r2; s2 < candidates.length; s2++) {
32459 if (candidates[s2].buffer2index < j3 && (s2 === candidates.length - 1 || candidates[s2 + 1].buffer2index > j3)) {
32463 if (s2 < candidates.length) {
32464 const newCandidate = { buffer1index: i3, buffer2index: j3, chain: candidates[s2] };
32465 if (r2 === candidates.length) {
32466 candidates.push(c2);
32468 candidates[r2] = c2;
32472 if (r2 === candidates.length) {
32477 candidates[r2] = c2;
32479 return candidates[candidates.length - 1];
32481 function diffIndices(buffer1, buffer2) {
32482 const lcs = LCS(buffer1, buffer2);
32484 let tail1 = buffer1.length;
32485 let tail2 = buffer2.length;
32486 for (let candidate = lcs; candidate !== null; candidate = candidate.chain) {
32487 const mismatchLength1 = tail1 - candidate.buffer1index - 1;
32488 const mismatchLength2 = tail2 - candidate.buffer2index - 1;
32489 tail1 = candidate.buffer1index;
32490 tail2 = candidate.buffer2index;
32491 if (mismatchLength1 || mismatchLength2) {
32493 buffer1: [tail1 + 1, mismatchLength1],
32494 buffer1Content: buffer1.slice(tail1 + 1, tail1 + 1 + mismatchLength1),
32495 buffer2: [tail2 + 1, mismatchLength2],
32496 buffer2Content: buffer2.slice(tail2 + 1, tail2 + 1 + mismatchLength2)
32503 function diff3MergeRegions(a2, o2, b2) {
32505 function addHunk(h2, ab) {
32508 oStart: h2.buffer1[0],
32509 oLength: h2.buffer1[1],
32510 // length of o to remove
32511 abStart: h2.buffer2[0],
32512 abLength: h2.buffer2[1]
32513 // length of a/b to insert
32514 // abContent: (ab === 'a' ? a : b).slice(h.buffer2[0], h.buffer2[0] + h.buffer2[1])
32517 diffIndices(o2, a2).forEach((item) => addHunk(item, "a"));
32518 diffIndices(o2, b2).forEach((item) => addHunk(item, "b"));
32519 hunks.sort((x2, y2) => x2.oStart - y2.oStart);
32521 let currOffset = 0;
32522 function advanceTo(endOffset) {
32523 if (endOffset > currOffset) {
32527 bufferStart: currOffset,
32528 bufferLength: endOffset - currOffset,
32529 bufferContent: o2.slice(currOffset, endOffset)
32531 currOffset = endOffset;
32534 while (hunks.length) {
32535 let hunk = hunks.shift();
32536 let regionStart = hunk.oStart;
32537 let regionEnd = hunk.oStart + hunk.oLength;
32538 let regionHunks = [hunk];
32539 advanceTo(regionStart);
32540 while (hunks.length) {
32541 const nextHunk = hunks[0];
32542 const nextHunkStart = nextHunk.oStart;
32543 if (nextHunkStart > regionEnd)
32545 regionEnd = Math.max(regionEnd, nextHunkStart + nextHunk.oLength);
32546 regionHunks.push(hunks.shift());
32548 if (regionHunks.length === 1) {
32549 if (hunk.abLength > 0) {
32550 const buffer = hunk.ab === "a" ? a2 : b2;
32554 bufferStart: hunk.abStart,
32555 bufferLength: hunk.abLength,
32556 bufferContent: buffer.slice(hunk.abStart, hunk.abStart + hunk.abLength)
32561 a: [a2.length, -1, o2.length, -1],
32562 b: [b2.length, -1, o2.length, -1]
32564 while (regionHunks.length) {
32565 hunk = regionHunks.shift();
32566 const oStart = hunk.oStart;
32567 const oEnd = oStart + hunk.oLength;
32568 const abStart = hunk.abStart;
32569 const abEnd = abStart + hunk.abLength;
32570 let b3 = bounds[hunk.ab];
32571 b3[0] = Math.min(abStart, b3[0]);
32572 b3[1] = Math.max(abEnd, b3[1]);
32573 b3[2] = Math.min(oStart, b3[2]);
32574 b3[3] = Math.max(oEnd, b3[3]);
32576 const aStart = bounds.a[0] + (regionStart - bounds.a[2]);
32577 const aEnd = bounds.a[1] + (regionEnd - bounds.a[3]);
32578 const bStart = bounds.b[0] + (regionStart - bounds.b[2]);
32579 const bEnd = bounds.b[1] + (regionEnd - bounds.b[3]);
32583 aLength: aEnd - aStart,
32584 aContent: a2.slice(aStart, aEnd),
32585 oStart: regionStart,
32586 oLength: regionEnd - regionStart,
32587 oContent: o2.slice(regionStart, regionEnd),
32589 bLength: bEnd - bStart,
32590 bContent: b2.slice(bStart, bEnd)
32592 results.push(result);
32594 currOffset = regionEnd;
32596 advanceTo(o2.length);
32599 function diff3Merge(a2, o2, b2, options2) {
32601 excludeFalseConflicts: true,
32602 stringSeparator: /\s+/
32604 options2 = Object.assign(defaults, options2);
32605 if (typeof a2 === "string")
32606 a2 = a2.split(options2.stringSeparator);
32607 if (typeof o2 === "string")
32608 o2 = o2.split(options2.stringSeparator);
32609 if (typeof b2 === "string")
32610 b2 = b2.split(options2.stringSeparator);
32612 const regions = diff3MergeRegions(a2, o2, b2);
32614 function flushOk() {
32615 if (okBuffer.length) {
32616 results.push({ ok: okBuffer });
32620 function isFalseConflict(a3, b3) {
32621 if (a3.length !== b3.length)
32623 for (let i3 = 0; i3 < a3.length; i3++) {
32624 if (a3[i3] !== b3[i3])
32629 regions.forEach((region) => {
32630 if (region.stable) {
32631 okBuffer.push(...region.bufferContent);
32633 if (options2.excludeFalseConflicts && isFalseConflict(region.aContent, region.bContent)) {
32634 okBuffer.push(...region.aContent);
32639 a: region.aContent,
32640 aIndex: region.aStart,
32641 o: region.oContent,
32642 oIndex: region.oStart,
32643 b: region.bContent,
32644 bIndex: region.bStart
32654 // modules/actions/merge_remote_changes.js
32655 var import_lodash2 = __toESM(require_lodash());
32656 function actionMergeRemoteChanges(id2, localGraph, remoteGraph, discardTags, formatUser) {
32657 discardTags = discardTags || {};
32658 var _option = "safe";
32659 var _conflicts = [];
32660 function user(d2) {
32661 return typeof formatUser === "function" ? formatUser(d2) : (0, import_lodash2.escape)(d2);
32663 function mergeLocation(remote, target) {
32664 function pointEqual(a2, b2) {
32665 var epsilon3 = 1e-6;
32666 return Math.abs(a2[0] - b2[0]) < epsilon3 && Math.abs(a2[1] - b2[1]) < epsilon3;
32668 if (_option === "force_local" || pointEqual(target.loc, remote.loc)) {
32671 if (_option === "force_remote") {
32672 return target.update({ loc: remote.loc });
32674 _conflicts.push(_t.html("merge_remote_changes.conflict.location", { user: { html: user(remote.user) } }));
32677 function mergeNodes(base, remote, target) {
32678 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.nodes, remote.nodes)) {
32681 if (_option === "force_remote") {
32682 return target.update({ nodes: remote.nodes });
32684 var ccount = _conflicts.length;
32685 var o2 = base.nodes || [];
32686 var a2 = target.nodes || [];
32687 var b2 = remote.nodes || [];
32689 var hunks = diff3Merge(a2, o2, b2, { excludeFalseConflicts: true });
32690 for (var i3 = 0; i3 < hunks.length; i3++) {
32691 var hunk = hunks[i3];
32693 nodes.push.apply(nodes, hunk.ok);
32695 var c2 = hunk.conflict;
32696 if ((0, import_fast_deep_equal.default)(c2.o, c2.a)) {
32697 nodes.push.apply(nodes, c2.b);
32698 } else if ((0, import_fast_deep_equal.default)(c2.o, c2.b)) {
32699 nodes.push.apply(nodes, c2.a);
32701 _conflicts.push(_t.html("merge_remote_changes.conflict.nodelist", { user: { html: user(remote.user) } }));
32706 return _conflicts.length === ccount ? target.update({ nodes }) : target;
32708 function mergeChildren(targetWay, children2, updates, graph) {
32709 function isUsed(node2, targetWay2) {
32710 var hasInterestingParent = graph.parentWays(node2).some(function(way) {
32711 return way.id !== targetWay2.id;
32713 return node2.hasInterestingTags() || hasInterestingParent || graph.parentRelations(node2).length > 0;
32715 var ccount = _conflicts.length;
32716 for (var i3 = 0; i3 < children2.length; i3++) {
32717 var id3 = children2[i3];
32718 var node = graph.hasEntity(id3);
32719 if (targetWay.nodes.indexOf(id3) === -1) {
32720 if (node && !isUsed(node, targetWay)) {
32721 updates.removeIds.push(id3);
32725 var local = localGraph.hasEntity(id3);
32726 var remote = remoteGraph.hasEntity(id3);
32728 if (_option === "force_remote" && remote && remote.visible) {
32729 updates.replacements.push(remote);
32730 } else if (_option === "force_local" && local) {
32731 target = osmEntity(local);
32733 target = target.update({ version: remote.version });
32735 updates.replacements.push(target);
32736 } else if (_option === "safe" && local && remote && local.version !== remote.version) {
32737 target = osmEntity(local, { version: remote.version });
32738 if (remote.visible) {
32739 target = mergeLocation(remote, target);
32741 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
32743 if (_conflicts.length !== ccount)
32745 updates.replacements.push(target);
32750 function updateChildren(updates, graph) {
32751 for (var i3 = 0; i3 < updates.replacements.length; i3++) {
32752 graph = graph.replace(updates.replacements[i3]);
32754 if (updates.removeIds.length) {
32755 graph = actionDeleteMultiple(updates.removeIds)(graph);
32759 function mergeMembers(remote, target) {
32760 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.members, remote.members)) {
32763 if (_option === "force_remote") {
32764 return target.update({ members: remote.members });
32766 _conflicts.push(_t.html("merge_remote_changes.conflict.memberlist", { user: { html: user(remote.user) } }));
32769 function mergeTags(base, remote, target) {
32770 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.tags, remote.tags)) {
32773 if (_option === "force_remote") {
32774 return target.update({ tags: remote.tags });
32776 var ccount = _conflicts.length;
32777 var o2 = base.tags || {};
32778 var a2 = target.tags || {};
32779 var b2 = remote.tags || {};
32780 var keys2 = utilArrayUnion(utilArrayUnion(Object.keys(o2), Object.keys(a2)), Object.keys(b2)).filter(function(k3) {
32781 return !discardTags[k3];
32783 var tags = Object.assign({}, a2);
32784 var changed = false;
32785 for (var i3 = 0; i3 < keys2.length; i3++) {
32786 var k2 = keys2[i3];
32787 if (o2[k2] !== b2[k2] && a2[k2] !== b2[k2]) {
32788 if (o2[k2] !== a2[k2]) {
32789 _conflicts.push(_t.html(
32790 "merge_remote_changes.conflict.tags",
32791 { tag: k2, local: a2[k2], remote: b2[k2], user: { html: user(remote.user) } }
32794 if (b2.hasOwnProperty(k2)) {
32803 return changed && _conflicts.length === ccount ? target.update({ tags }) : target;
32805 var action = function(graph) {
32806 var updates = { replacements: [], removeIds: [] };
32807 var base = graph.base().entities[id2];
32808 var local = localGraph.entity(id2);
32809 var remote = remoteGraph.entity(id2);
32810 var target = osmEntity(local, { version: remote.version });
32811 if (!remote.visible) {
32812 if (_option === "force_remote") {
32813 return actionDeleteMultiple([id2])(graph);
32814 } else if (_option === "force_local") {
32815 if (target.type === "way") {
32816 target = mergeChildren(target, utilArrayUniq(local.nodes), updates, graph);
32817 graph = updateChildren(updates, graph);
32819 return graph.replace(target);
32821 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
32825 if (target.type === "node") {
32826 target = mergeLocation(remote, target);
32827 } else if (target.type === "way") {
32828 graph.rebase(remoteGraph.childNodes(remote), [graph], false);
32829 target = mergeNodes(base, remote, target);
32830 target = mergeChildren(target, utilArrayUnion(local.nodes, remote.nodes), updates, graph);
32831 } else if (target.type === "relation") {
32832 target = mergeMembers(remote, target);
32834 target = mergeTags(base, remote, target);
32835 if (!_conflicts.length) {
32836 graph = updateChildren(updates, graph).replace(target);
32840 action.withOption = function(opt) {
32844 action.conflicts = function() {
32850 // modules/actions/move.js
32851 function actionMove(moveIDs, tryDelta, projection2, cache) {
32852 var _delta = tryDelta;
32853 function setupCache(graph) {
32854 function canMove(nodeID) {
32855 if (moveIDs.indexOf(nodeID) !== -1)
32857 var parents = graph.parentWays(graph.entity(nodeID));
32858 if (parents.length < 3)
32860 var parentsMoving = parents.every(function(way) {
32861 return cache.moving[way.id];
32863 if (!parentsMoving)
32864 delete cache.moving[nodeID];
32865 return parentsMoving;
32867 function cacheEntities(ids) {
32868 for (var i3 = 0; i3 < ids.length; i3++) {
32870 if (cache.moving[id2])
32872 cache.moving[id2] = true;
32873 var entity = graph.hasEntity(id2);
32876 if (entity.type === "node") {
32877 cache.nodes.push(id2);
32878 cache.startLoc[id2] = entity.loc;
32879 } else if (entity.type === "way") {
32880 cache.ways.push(id2);
32881 cacheEntities(entity.nodes);
32883 cacheEntities(entity.members.map(function(member) {
32889 function cacheIntersections(ids) {
32890 function isEndpoint(way2, id3) {
32891 return !way2.isClosed() && !!way2.affix(id3);
32893 for (var i3 = 0; i3 < ids.length; i3++) {
32895 var childNodes = graph.childNodes(graph.entity(id2));
32896 for (var j3 = 0; j3 < childNodes.length; j3++) {
32897 var node = childNodes[j3];
32898 var parents = graph.parentWays(node);
32899 if (parents.length !== 2)
32901 var moved = graph.entity(id2);
32902 var unmoved = null;
32903 for (var k2 = 0; k2 < parents.length; k2++) {
32904 var way = parents[k2];
32905 if (!cache.moving[way.id]) {
32912 if (utilArrayIntersection(moved.nodes, unmoved.nodes).length > 2)
32914 if (moved.isArea() || unmoved.isArea())
32916 cache.intersections.push({
32919 unmovedId: unmoved.id,
32920 movedIsEP: isEndpoint(moved, node.id),
32921 unmovedIsEP: isEndpoint(unmoved, node.id)
32931 cache.intersections = [];
32932 cache.replacedVertex = {};
32933 cache.startLoc = {};
32936 cacheEntities(moveIDs);
32937 cacheIntersections(cache.ways);
32938 cache.nodes = cache.nodes.filter(canMove);
32942 function replaceMovedVertex(nodeId, wayId, graph, delta) {
32943 var way = graph.entity(wayId);
32944 var moved = graph.entity(nodeId);
32945 var movedIndex = way.nodes.indexOf(nodeId);
32946 var len, prevIndex, nextIndex;
32947 if (way.isClosed()) {
32948 len = way.nodes.length - 1;
32949 prevIndex = (movedIndex + len - 1) % len;
32950 nextIndex = (movedIndex + len + 1) % len;
32952 len = way.nodes.length;
32953 prevIndex = movedIndex - 1;
32954 nextIndex = movedIndex + 1;
32956 var prev = graph.hasEntity(way.nodes[prevIndex]);
32957 var next = graph.hasEntity(way.nodes[nextIndex]);
32958 if (!prev || !next)
32960 var key = wayId + "_" + nodeId;
32961 var orig = cache.replacedVertex[key];
32964 cache.replacedVertex[key] = orig;
32965 cache.startLoc[orig.id] = cache.startLoc[nodeId];
32969 start2 = projection2(cache.startLoc[nodeId]);
32970 end = projection2.invert(geoVecAdd(start2, delta));
32972 end = cache.startLoc[nodeId];
32974 orig = orig.move(end);
32975 var angle2 = Math.abs(geoAngle(orig, prev, projection2) - geoAngle(orig, next, projection2)) * 180 / Math.PI;
32976 if (angle2 > 175 && angle2 < 185)
32978 var p1 = [prev.loc, orig.loc, moved.loc, next.loc].map(projection2);
32979 var p2 = [prev.loc, moved.loc, orig.loc, next.loc].map(projection2);
32980 var d1 = geoPathLength(p1);
32981 var d2 = geoPathLength(p2);
32982 var insertAt = d1 <= d2 ? movedIndex : nextIndex;
32983 if (way.isClosed() && insertAt === 0)
32985 way = way.addNode(orig.id, insertAt);
32986 return graph.replace(orig).replace(way);
32988 function removeDuplicateVertices(wayId, graph) {
32989 var way = graph.entity(wayId);
32990 var epsilon3 = 1e-6;
32992 function isInteresting(node, graph2) {
32993 return graph2.parentWays(node).length > 1 || graph2.parentRelations(node).length || node.hasInterestingTags();
32995 for (var i3 = 0; i3 < way.nodes.length; i3++) {
32996 curr = graph.entity(way.nodes[i3]);
32997 if (prev && curr && geoVecEqual(prev.loc, curr.loc, epsilon3)) {
32998 if (!isInteresting(prev, graph)) {
32999 way = way.removeNode(prev.id);
33000 graph = graph.replace(way).remove(prev);
33001 } else if (!isInteresting(curr, graph)) {
33002 way = way.removeNode(curr.id);
33003 graph = graph.replace(way).remove(curr);
33010 function unZorroIntersection(intersection, graph) {
33011 var vertex = graph.entity(intersection.nodeId);
33012 var way1 = graph.entity(intersection.movedId);
33013 var way2 = graph.entity(intersection.unmovedId);
33014 var isEP1 = intersection.movedIsEP;
33015 var isEP2 = intersection.unmovedIsEP;
33016 if (isEP1 && isEP2)
33018 var nodes1 = graph.childNodes(way1).filter(function(n3) {
33019 return n3 !== vertex;
33021 var nodes2 = graph.childNodes(way2).filter(function(n3) {
33022 return n3 !== vertex;
33024 if (way1.isClosed() && way1.first() === vertex.id)
33025 nodes1.push(nodes1[0]);
33026 if (way2.isClosed() && way2.first() === vertex.id)
33027 nodes2.push(nodes2[0]);
33028 var edge1 = !isEP1 && geoChooseEdge(nodes1, projection2(vertex.loc), projection2);
33029 var edge2 = !isEP2 && geoChooseEdge(nodes2, projection2(vertex.loc), projection2);
33031 if (!isEP1 && !isEP2) {
33032 var epsilon3 = 1e-6, maxIter = 10;
33033 for (var i3 = 0; i3 < maxIter; i3++) {
33034 loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);
33035 edge1 = geoChooseEdge(nodes1, projection2(loc), projection2);
33036 edge2 = geoChooseEdge(nodes2, projection2(loc), projection2);
33037 if (Math.abs(edge1.distance - edge2.distance) < epsilon3)
33040 } else if (!isEP1) {
33045 graph = graph.replace(vertex.move(loc));
33046 if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {
33047 way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);
33048 graph = graph.replace(way1);
33050 if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {
33051 way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);
33052 graph = graph.replace(way2);
33056 function cleanupIntersections(graph) {
33057 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
33058 var obj = cache.intersections[i3];
33059 graph = replaceMovedVertex(obj.nodeId, obj.movedId, graph, _delta);
33060 graph = replaceMovedVertex(obj.nodeId, obj.unmovedId, graph, null);
33061 graph = unZorroIntersection(obj, graph);
33062 graph = removeDuplicateVertices(obj.movedId, graph);
33063 graph = removeDuplicateVertices(obj.unmovedId, graph);
33067 function limitDelta(graph) {
33068 function moveNode(loc) {
33069 return geoVecAdd(projection2(loc), _delta);
33071 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
33072 var obj = cache.intersections[i3];
33073 if (obj.movedIsEP && obj.unmovedIsEP)
33075 if (!obj.movedIsEP)
33077 var node = graph.entity(obj.nodeId);
33078 var start2 = projection2(node.loc);
33079 var end = geoVecAdd(start2, _delta);
33080 var movedNodes = graph.childNodes(graph.entity(obj.movedId));
33081 var movedPath = movedNodes.map(function(n3) {
33082 return moveNode(n3.loc);
33084 var unmovedNodes = graph.childNodes(graph.entity(obj.unmovedId));
33085 var unmovedPath = unmovedNodes.map(function(n3) {
33086 return projection2(n3.loc);
33088 var hits = geoPathIntersections(movedPath, unmovedPath);
33089 for (var j3 = 0; i3 < hits.length; i3++) {
33090 if (geoVecEqual(hits[j3], end))
33092 var edge = geoChooseEdge(unmovedNodes, end, projection2);
33093 _delta = geoVecSubtract(projection2(edge.loc), start2);
33097 var action = function(graph) {
33098 if (_delta[0] === 0 && _delta[1] === 0)
33101 if (cache.intersections.length) {
33104 for (var i3 = 0; i3 < cache.nodes.length; i3++) {
33105 var node = graph.entity(cache.nodes[i3]);
33106 var start2 = projection2(node.loc);
33107 var end = geoVecAdd(start2, _delta);
33108 graph = graph.replace(node.move(projection2.invert(end)));
33110 if (cache.intersections.length) {
33111 graph = cleanupIntersections(graph);
33115 action.delta = function() {
33121 // modules/actions/move_member.js
33122 function actionMoveMember(relationId, fromIndex, toIndex) {
33123 return function(graph) {
33124 return graph.replace(graph.entity(relationId).moveMember(fromIndex, toIndex));
33128 // modules/actions/move_node.js
33129 function actionMoveNode(nodeID, toLoc) {
33130 var action = function(graph, t2) {
33131 if (t2 === null || !isFinite(t2))
33133 t2 = Math.min(Math.max(+t2, 0), 1);
33134 var node = graph.entity(nodeID);
33135 return graph.replace(
33136 node.move(geoVecInterp(node.loc, toLoc, t2))
33139 action.transitionable = true;
33143 // modules/actions/noop.js
33144 function actionNoop() {
33145 return function(graph) {
33150 // modules/actions/orthogonalize.js
33151 function actionOrthogonalize(wayID, projection2, vertexID, degThresh, ep) {
33152 var epsilon3 = ep || 1e-4;
33153 var threshold = degThresh || 13;
33154 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
33155 var upperThreshold = Math.cos(threshold * Math.PI / 180);
33156 var action = function(graph, t2) {
33157 if (t2 === null || !isFinite(t2))
33159 t2 = Math.min(Math.max(+t2, 0), 1);
33160 var way = graph.entity(wayID);
33161 way = way.removeNode("");
33162 if (way.tags.nonsquare) {
33163 var tags = Object.assign({}, way.tags);
33164 delete tags.nonsquare;
33165 way = way.update({ tags });
33167 graph = graph.replace(way);
33168 var isClosed = way.isClosed();
33169 var nodes = graph.childNodes(way).slice();
33172 if (vertexID !== void 0) {
33173 nodes = nodeSubset(nodes, vertexID, isClosed);
33174 if (nodes.length !== 3)
33177 var nodeCount = {};
33179 var corner = { i: 0, dotp: 1 };
33180 var node, point2, loc, score, motions, i3, j3;
33181 for (i3 = 0; i3 < nodes.length; i3++) {
33183 nodeCount[node.id] = (nodeCount[node.id] || 0) + 1;
33184 points.push({ id: node.id, coord: projection2(node.loc) });
33186 if (points.length === 3) {
33187 for (i3 = 0; i3 < 1e3; i3++) {
33188 motions = points.map(calcMotion);
33189 points[corner.i].coord = geoVecAdd(points[corner.i].coord, motions[corner.i]);
33190 score = corner.dotp;
33191 if (score < epsilon3) {
33195 node = graph.entity(nodes[corner.i].id);
33196 loc = projection2.invert(points[corner.i].coord);
33197 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33199 var straights = [];
33200 var simplified = [];
33201 for (i3 = 0; i3 < points.length; i3++) {
33202 point2 = points[i3];
33204 if (isClosed || i3 > 0 && i3 < points.length - 1) {
33205 var a2 = points[(i3 - 1 + points.length) % points.length];
33206 var b2 = points[(i3 + 1) % points.length];
33207 dotp = Math.abs(geoOrthoNormalizedDotProduct(a2.coord, b2.coord, point2.coord));
33209 if (dotp > upperThreshold) {
33210 straights.push(point2);
33212 simplified.push(point2);
33215 var bestPoints = clonePoints(simplified);
33216 var originalPoints = clonePoints(simplified);
33218 for (i3 = 0; i3 < 1e3; i3++) {
33219 motions = simplified.map(calcMotion);
33220 for (j3 = 0; j3 < motions.length; j3++) {
33221 simplified[j3].coord = geoVecAdd(simplified[j3].coord, motions[j3]);
33223 var newScore = geoOrthoCalcScore(simplified, isClosed, epsilon3, threshold);
33224 if (newScore < score) {
33225 bestPoints = clonePoints(simplified);
33228 if (score < epsilon3) {
33232 var bestCoords = bestPoints.map(function(p2) {
33236 bestCoords.push(bestCoords[0]);
33237 for (i3 = 0; i3 < bestPoints.length; i3++) {
33238 point2 = bestPoints[i3];
33239 if (!geoVecEqual(originalPoints[i3].coord, point2.coord)) {
33240 node = graph.entity(point2.id);
33241 loc = projection2.invert(point2.coord);
33242 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33245 for (i3 = 0; i3 < straights.length; i3++) {
33246 point2 = straights[i3];
33247 if (nodeCount[point2.id] > 1)
33249 node = graph.entity(point2.id);
33250 if (t2 === 1 && graph.parentWays(node).length === 1 && graph.parentRelations(node).length === 0 && !node.hasInterestingTags()) {
33251 graph = actionDeleteNode(node.id)(graph);
33253 var choice = geoVecProject(point2.coord, bestCoords);
33255 loc = projection2.invert(choice.target);
33256 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33262 function clonePoints(array2) {
33263 return array2.map(function(p2) {
33264 return { id: p2.id, coord: [p2.coord[0], p2.coord[1]] };
33267 function calcMotion(point3, i4, array2) {
33268 if (!isClosed && (i4 === 0 || i4 === array2.length - 1))
33270 if (nodeCount[array2[i4].id] > 1)
33272 var a3 = array2[(i4 - 1 + array2.length) % array2.length].coord;
33273 var origin = point3.coord;
33274 var b3 = array2[(i4 + 1) % array2.length].coord;
33275 var p2 = geoVecSubtract(a3, origin);
33276 var q2 = geoVecSubtract(b3, origin);
33277 var scale = 2 * Math.min(geoVecLength(p2), geoVecLength(q2));
33278 p2 = geoVecNormalize(p2);
33279 q2 = geoVecNormalize(q2);
33280 var dotp2 = p2[0] * q2[0] + p2[1] * q2[1];
33281 var val = Math.abs(dotp2);
33282 if (val < lowerThreshold) {
33285 var vec = geoVecNormalize(geoVecAdd(p2, q2));
33286 return geoVecScale(vec, 0.1 * dotp2 * scale);
33291 function nodeSubset(nodes, vertexID2, isClosed) {
33292 var first = isClosed ? 0 : 1;
33293 var last = isClosed ? nodes.length : nodes.length - 1;
33294 for (var i3 = first; i3 < last; i3++) {
33295 if (nodes[i3].id === vertexID2) {
33297 nodes[(i3 - 1 + nodes.length) % nodes.length],
33299 nodes[(i3 + 1) % nodes.length]
33305 action.disabled = function(graph) {
33306 var way = graph.entity(wayID);
33307 way = way.removeNode("");
33308 graph = graph.replace(way);
33309 var isClosed = way.isClosed();
33310 var nodes = graph.childNodes(way).slice();
33313 var allowStraightAngles = false;
33314 if (vertexID !== void 0) {
33315 allowStraightAngles = true;
33316 nodes = nodeSubset(nodes, vertexID, isClosed);
33317 if (nodes.length !== 3)
33318 return "end_vertex";
33320 var coords = nodes.map(function(n3) {
33321 return projection2(n3.loc);
33323 var score = geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles);
33324 if (score === null) {
33325 return "not_squarish";
33326 } else if (score === 0) {
33327 return "square_enough";
33332 action.transitionable = true;
33336 // modules/actions/restrict_turn.js
33337 function actionRestrictTurn(turn, restrictionType, restrictionID) {
33338 return function(graph) {
33339 var fromWay = graph.entity(turn.from.way);
33340 var toWay = graph.entity(turn.to.way);
33341 var viaNode = turn.via.node && graph.entity(turn.via.node);
33342 var viaWays = turn.via.ways && turn.via.ways.map(function(id2) {
33343 return graph.entity(id2);
33346 members.push({ id: fromWay.id, type: "way", role: "from" });
33348 members.push({ id: viaNode.id, type: "node", role: "via" });
33349 } else if (viaWays) {
33350 viaWays.forEach(function(viaWay) {
33351 members.push({ id: viaWay.id, type: "way", role: "via" });
33354 members.push({ id: toWay.id, type: "way", role: "to" });
33355 return graph.replace(osmRelation({
33358 type: "restriction",
33359 restriction: restrictionType
33366 // modules/actions/revert.js
33367 function actionRevert(id2) {
33368 var action = function(graph) {
33369 var entity = graph.hasEntity(id2), base = graph.base().entities[id2];
33370 if (entity && !base) {
33371 if (entity.type === "node") {
33372 graph.parentWays(entity).forEach(function(parent) {
33373 parent = parent.removeNode(id2);
33374 graph = graph.replace(parent);
33375 if (parent.isDegenerate()) {
33376 graph = actionDeleteWay(parent.id)(graph);
33380 graph.parentRelations(entity).forEach(function(parent) {
33381 parent = parent.removeMembersWithID(id2);
33382 graph = graph.replace(parent);
33383 if (parent.isDegenerate()) {
33384 graph = actionDeleteRelation(parent.id)(graph);
33388 return graph.revert(id2);
33393 // modules/actions/rotate.js
33394 function actionRotate(rotateIds, pivot, angle2, projection2) {
33395 var action = function(graph) {
33396 return graph.update(function(graph2) {
33397 utilGetAllNodes(rotateIds, graph2).forEach(function(node) {
33398 var point2 = geoRotate([projection2(node.loc)], angle2, pivot)[0];
33399 graph2 = graph2.replace(node.move(projection2.invert(point2)));
33406 // modules/actions/scale.js
33407 function actionScale(ids, pivotLoc, scaleFactor, projection2) {
33408 return function(graph) {
33409 return graph.update(function(graph2) {
33410 let point2, radial;
33411 utilGetAllNodes(ids, graph2).forEach(function(node) {
33412 point2 = projection2(node.loc);
33414 point2[0] - pivotLoc[0],
33415 point2[1] - pivotLoc[1]
33418 pivotLoc[0] + scaleFactor * radial[0],
33419 pivotLoc[1] + scaleFactor * radial[1]
33421 graph2 = graph2.replace(node.move(projection2.invert(point2)));
33427 // modules/actions/straighten_nodes.js
33428 function actionStraightenNodes(nodeIDs, projection2) {
33429 function positionAlongWay(a2, o2, b2) {
33430 return geoVecDot(a2, b2, o2) / geoVecDot(b2, b2, o2);
33432 function getEndpoints(points) {
33433 var ssr = geoGetSmallestSurroundingRectangle(points);
33434 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
33435 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
33436 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
33437 var q2 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
33438 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q2);
33444 var action = function(graph, t2) {
33445 if (t2 === null || !isFinite(t2))
33447 t2 = Math.min(Math.max(+t2, 0), 1);
33448 var nodes = nodeIDs.map(function(id2) {
33449 return graph.entity(id2);
33451 var points = nodes.map(function(n3) {
33452 return projection2(n3.loc);
33454 var endpoints = getEndpoints(points);
33455 var startPoint = endpoints[0];
33456 var endPoint = endpoints[1];
33457 for (var i3 = 0; i3 < points.length; i3++) {
33458 var node = nodes[i3];
33459 var point2 = points[i3];
33460 var u2 = positionAlongWay(point2, startPoint, endPoint);
33461 var point22 = geoVecInterp(startPoint, endPoint, u2);
33462 var loc2 = projection2.invert(point22);
33463 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
33467 action.disabled = function(graph) {
33468 var nodes = nodeIDs.map(function(id2) {
33469 return graph.entity(id2);
33471 var points = nodes.map(function(n3) {
33472 return projection2(n3.loc);
33474 var endpoints = getEndpoints(points);
33475 var startPoint = endpoints[0];
33476 var endPoint = endpoints[1];
33477 var maxDistance = 0;
33478 for (var i3 = 0; i3 < points.length; i3++) {
33479 var point2 = points[i3];
33480 var u2 = positionAlongWay(point2, startPoint, endPoint);
33481 var p2 = geoVecInterp(startPoint, endPoint, u2);
33482 var dist = geoVecLength(p2, point2);
33483 if (!isNaN(dist) && dist > maxDistance) {
33484 maxDistance = dist;
33487 if (maxDistance < 1e-4) {
33488 return "straight_enough";
33491 action.transitionable = true;
33495 // modules/actions/straighten_way.js
33496 function actionStraightenWay(selectedIDs, projection2) {
33497 function positionAlongWay(a2, o2, b2) {
33498 return geoVecDot(a2, b2, o2) / geoVecDot(b2, b2, o2);
33500 function allNodes(graph) {
33502 var startNodes = [];
33504 var remainingWays = [];
33505 var selectedWays = selectedIDs.filter(function(w2) {
33506 return graph.entity(w2).type === "way";
33508 var selectedNodes = selectedIDs.filter(function(n3) {
33509 return graph.entity(n3).type === "node";
33511 for (var i3 = 0; i3 < selectedWays.length; i3++) {
33512 var way = graph.entity(selectedWays[i3]);
33513 nodes = way.nodes.slice(0);
33514 remainingWays.push(nodes);
33515 startNodes.push(nodes[0]);
33516 endNodes.push(nodes[nodes.length - 1]);
33518 startNodes = startNodes.filter(function(n3) {
33519 return startNodes.indexOf(n3) === startNodes.lastIndexOf(n3);
33521 endNodes = endNodes.filter(function(n3) {
33522 return endNodes.indexOf(n3) === endNodes.lastIndexOf(n3);
33524 var currNode = utilArrayDifference(startNodes, endNodes).concat(utilArrayDifference(endNodes, startNodes))[0];
33527 var getNextWay = function(currNode2, remainingWays2) {
33528 return remainingWays2.filter(function(way2) {
33529 return way2[0] === currNode2 || way2[way2.length - 1] === currNode2;
33532 while (remainingWays.length) {
33533 nextWay = getNextWay(currNode, remainingWays);
33534 remainingWays = utilArrayDifference(remainingWays, [nextWay]);
33535 if (nextWay[0] !== currNode) {
33538 nodes = nodes.concat(nextWay);
33539 currNode = nodes[nodes.length - 1];
33541 if (selectedNodes.length === 2) {
33542 var startNodeIdx = nodes.indexOf(selectedNodes[0]);
33543 var endNodeIdx = nodes.indexOf(selectedNodes[1]);
33544 var sortedStartEnd = [startNodeIdx, endNodeIdx];
33545 sortedStartEnd.sort(function(a2, b2) {
33548 nodes = nodes.slice(sortedStartEnd[0], sortedStartEnd[1] + 1);
33550 return nodes.map(function(n3) {
33551 return graph.entity(n3);
33554 function shouldKeepNode(node, graph) {
33555 return graph.parentWays(node).length > 1 || graph.parentRelations(node).length || node.hasInterestingTags();
33557 var action = function(graph, t2) {
33558 if (t2 === null || !isFinite(t2))
33560 t2 = Math.min(Math.max(+t2, 0), 1);
33561 var nodes = allNodes(graph);
33562 var points = nodes.map(function(n3) {
33563 return projection2(n3.loc);
33565 var startPoint = points[0];
33566 var endPoint = points[points.length - 1];
33569 for (i3 = 1; i3 < points.length - 1; i3++) {
33570 var node = nodes[i3];
33571 var point2 = points[i3];
33572 if (t2 < 1 || shouldKeepNode(node, graph)) {
33573 var u2 = positionAlongWay(point2, startPoint, endPoint);
33574 var p2 = geoVecInterp(startPoint, endPoint, u2);
33575 var loc2 = projection2.invert(p2);
33576 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
33578 if (toDelete.indexOf(node) === -1) {
33579 toDelete.push(node);
33583 for (i3 = 0; i3 < toDelete.length; i3++) {
33584 graph = actionDeleteNode(toDelete[i3].id)(graph);
33588 action.disabled = function(graph) {
33589 var nodes = allNodes(graph);
33590 var points = nodes.map(function(n3) {
33591 return projection2(n3.loc);
33593 var startPoint = points[0];
33594 var endPoint = points[points.length - 1];
33595 var threshold = 0.2 * geoVecLength(startPoint, endPoint);
33597 if (threshold === 0) {
33598 return "too_bendy";
33600 var maxDistance = 0;
33601 for (i3 = 1; i3 < points.length - 1; i3++) {
33602 var point2 = points[i3];
33603 var u2 = positionAlongWay(point2, startPoint, endPoint);
33604 var p2 = geoVecInterp(startPoint, endPoint, u2);
33605 var dist = geoVecLength(p2, point2);
33606 if (isNaN(dist) || dist > threshold) {
33607 return "too_bendy";
33608 } else if (dist > maxDistance) {
33609 maxDistance = dist;
33612 var keepingAllNodes = nodes.every(function(node, i4) {
33613 return i4 === 0 || i4 === nodes.length - 1 || shouldKeepNode(node, graph);
33615 if (maxDistance < 1e-4 && // Allow straightening even if already straight in order to remove extraneous nodes
33617 return "straight_enough";
33620 action.transitionable = true;
33624 // modules/actions/unrestrict_turn.js
33625 function actionUnrestrictTurn(turn) {
33626 return function(graph) {
33627 return actionDeleteRelation(turn.restrictionID)(graph);
33631 // modules/actions/reflect.js
33632 function actionReflect(reflectIds, projection2) {
33633 var _useLongAxis = true;
33634 var action = function(graph, t2) {
33635 if (t2 === null || !isFinite(t2))
33637 t2 = Math.min(Math.max(+t2, 0), 1);
33638 var nodes = utilGetAllNodes(reflectIds, graph);
33639 var points = nodes.map(function(n3) {
33640 return projection2(n3.loc);
33642 var ssr = geoGetSmallestSurroundingRectangle(points);
33643 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
33644 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
33645 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
33646 var q2 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
33648 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q2);
33649 if (_useLongAxis && isLong || !_useLongAxis && !isLong) {
33656 var dx = q3[0] - p3[0];
33657 var dy = q3[1] - p3[1];
33658 var a2 = (dx * dx - dy * dy) / (dx * dx + dy * dy);
33659 var b2 = 2 * dx * dy / (dx * dx + dy * dy);
33660 for (var i3 = 0; i3 < nodes.length; i3++) {
33661 var node = nodes[i3];
33662 var c2 = projection2(node.loc);
33664 a2 * (c2[0] - p3[0]) + b2 * (c2[1] - p3[1]) + p3[0],
33665 b2 * (c2[0] - p3[0]) - a2 * (c2[1] - p3[1]) + p3[1]
33667 var loc2 = projection2.invert(c22);
33668 node = node.move(geoVecInterp(node.loc, loc2, t2));
33669 graph = graph.replace(node);
33673 action.useLongAxis = function(val) {
33674 if (!arguments.length)
33675 return _useLongAxis;
33676 _useLongAxis = val;
33679 action.transitionable = true;
33683 // modules/actions/upgrade_tags.js
33684 function actionUpgradeTags(entityId, oldTags, replaceTags) {
33685 return function(graph) {
33686 var entity = graph.entity(entityId);
33687 var tags = Object.assign({}, entity.tags);
33690 for (var oldTagKey in oldTags) {
33691 if (!(oldTagKey in tags))
33693 if (oldTags[oldTagKey] === "*") {
33694 transferValue = tags[oldTagKey];
33695 delete tags[oldTagKey];
33696 } else if (oldTags[oldTagKey] === tags[oldTagKey]) {
33697 delete tags[oldTagKey];
33699 var vals = tags[oldTagKey].split(";").filter(Boolean);
33700 var oldIndex = vals.indexOf(oldTags[oldTagKey]);
33701 if (vals.length === 1 || oldIndex === -1) {
33702 delete tags[oldTagKey];
33704 if (replaceTags && replaceTags[oldTagKey]) {
33705 semiIndex = oldIndex;
33707 vals.splice(oldIndex, 1);
33708 tags[oldTagKey] = vals.join(";");
33713 for (var replaceKey in replaceTags) {
33714 var replaceValue = replaceTags[replaceKey];
33715 if (replaceValue === "*") {
33716 if (tags[replaceKey] && tags[replaceKey] !== "no") {
33719 tags[replaceKey] = "yes";
33721 } else if (replaceValue === "$1") {
33722 tags[replaceKey] = transferValue;
33724 if (tags[replaceKey] && oldTags[replaceKey] && semiIndex !== void 0) {
33725 var existingVals = tags[replaceKey].split(";").filter(Boolean);
33726 if (existingVals.indexOf(replaceValue) === -1) {
33727 existingVals.splice(semiIndex, 0, replaceValue);
33728 tags[replaceKey] = existingVals.join(";");
33731 tags[replaceKey] = replaceValue;
33736 return graph.replace(entity.update({ tags }));
33740 // modules/behavior/edit.js
33741 function behaviorEdit(context) {
33742 function behavior() {
33743 context.map().minzoom(context.minEditableZoom());
33745 behavior.off = function() {
33746 context.map().minzoom(0);
33751 // modules/behavior/hover.js
33752 function behaviorHover(context) {
33753 var dispatch14 = dispatch_default("hover");
33754 var _selection = select_default2(null);
33755 var _newNodeId = null;
33756 var _initialNodeID = null;
33760 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
33761 function keydown(d3_event) {
33762 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
33763 _selection.selectAll(".hover").classed("hover-suppressed", true).classed("hover", false);
33764 _selection.classed("hover-disabled", true);
33765 dispatch14.call("hover", this, null);
33768 function keyup(d3_event) {
33769 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
33770 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false).classed("hover", true);
33771 _selection.classed("hover-disabled", false);
33772 dispatch14.call("hover", this, _targets);
33775 function behavior(selection2) {
33776 _selection = selection2;
33778 if (_initialNodeID) {
33779 _newNodeId = _initialNodeID;
33780 _initialNodeID = null;
33784 _selection.on(_pointerPrefix + "over.hover", pointerover).on(_pointerPrefix + "out.hover", pointerout).on(_pointerPrefix + "down.hover", pointerover);
33785 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", pointerout, true).on("keydown.hover", keydown).on("keyup.hover", keyup);
33786 function eventTarget(d3_event) {
33787 var datum2 = d3_event.target && d3_event.target.__data__;
33788 if (typeof datum2 !== "object")
33790 if (!(datum2 instanceof osmEntity) && datum2.properties && datum2.properties.entity instanceof osmEntity) {
33791 return datum2.properties.entity;
33795 function pointerover(d3_event) {
33796 if (context.mode().id.indexOf("drag") === -1 && (!d3_event.pointerType || d3_event.pointerType === "mouse") && d3_event.buttons)
33798 var target = eventTarget(d3_event);
33799 if (target && _targets.indexOf(target) === -1) {
33800 _targets.push(target);
33801 updateHover(d3_event, _targets);
33804 function pointerout(d3_event) {
33805 var target = eventTarget(d3_event);
33806 var index = _targets.indexOf(target);
33807 if (index !== -1) {
33808 _targets.splice(index);
33809 updateHover(d3_event, _targets);
33812 function allowsVertex(d2) {
33813 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
33815 function modeAllowsHover(target) {
33816 var mode = context.mode();
33817 if (mode.id === "add-point") {
33818 return mode.preset.matchGeometry("vertex") || target.type !== "way" && target.geometry(context.graph()) !== "vertex";
33822 function updateHover(d3_event, targets) {
33823 _selection.selectAll(".hover").classed("hover", false);
33824 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false);
33825 var mode = context.mode();
33826 if (!_newNodeId && (mode.id === "draw-line" || mode.id === "draw-area")) {
33827 var node = targets.find(function(target) {
33828 return target instanceof osmEntity && target.type === "node";
33830 _newNodeId = node && node.id;
33832 targets = targets.filter(function(datum3) {
33833 if (datum3 instanceof osmEntity) {
33834 return datum3.id !== _newNodeId && (datum3.type !== "node" || !_ignoreVertex || allowsVertex(datum3)) && modeAllowsHover(datum3);
33839 for (var i3 in targets) {
33840 var datum2 = targets[i3];
33841 if (datum2.__featurehash__) {
33842 selector += ", .data" + datum2.__featurehash__;
33843 } else if (datum2 instanceof QAItem) {
33844 selector += ", ." + datum2.service + ".itemId-" + datum2.id;
33845 } else if (datum2 instanceof osmNote) {
33846 selector += ", .note-" + datum2.id;
33847 } else if (datum2 instanceof osmEntity) {
33848 selector += ", ." + datum2.id;
33849 if (datum2.type === "relation") {
33850 for (var j3 in datum2.members) {
33851 selector += ", ." + datum2.members[j3].id;
33856 var suppressed = _altDisables && d3_event && d3_event.altKey;
33857 if (selector.trim().length) {
33858 selector = selector.slice(1);
33859 _selection.selectAll(selector).classed(suppressed ? "hover-suppressed" : "hover", true);
33861 dispatch14.call("hover", this, !suppressed && targets);
33864 behavior.off = function(selection2) {
33865 selection2.selectAll(".hover").classed("hover", false);
33866 selection2.selectAll(".hover-suppressed").classed("hover-suppressed", false);
33867 selection2.classed("hover-disabled", false);
33868 selection2.on(_pointerPrefix + "over.hover", null).on(_pointerPrefix + "out.hover", null).on(_pointerPrefix + "down.hover", null);
33869 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", null, true).on("keydown.hover", null).on("keyup.hover", null);
33871 behavior.altDisables = function(val) {
33872 if (!arguments.length)
33873 return _altDisables;
33874 _altDisables = val;
33877 behavior.ignoreVertex = function(val) {
33878 if (!arguments.length)
33879 return _ignoreVertex;
33880 _ignoreVertex = val;
33883 behavior.initialNodeID = function(nodeId) {
33884 _initialNodeID = nodeId;
33887 return utilRebind(behavior, dispatch14, "on");
33890 // modules/behavior/draw.js
33891 var _disableSpace = false;
33892 var _lastSpace = null;
33893 function behaviorDraw(context) {
33894 var dispatch14 = dispatch_default(
33905 var keybinding = utilKeybinding("draw");
33906 var _hover = behaviorHover(context).altDisables(true).ignoreVertex(true).on("hover", context.ui().sidebar.hover);
33907 var _edit = behaviorEdit(context);
33908 var _closeTolerance = 4;
33909 var _tolerance = 12;
33910 var _mouseLeave = false;
33911 var _lastMouse = null;
33912 var _lastPointerUpEvent;
33914 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
33915 function datum2(d3_event) {
33916 var mode = context.mode();
33917 var isNote = mode && mode.id.indexOf("note") !== -1;
33918 if (d3_event.altKey || isNote)
33921 if (d3_event.type === "keydown") {
33922 element = _lastMouse && _lastMouse.target;
33924 element = d3_event.target;
33926 var d2 = element.__data__;
33927 return d2 && d2.properties && d2.properties.target ? d2 : {};
33929 function pointerdown(d3_event) {
33932 var pointerLocGetter = utilFastMouse(this);
33934 id: d3_event.pointerId || "mouse",
33936 downTime: +/* @__PURE__ */ new Date(),
33937 downLoc: pointerLocGetter(d3_event)
33939 dispatch14.call("down", this, d3_event, datum2(d3_event));
33941 function pointerup(d3_event) {
33942 if (!_downPointer || _downPointer.id !== (d3_event.pointerId || "mouse"))
33944 var downPointer = _downPointer;
33945 _downPointer = null;
33946 _lastPointerUpEvent = d3_event;
33947 if (downPointer.isCancelled)
33949 var t2 = +/* @__PURE__ */ new Date();
33950 var p2 = downPointer.pointerLocGetter(d3_event);
33951 var dist = geoVecLength(downPointer.downLoc, p2);
33952 if (dist < _closeTolerance || dist < _tolerance && t2 - downPointer.downTime < 500) {
33953 select_default2(window).on("click.draw-block", function() {
33954 d3_event.stopPropagation();
33956 context.map().dblclickZoomEnable(false);
33957 window.setTimeout(function() {
33958 context.map().dblclickZoomEnable(true);
33959 select_default2(window).on("click.draw-block", null);
33961 click(d3_event, p2);
33964 function pointermove(d3_event) {
33965 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse") && !_downPointer.isCancelled) {
33966 var p2 = _downPointer.pointerLocGetter(d3_event);
33967 var dist = geoVecLength(_downPointer.downLoc, p2);
33968 if (dist >= _closeTolerance) {
33969 _downPointer.isCancelled = true;
33970 dispatch14.call("downcancel", this);
33973 if (d3_event.pointerType && d3_event.pointerType !== "mouse" || d3_event.buttons || _downPointer)
33975 if (_lastPointerUpEvent && _lastPointerUpEvent.pointerType !== "mouse" && d3_event.timeStamp - _lastPointerUpEvent.timeStamp < 100)
33977 _lastMouse = d3_event;
33978 dispatch14.call("move", this, d3_event, datum2(d3_event));
33980 function pointercancel(d3_event) {
33981 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse")) {
33982 if (!_downPointer.isCancelled) {
33983 dispatch14.call("downcancel", this);
33985 _downPointer = null;
33988 function mouseenter() {
33989 _mouseLeave = false;
33991 function mouseleave() {
33992 _mouseLeave = true;
33994 function allowsVertex(d2) {
33995 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
33997 function click(d3_event, loc) {
33998 var d2 = datum2(d3_event);
33999 var target = d2 && d2.properties && d2.properties.entity;
34000 var mode = context.mode();
34001 if (target && target.type === "node" && allowsVertex(target)) {
34002 dispatch14.call("clickNode", this, target, d2);
34004 } else if (target && target.type === "way" && (mode.id !== "add-point" || mode.preset.matchGeometry("vertex"))) {
34005 var choice = geoChooseEdge(
34006 context.graph().childNodes(target),
34008 context.projection,
34012 var edge = [target.nodes[choice.index - 1], target.nodes[choice.index]];
34013 dispatch14.call("clickWay", this, choice.loc, edge, d2);
34016 } else if (mode.id !== "add-point" || mode.preset.matchGeometry("point")) {
34017 var locLatLng = context.projection.invert(loc);
34018 dispatch14.call("click", this, locLatLng, d2);
34021 function space(d3_event) {
34022 d3_event.preventDefault();
34023 d3_event.stopPropagation();
34024 var currSpace = context.map().mouse();
34025 if (_disableSpace && _lastSpace) {
34026 var dist = geoVecLength(_lastSpace, currSpace);
34027 if (dist > _tolerance) {
34028 _disableSpace = false;
34031 if (_disableSpace || _mouseLeave || !_lastMouse)
34033 _lastSpace = currSpace;
34034 _disableSpace = true;
34035 select_default2(window).on("keyup.space-block", function() {
34036 d3_event.preventDefault();
34037 d3_event.stopPropagation();
34038 _disableSpace = false;
34039 select_default2(window).on("keyup.space-block", null);
34041 var loc = context.map().mouse() || // or the map center if the mouse has never entered the map
34042 context.projection(context.map().center());
34043 click(d3_event, loc);
34045 function backspace(d3_event) {
34046 d3_event.preventDefault();
34047 dispatch14.call("undo");
34049 function del(d3_event) {
34050 d3_event.preventDefault();
34051 dispatch14.call("cancel");
34053 function ret(d3_event) {
34054 d3_event.preventDefault();
34055 dispatch14.call("finish");
34057 function behavior(selection2) {
34058 context.install(_hover);
34059 context.install(_edit);
34060 _downPointer = null;
34061 keybinding.on("\u232B", backspace).on("\u2326", del).on("\u238B", ret).on("\u21A9", ret).on("space", space).on("\u2325space", space);
34062 selection2.on("mouseenter.draw", mouseenter).on("mouseleave.draw", mouseleave).on(_pointerPrefix + "down.draw", pointerdown).on(_pointerPrefix + "move.draw", pointermove);
34063 select_default2(window).on(_pointerPrefix + "up.draw", pointerup, true).on("pointercancel.draw", pointercancel, true);
34064 select_default2(document).call(keybinding);
34067 behavior.off = function(selection2) {
34068 context.ui().sidebar.hover.cancel();
34069 context.uninstall(_hover);
34070 context.uninstall(_edit);
34071 selection2.on("mouseenter.draw", null).on("mouseleave.draw", null).on(_pointerPrefix + "down.draw", null).on(_pointerPrefix + "move.draw", null);
34072 select_default2(window).on(_pointerPrefix + "up.draw", null).on("pointercancel.draw", null);
34073 select_default2(document).call(keybinding.unbind);
34075 behavior.hover = function() {
34078 return utilRebind(behavior, dispatch14, "on");
34081 // modules/behavior/breathe.js
34082 var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
34084 // node_modules/d3-scale/src/init.js
34085 function initRange(domain2, range3) {
34086 switch (arguments.length) {
34090 this.range(domain2);
34093 this.range(range3).domain(domain2);
34099 // node_modules/d3-scale/src/constant.js
34100 function constants(x2) {
34101 return function() {
34106 // node_modules/d3-scale/src/number.js
34107 function number2(x2) {
34111 // node_modules/d3-scale/src/continuous.js
34113 function identity3(x2) {
34116 function normalize(a2, b2) {
34117 return (b2 -= a2 = +a2) ? function(x2) {
34118 return (x2 - a2) / b2;
34119 } : constants(isNaN(b2) ? NaN : 0.5);
34121 function clamper(a2, b2) {
34124 t2 = a2, a2 = b2, b2 = t2;
34125 return function(x2) {
34126 return Math.max(a2, Math.min(b2, x2));
34129 function bimap(domain2, range3, interpolate) {
34130 var d0 = domain2[0], d1 = domain2[1], r0 = range3[0], r1 = range3[1];
34132 d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
34134 d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
34135 return function(x2) {
34139 function polymap(domain2, range3, interpolate) {
34140 var j3 = Math.min(domain2.length, range3.length) - 1, d2 = new Array(j3), r2 = new Array(j3), i3 = -1;
34141 if (domain2[j3] < domain2[0]) {
34142 domain2 = domain2.slice().reverse();
34143 range3 = range3.slice().reverse();
34145 while (++i3 < j3) {
34146 d2[i3] = normalize(domain2[i3], domain2[i3 + 1]);
34147 r2[i3] = interpolate(range3[i3], range3[i3 + 1]);
34149 return function(x2) {
34150 var i4 = bisect_default(domain2, x2, 1, j3) - 1;
34151 return r2[i4](d2[i4](x2));
34154 function copy(source, target) {
34155 return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
34157 function transformer2() {
34158 var domain2 = unit, range3 = unit, interpolate = value_default, transform2, untransform, unknown, clamp3 = identity3, piecewise, output, input;
34159 function rescale() {
34160 var n3 = Math.min(domain2.length, range3.length);
34161 if (clamp3 !== identity3)
34162 clamp3 = clamper(domain2[0], domain2[n3 - 1]);
34163 piecewise = n3 > 2 ? polymap : bimap;
34164 output = input = null;
34167 function scale(x2) {
34168 return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain2.map(transform2), range3, interpolate)))(transform2(clamp3(x2)));
34170 scale.invert = function(y2) {
34171 return clamp3(untransform((input || (input = piecewise(range3, domain2.map(transform2), number_default)))(y2)));
34173 scale.domain = function(_2) {
34174 return arguments.length ? (domain2 = Array.from(_2, number2), rescale()) : domain2.slice();
34176 scale.range = function(_2) {
34177 return arguments.length ? (range3 = Array.from(_2), rescale()) : range3.slice();
34179 scale.rangeRound = function(_2) {
34180 return range3 = Array.from(_2), interpolate = round_default, rescale();
34182 scale.clamp = function(_2) {
34183 return arguments.length ? (clamp3 = _2 ? true : identity3, rescale()) : clamp3 !== identity3;
34185 scale.interpolate = function(_2) {
34186 return arguments.length ? (interpolate = _2, rescale()) : interpolate;
34188 scale.unknown = function(_2) {
34189 return arguments.length ? (unknown = _2, scale) : unknown;
34191 return function(t2, u2) {
34192 transform2 = t2, untransform = u2;
34196 function continuous() {
34197 return transformer2()(identity3, identity3);
34200 // node_modules/d3-format/src/formatDecimal.js
34201 function formatDecimal_default(x2) {
34202 return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
34204 function formatDecimalParts(x2, p2) {
34205 if ((i3 = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e")) < 0)
34207 var i3, coefficient = x2.slice(0, i3);
34209 coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
34214 // node_modules/d3-format/src/exponent.js
34215 function exponent_default(x2) {
34216 return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
34219 // node_modules/d3-format/src/formatGroup.js
34220 function formatGroup_default(grouping, thousands) {
34221 return function(value, width) {
34222 var i3 = value.length, t2 = [], j3 = 0, g3 = grouping[0], length = 0;
34223 while (i3 > 0 && g3 > 0) {
34224 if (length + g3 + 1 > width)
34225 g3 = Math.max(1, width - length);
34226 t2.push(value.substring(i3 -= g3, i3 + g3));
34227 if ((length += g3 + 1) > width)
34229 g3 = grouping[j3 = (j3 + 1) % grouping.length];
34231 return t2.reverse().join(thousands);
34235 // node_modules/d3-format/src/formatNumerals.js
34236 function formatNumerals_default(numerals) {
34237 return function(value) {
34238 return value.replace(/[0-9]/g, function(i3) {
34239 return numerals[+i3];
34244 // node_modules/d3-format/src/formatSpecifier.js
34245 var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
34246 function formatSpecifier(specifier) {
34247 if (!(match = re.exec(specifier)))
34248 throw new Error("invalid format: " + specifier);
34250 return new FormatSpecifier({
34258 precision: match[8] && match[8].slice(1),
34263 formatSpecifier.prototype = FormatSpecifier.prototype;
34264 function FormatSpecifier(specifier) {
34265 this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
34266 this.align = specifier.align === void 0 ? ">" : specifier.align + "";
34267 this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
34268 this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
34269 this.zero = !!specifier.zero;
34270 this.width = specifier.width === void 0 ? void 0 : +specifier.width;
34271 this.comma = !!specifier.comma;
34272 this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
34273 this.trim = !!specifier.trim;
34274 this.type = specifier.type === void 0 ? "" : specifier.type + "";
34276 FormatSpecifier.prototype.toString = function() {
34277 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;
34280 // node_modules/d3-format/src/formatTrim.js
34281 function formatTrim_default(s2) {
34283 for (var n3 = s2.length, i3 = 1, i0 = -1, i1; i3 < n3; ++i3) {
34301 return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
34304 // node_modules/d3-format/src/formatPrefixAuto.js
34305 var prefixExponent;
34306 function formatPrefixAuto_default(x2, p2) {
34307 var d2 = formatDecimalParts(x2, p2);
34310 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;
34311 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];
34314 // node_modules/d3-format/src/formatRounded.js
34315 function formatRounded_default(x2, p2) {
34316 var d2 = formatDecimalParts(x2, p2);
34319 var coefficient = d2[0], exponent = d2[1];
34320 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");
34323 // node_modules/d3-format/src/formatTypes.js
34324 var formatTypes_default = {
34325 "%": (x2, p2) => (x2 * 100).toFixed(p2),
34326 "b": (x2) => Math.round(x2).toString(2),
34327 "c": (x2) => x2 + "",
34328 "d": formatDecimal_default,
34329 "e": (x2, p2) => x2.toExponential(p2),
34330 "f": (x2, p2) => x2.toFixed(p2),
34331 "g": (x2, p2) => x2.toPrecision(p2),
34332 "o": (x2) => Math.round(x2).toString(8),
34333 "p": (x2, p2) => formatRounded_default(x2 * 100, p2),
34334 "r": formatRounded_default,
34335 "s": formatPrefixAuto_default,
34336 "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
34337 "x": (x2) => Math.round(x2).toString(16)
34340 // node_modules/d3-format/src/identity.js
34341 function identity_default3(x2) {
34345 // node_modules/d3-format/src/locale.js
34346 var map = Array.prototype.map;
34347 var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
34348 function locale_default(locale2) {
34349 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 + "";
34350 function newFormat(specifier) {
34351 specifier = formatSpecifier(specifier);
34352 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;
34354 comma = true, type2 = "g";
34355 else if (!formatTypes_default[type2])
34356 precision2 === void 0 && (precision2 = 12), trim = true, type2 = "g";
34357 if (zero3 || fill === "0" && align === "=")
34358 zero3 = true, fill = "0", align = "=";
34359 var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
34360 var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2);
34361 precision2 = precision2 === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision2)) : Math.max(0, Math.min(20, precision2));
34362 function format2(value) {
34363 var valuePrefix = prefix, valueSuffix = suffix, i3, n3, c2;
34364 if (type2 === "c") {
34365 valueSuffix = formatType(value) + valueSuffix;
34369 var valueNegative = value < 0 || 1 / value < 0;
34370 value = isNaN(value) ? nan : formatType(Math.abs(value), precision2);
34372 value = formatTrim_default(value);
34373 if (valueNegative && +value === 0 && sign2 !== "+")
34374 valueNegative = false;
34375 valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
34376 valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
34378 i3 = -1, n3 = value.length;
34379 while (++i3 < n3) {
34380 if (c2 = value.charCodeAt(i3), 48 > c2 || c2 > 57) {
34381 valueSuffix = (c2 === 46 ? decimal + value.slice(i3 + 1) : value.slice(i3)) + valueSuffix;
34382 value = value.slice(0, i3);
34388 if (comma && !zero3)
34389 value = group(value, Infinity);
34390 var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
34391 if (comma && zero3)
34392 value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
34395 value = valuePrefix + value + valueSuffix + padding;
34398 value = valuePrefix + padding + value + valueSuffix;
34401 value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
34404 value = padding + valuePrefix + value + valueSuffix;
34407 return numerals(value);
34409 format2.toString = function() {
34410 return specifier + "";
34414 function formatPrefix2(specifier, value) {
34415 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];
34416 return function(value2) {
34417 return f3(k2 * value2) + prefix;
34422 formatPrefix: formatPrefix2
34426 // node_modules/d3-format/src/defaultLocale.js
34433 currency: ["$", ""]
34435 function defaultLocale(definition) {
34436 locale = locale_default(definition);
34437 format = locale.format;
34438 formatPrefix = locale.formatPrefix;
34442 // node_modules/d3-format/src/precisionFixed.js
34443 function precisionFixed_default(step) {
34444 return Math.max(0, -exponent_default(Math.abs(step)));
34447 // node_modules/d3-format/src/precisionPrefix.js
34448 function precisionPrefix_default(step, value) {
34449 return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
34452 // node_modules/d3-format/src/precisionRound.js
34453 function precisionRound_default(step, max3) {
34454 step = Math.abs(step), max3 = Math.abs(max3) - step;
34455 return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
34458 // node_modules/d3-scale/src/tickFormat.js
34459 function tickFormat(start2, stop, count, specifier) {
34460 var step = tickStep(start2, stop, count), precision2;
34461 specifier = formatSpecifier(specifier == null ? ",f" : specifier);
34462 switch (specifier.type) {
34464 var value = Math.max(Math.abs(start2), Math.abs(stop));
34465 if (specifier.precision == null && !isNaN(precision2 = precisionPrefix_default(step, value)))
34466 specifier.precision = precision2;
34467 return formatPrefix(specifier, value);
34474 if (specifier.precision == null && !isNaN(precision2 = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop)))))
34475 specifier.precision = precision2 - (specifier.type === "e");
34480 if (specifier.precision == null && !isNaN(precision2 = precisionFixed_default(step)))
34481 specifier.precision = precision2 - (specifier.type === "%") * 2;
34485 return format(specifier);
34488 // node_modules/d3-scale/src/linear.js
34489 function linearish(scale) {
34490 var domain2 = scale.domain;
34491 scale.ticks = function(count) {
34492 var d2 = domain2();
34493 return ticks(d2[0], d2[d2.length - 1], count == null ? 10 : count);
34495 scale.tickFormat = function(count, specifier) {
34496 var d2 = domain2();
34497 return tickFormat(d2[0], d2[d2.length - 1], count == null ? 10 : count, specifier);
34499 scale.nice = function(count) {
34502 var d2 = domain2();
34504 var i1 = d2.length - 1;
34505 var start2 = d2[i0];
34510 if (stop < start2) {
34511 step = start2, start2 = stop, stop = step;
34512 step = i0, i0 = i1, i1 = step;
34514 while (maxIter-- > 0) {
34515 step = tickIncrement(start2, stop, count);
34516 if (step === prestep) {
34519 return domain2(d2);
34520 } else if (step > 0) {
34521 start2 = Math.floor(start2 / step) * step;
34522 stop = Math.ceil(stop / step) * step;
34523 } else if (step < 0) {
34524 start2 = Math.ceil(start2 * step) / step;
34525 stop = Math.floor(stop * step) / step;
34535 function linear3() {
34536 var scale = continuous();
34537 scale.copy = function() {
34538 return copy(scale, linear3());
34540 initRange.apply(scale, arguments);
34541 return linearish(scale);
34544 // node_modules/d3-scale/src/quantize.js
34545 function quantize() {
34546 var x05 = 0, x12 = 1, n3 = 1, domain2 = [0.5], range3 = [0, 1], unknown;
34547 function scale(x2) {
34548 return x2 != null && x2 <= x2 ? range3[bisect_default(domain2, x2, 0, n3)] : unknown;
34550 function rescale() {
34552 domain2 = new Array(n3);
34554 domain2[i3] = ((i3 + 1) * x12 - (i3 - n3) * x05) / (n3 + 1);
34557 scale.domain = function(_2) {
34558 return arguments.length ? ([x05, x12] = _2, x05 = +x05, x12 = +x12, rescale()) : [x05, x12];
34560 scale.range = function(_2) {
34561 return arguments.length ? (n3 = (range3 = Array.from(_2)).length - 1, rescale()) : range3.slice();
34563 scale.invertExtent = function(y2) {
34564 var i3 = range3.indexOf(y2);
34565 return i3 < 0 ? [NaN, NaN] : i3 < 1 ? [x05, domain2[0]] : i3 >= n3 ? [domain2[n3 - 1], x12] : [domain2[i3 - 1], domain2[i3]];
34567 scale.unknown = function(_2) {
34568 return arguments.length ? (unknown = _2, scale) : scale;
34570 scale.thresholds = function() {
34571 return domain2.slice();
34573 scale.copy = function() {
34574 return quantize().domain([x05, x12]).range(range3).unknown(unknown);
34576 return initRange.apply(linearish(scale), arguments);
34579 // modules/behavior/breathe.js
34580 function behaviorBreathe() {
34581 var duration = 800;
34583 var selector = ".selected.shadow, .selected .shadow";
34584 var _selected = select_default2(null);
34589 function ratchetyInterpolator(a2, b2, steps2, units) {
34592 var sample = quantize().domain([0, 1]).range(quantize_default(number_default(a2, b2), steps2));
34593 return function(t2) {
34594 return String(sample(t2)) + (units || "");
34597 function reset(selection2) {
34598 selection2.style("stroke-opacity", null).style("stroke-width", null).style("fill-opacity", null).style("r", null);
34600 function setAnimationParams(transition2, fromTo) {
34601 var toFrom = fromTo === "from" ? "to" : "from";
34602 transition2.styleTween("stroke-opacity", function(d2) {
34603 return ratchetyInterpolator(
34604 _params[d2.id][toFrom].opacity,
34605 _params[d2.id][fromTo].opacity,
34608 }).styleTween("stroke-width", function(d2) {
34609 return ratchetyInterpolator(
34610 _params[d2.id][toFrom].width,
34611 _params[d2.id][fromTo].width,
34615 }).styleTween("fill-opacity", function(d2) {
34616 return ratchetyInterpolator(
34617 _params[d2.id][toFrom].opacity,
34618 _params[d2.id][fromTo].opacity,
34621 }).styleTween("r", function(d2) {
34622 return ratchetyInterpolator(
34623 _params[d2.id][toFrom].width,
34624 _params[d2.id][fromTo].width,
34630 function calcAnimationParams(selection2) {
34631 selection2.call(reset).each(function(d2) {
34632 var s2 = select_default2(this);
34633 var tag = s2.node().tagName;
34634 var p2 = { "from": {}, "to": {} };
34637 if (tag === "circle") {
34638 opacity = Number(s2.style("fill-opacity") || 0.5);
34639 width = Number(s2.style("r") || 15.5);
34641 opacity = Number(s2.style("stroke-opacity") || 0.7);
34642 width = Number(s2.style("stroke-width") || 10);
34645 p2.from.opacity = opacity * 0.6;
34646 p2.to.opacity = opacity * 1.25;
34647 p2.from.width = width * 0.7;
34648 p2.to.width = width * (tag === "circle" ? 1.5 : 1);
34649 _params[d2.id] = p2;
34652 function run(surface, fromTo) {
34653 var toFrom = fromTo === "from" ? "to" : "from";
34654 var currSelected = surface.selectAll(selector);
34655 var currClassed = surface.attr("class");
34656 if (_done || currSelected.empty()) {
34657 _selected.call(reset);
34658 _selected = select_default2(null);
34661 if (!(0, import_fast_deep_equal2.default)(currSelected.data(), _selected.data()) || currClassed !== _classed) {
34662 _selected.call(reset);
34663 _classed = currClassed;
34664 _selected = currSelected.call(calcAnimationParams);
34666 var didCallNextRun = false;
34667 _selected.transition().duration(duration).call(setAnimationParams, fromTo).on("end", function() {
34668 if (!didCallNextRun) {
34669 surface.call(run, toFrom);
34670 didCallNextRun = true;
34672 if (!select_default2(this).classed("selected")) {
34673 reset(select_default2(this));
34677 function behavior(surface) {
34679 _timer = timer(function() {
34680 if (surface.selectAll(selector).empty()) {
34683 surface.call(run, "from");
34688 behavior.restartIfNeeded = function(surface) {
34689 if (_selected.empty()) {
34690 surface.call(run, "from");
34696 behavior.off = function() {
34701 _selected.interrupt().call(reset);
34706 // modules/behavior/operation.js
34707 function behaviorOperation(context) {
34709 function keypress(d3_event) {
34710 if (!context.map().withinEditableZoom())
34712 if (_operation.availableForKeypress && !_operation.availableForKeypress())
34714 d3_event.preventDefault();
34715 var disabled = _operation.disabled();
34717 context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_operation.tooltip())();
34719 context.ui().flash.duration(2e3).iconName("#iD-operation-" + _operation.id).iconClass("operation").label(_operation.annotation() || _operation.title)();
34720 if (_operation.point)
34721 _operation.point(null);
34725 function behavior() {
34726 if (_operation && _operation.available()) {
34727 context.keybinding().on(_operation.keys, keypress);
34731 behavior.off = function() {
34732 context.keybinding().off(_operation.keys);
34734 behavior.which = function(_2) {
34735 if (!arguments.length)
34743 // modules/operations/circularize.js
34744 function operationCircularize(context, selectedIDs) {
34746 var _actions = selectedIDs.map(getAction).filter(Boolean);
34747 var _amount = _actions.length === 1 ? "single" : "multiple";
34748 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
34751 function getAction(entityID) {
34752 var entity = context.entity(entityID);
34753 if (entity.type !== "way" || new Set(entity.nodes).size <= 1)
34756 _extent = entity.extent(context.graph());
34758 _extent = _extent.extend(entity.extent(context.graph()));
34760 return actionCircularize(entityID, context.projection);
34762 var operation = function() {
34763 if (!_actions.length)
34765 var combinedAction = function(graph, t2) {
34766 _actions.forEach(function(action) {
34767 if (!action.disabled(graph)) {
34768 graph = action(graph, t2);
34773 combinedAction.transitionable = true;
34774 context.perform(combinedAction, operation.annotation());
34775 window.setTimeout(function() {
34776 context.validator().validate();
34779 operation.available = function() {
34780 return _actions.length && selectedIDs.length === _actions.length;
34782 operation.disabled = function() {
34783 if (!_actions.length)
34785 var actionDisableds = _actions.map(function(action) {
34786 return action.disabled(context.graph());
34787 }).filter(Boolean);
34788 if (actionDisableds.length === _actions.length) {
34789 if (new Set(actionDisableds).size > 1) {
34790 return "multiple_blockers";
34792 return actionDisableds[0];
34793 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
34794 return "too_large";
34795 } else if (someMissing()) {
34796 return "not_downloaded";
34797 } else if (selectedIDs.some(context.hasHiddenConnections)) {
34798 return "connected_to_hidden";
34801 function someMissing() {
34802 if (context.inIntro())
34804 var osm = context.connection();
34806 var missing = _coords.filter(function(loc) {
34807 return !osm.isDataLoaded(loc);
34809 if (missing.length) {
34810 missing.forEach(function(loc) {
34811 context.loadTileAtLoc(loc);
34819 operation.tooltip = function() {
34820 var disable = operation.disabled();
34821 return disable ? _t.append("operations.circularize." + disable + "." + _amount) : _t.append("operations.circularize.description." + _amount);
34823 operation.annotation = function() {
34824 return _t("operations.circularize.annotation.feature", { n: _actions.length });
34826 operation.id = "circularize";
34827 operation.keys = [_t("operations.circularize.key")];
34828 operation.title = _t.append("operations.circularize.title");
34829 operation.behavior = behaviorOperation(context).which(operation);
34833 // modules/ui/cmd.js
34834 var uiCmd = function(code) {
34835 var detected = utilDetect();
34836 if (detected.os === "mac") {
34839 if (detected.os === "win") {
34840 if (code === "\u2318\u21E7Z")
34843 var result = "", replacements = {
34847 "\u232B": "Backspace",
34850 for (var i3 = 0; i3 < code.length; i3++) {
34851 if (code[i3] in replacements) {
34852 result += replacements[code[i3]] + (i3 < code.length - 1 ? "+" : "");
34854 result += code[i3];
34859 uiCmd.display = function(code) {
34860 if (code.length !== 1)
34862 var detected = utilDetect();
34863 var mac = detected.os === "mac";
34864 var replacements = {
34865 "\u2318": mac ? "\u2318 " + _t("shortcuts.key.cmd") : _t("shortcuts.key.ctrl"),
34866 "\u21E7": mac ? "\u21E7 " + _t("shortcuts.key.shift") : _t("shortcuts.key.shift"),
34867 "\u2325": mac ? "\u2325 " + _t("shortcuts.key.option") : _t("shortcuts.key.alt"),
34868 "\u2303": mac ? "\u2303 " + _t("shortcuts.key.ctrl") : _t("shortcuts.key.ctrl"),
34869 "\u232B": mac ? "\u232B " + _t("shortcuts.key.delete") : _t("shortcuts.key.backspace"),
34870 "\u2326": mac ? "\u2326 " + _t("shortcuts.key.del") : _t("shortcuts.key.del"),
34871 "\u2196": mac ? "\u2196 " + _t("shortcuts.key.pgup") : _t("shortcuts.key.pgup"),
34872 "\u2198": mac ? "\u2198 " + _t("shortcuts.key.pgdn") : _t("shortcuts.key.pgdn"),
34873 "\u21DE": mac ? "\u21DE " + _t("shortcuts.key.home") : _t("shortcuts.key.home"),
34874 "\u21DF": mac ? "\u21DF " + _t("shortcuts.key.end") : _t("shortcuts.key.end"),
34875 "\u21B5": mac ? "\u23CE " + _t("shortcuts.key.return") : _t("shortcuts.key.enter"),
34876 "\u238B": mac ? "\u238B " + _t("shortcuts.key.esc") : _t("shortcuts.key.esc"),
34877 "\u2630": mac ? "\u2630 " + _t("shortcuts.key.menu") : _t("shortcuts.key.menu")
34879 return replacements[code] || code;
34882 // modules/operations/delete.js
34883 function operationDelete(context, selectedIDs) {
34884 var multi = selectedIDs.length === 1 ? "single" : "multiple";
34885 var action = actionDeleteMultiple(selectedIDs);
34886 var nodes = utilGetAllNodes(selectedIDs, context.graph());
34887 var coords = nodes.map(function(n3) {
34890 var extent = utilTotalExtent(selectedIDs, context.graph());
34891 var operation = function() {
34892 var nextSelectedID;
34893 var nextSelectedLoc;
34894 if (selectedIDs.length === 1) {
34895 var id2 = selectedIDs[0];
34896 var entity = context.entity(id2);
34897 var geometry = entity.geometry(context.graph());
34898 var parents = context.graph().parentWays(entity);
34899 var parent = parents[0];
34900 if (geometry === "vertex") {
34901 var nodes2 = parent.nodes;
34902 var i3 = nodes2.indexOf(id2);
34905 } else if (i3 === nodes2.length - 1) {
34908 var a2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 - 1]).loc);
34909 var b2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 + 1]).loc);
34910 i3 = a2 < b2 ? i3 - 1 : i3 + 1;
34912 nextSelectedID = nodes2[i3];
34913 nextSelectedLoc = context.entity(nextSelectedID).loc;
34916 context.perform(action, operation.annotation());
34917 context.validator().validate();
34918 if (nextSelectedID && nextSelectedLoc) {
34919 if (context.hasEntity(nextSelectedID)) {
34920 context.enter(modeSelect(context, [nextSelectedID]).follow(true));
34922 context.map().centerEase(nextSelectedLoc);
34923 context.enter(modeBrowse(context));
34926 context.enter(modeBrowse(context));
34929 operation.available = function() {
34932 operation.disabled = function() {
34933 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
34934 return "too_large";
34935 } else if (someMissing()) {
34936 return "not_downloaded";
34937 } else if (selectedIDs.some(context.hasHiddenConnections)) {
34938 return "connected_to_hidden";
34939 } else if (selectedIDs.some(protectedMember)) {
34940 return "part_of_relation";
34941 } else if (selectedIDs.some(incompleteRelation)) {
34942 return "incomplete_relation";
34943 } else if (selectedIDs.some(hasWikidataTag)) {
34944 return "has_wikidata_tag";
34947 function someMissing() {
34948 if (context.inIntro())
34950 var osm = context.connection();
34952 var missing = coords.filter(function(loc) {
34953 return !osm.isDataLoaded(loc);
34955 if (missing.length) {
34956 missing.forEach(function(loc) {
34957 context.loadTileAtLoc(loc);
34964 function hasWikidataTag(id2) {
34965 var entity = context.entity(id2);
34966 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
34968 function incompleteRelation(id2) {
34969 var entity = context.entity(id2);
34970 return entity.type === "relation" && !entity.isComplete(context.graph());
34972 function protectedMember(id2) {
34973 var entity = context.entity(id2);
34974 if (entity.type !== "way")
34976 var parents = context.graph().parentRelations(entity);
34977 for (var i3 = 0; i3 < parents.length; i3++) {
34978 var parent = parents[i3];
34979 var type2 = parent.tags.type;
34980 var role = parent.memberById(id2).role || "outer";
34981 if (type2 === "route" || type2 === "boundary" || type2 === "multipolygon" && role === "outer") {
34988 operation.tooltip = function() {
34989 var disable = operation.disabled();
34990 return disable ? _t.append("operations.delete." + disable + "." + multi) : _t.append("operations.delete.description." + multi);
34992 operation.annotation = function() {
34993 return selectedIDs.length === 1 ? _t("operations.delete.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.delete.annotation.feature", { n: selectedIDs.length });
34995 operation.id = "delete";
34996 operation.keys = [uiCmd("\u2318\u232B"), uiCmd("\u2318\u2326"), uiCmd("\u2326")];
34997 operation.title = _t.append("operations.delete.title");
34998 operation.behavior = behaviorOperation(context).which(operation);
35002 // modules/operations/orthogonalize.js
35003 function operationOrthogonalize(context, selectedIDs) {
35006 var _actions = selectedIDs.map(chooseAction).filter(Boolean);
35007 var _amount = _actions.length === 1 ? "single" : "multiple";
35008 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
35011 function chooseAction(entityID) {
35012 var entity = context.entity(entityID);
35013 var geometry = entity.geometry(context.graph());
35015 _extent = entity.extent(context.graph());
35017 _extent = _extent.extend(entity.extent(context.graph()));
35019 if (entity.type === "way" && new Set(entity.nodes).size > 2) {
35020 if (_type && _type !== "feature")
35023 return actionOrthogonalize(entityID, context.projection);
35024 } else if (geometry === "vertex") {
35025 if (_type && _type !== "corner")
35028 var graph = context.graph();
35029 var parents = graph.parentWays(entity);
35030 if (parents.length === 1) {
35031 var way = parents[0];
35032 if (way.nodes.indexOf(entityID) !== -1) {
35033 return actionOrthogonalize(way.id, context.projection, entityID);
35039 var operation = function() {
35040 if (!_actions.length)
35042 var combinedAction = function(graph, t2) {
35043 _actions.forEach(function(action) {
35044 if (!action.disabled(graph)) {
35045 graph = action(graph, t2);
35050 combinedAction.transitionable = true;
35051 context.perform(combinedAction, operation.annotation());
35052 window.setTimeout(function() {
35053 context.validator().validate();
35056 operation.available = function() {
35057 return _actions.length && selectedIDs.length === _actions.length;
35059 operation.disabled = function() {
35060 if (!_actions.length)
35062 var actionDisableds = _actions.map(function(action) {
35063 return action.disabled(context.graph());
35064 }).filter(Boolean);
35065 if (actionDisableds.length === _actions.length) {
35066 if (new Set(actionDisableds).size > 1) {
35067 return "multiple_blockers";
35069 return actionDisableds[0];
35070 } else if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
35071 return "too_large";
35072 } else if (someMissing()) {
35073 return "not_downloaded";
35074 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35075 return "connected_to_hidden";
35078 function someMissing() {
35079 if (context.inIntro())
35081 var osm = context.connection();
35083 var missing = _coords.filter(function(loc) {
35084 return !osm.isDataLoaded(loc);
35086 if (missing.length) {
35087 missing.forEach(function(loc) {
35088 context.loadTileAtLoc(loc);
35096 operation.tooltip = function() {
35097 var disable = operation.disabled();
35098 return disable ? _t.append("operations.orthogonalize." + disable + "." + _amount) : _t.append("operations.orthogonalize.description." + _type + "." + _amount);
35100 operation.annotation = function() {
35101 return _t("operations.orthogonalize.annotation." + _type, { n: _actions.length });
35103 operation.id = "orthogonalize";
35104 operation.keys = [_t("operations.orthogonalize.key")];
35105 operation.title = _t.append("operations.orthogonalize.title");
35106 operation.behavior = behaviorOperation(context).which(operation);
35110 // modules/operations/reflect.js
35111 function operationReflectShort(context, selectedIDs) {
35112 return operationReflect(context, selectedIDs, "short");
35114 function operationReflectLong(context, selectedIDs) {
35115 return operationReflect(context, selectedIDs, "long");
35117 function operationReflect(context, selectedIDs, axis) {
35118 axis = axis || "long";
35119 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35120 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35121 var coords = nodes.map(function(n3) {
35124 var extent = utilTotalExtent(selectedIDs, context.graph());
35125 var operation = function() {
35126 var action = actionReflect(selectedIDs, context.projection).useLongAxis(Boolean(axis === "long"));
35127 context.perform(action, operation.annotation());
35128 window.setTimeout(function() {
35129 context.validator().validate();
35132 operation.available = function() {
35133 return nodes.length >= 3;
35135 operation.disabled = function() {
35136 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35137 return "too_large";
35138 } else if (someMissing()) {
35139 return "not_downloaded";
35140 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35141 return "connected_to_hidden";
35142 } else if (selectedIDs.some(incompleteRelation)) {
35143 return "incomplete_relation";
35146 function someMissing() {
35147 if (context.inIntro())
35149 var osm = context.connection();
35151 var missing = coords.filter(function(loc) {
35152 return !osm.isDataLoaded(loc);
35154 if (missing.length) {
35155 missing.forEach(function(loc) {
35156 context.loadTileAtLoc(loc);
35163 function incompleteRelation(id2) {
35164 var entity = context.entity(id2);
35165 return entity.type === "relation" && !entity.isComplete(context.graph());
35168 operation.tooltip = function() {
35169 var disable = operation.disabled();
35170 return disable ? _t.append("operations.reflect." + disable + "." + multi) : _t.append("operations.reflect.description." + axis + "." + multi);
35172 operation.annotation = function() {
35173 return _t("operations.reflect.annotation." + axis + ".feature", { n: selectedIDs.length });
35175 operation.id = "reflect-" + axis;
35176 operation.keys = [_t("operations.reflect.key." + axis)];
35177 operation.title = _t.append("operations.reflect.title." + axis);
35178 operation.behavior = behaviorOperation(context).which(operation);
35182 // modules/operations/move.js
35183 function operationMove(context, selectedIDs) {
35184 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35185 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35186 var coords = nodes.map(function(n3) {
35189 var extent = utilTotalExtent(selectedIDs, context.graph());
35190 var operation = function() {
35191 context.enter(modeMove(context, selectedIDs));
35193 operation.available = function() {
35194 return selectedIDs.length > 0;
35196 operation.disabled = function() {
35197 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35198 return "too_large";
35199 } else if (someMissing()) {
35200 return "not_downloaded";
35201 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35202 return "connected_to_hidden";
35203 } else if (selectedIDs.some(incompleteRelation)) {
35204 return "incomplete_relation";
35207 function someMissing() {
35208 if (context.inIntro())
35210 var osm = context.connection();
35212 var missing = coords.filter(function(loc) {
35213 return !osm.isDataLoaded(loc);
35215 if (missing.length) {
35216 missing.forEach(function(loc) {
35217 context.loadTileAtLoc(loc);
35224 function incompleteRelation(id2) {
35225 var entity = context.entity(id2);
35226 return entity.type === "relation" && !entity.isComplete(context.graph());
35229 operation.tooltip = function() {
35230 var disable = operation.disabled();
35231 return disable ? _t.append("operations.move." + disable + "." + multi) : _t.append("operations.move.description." + multi);
35233 operation.annotation = function() {
35234 return selectedIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.move.annotation.feature", { n: selectedIDs.length });
35236 operation.id = "move";
35237 operation.keys = [_t("operations.move.key")];
35238 operation.title = _t.append("operations.move.title");
35239 operation.behavior = behaviorOperation(context).which(operation);
35240 operation.mouseOnly = true;
35244 // modules/modes/rotate.js
35245 function modeRotate(context, entityIDs) {
35246 var _tolerancePx = 4;
35251 var keybinding = utilKeybinding("rotate");
35253 behaviorEdit(context),
35254 operationCircularize(context, entityIDs).behavior,
35255 operationDelete(context, entityIDs).behavior,
35256 operationMove(context, entityIDs).behavior,
35257 operationOrthogonalize(context, entityIDs).behavior,
35258 operationReflectLong(context, entityIDs).behavior,
35259 operationReflectShort(context, entityIDs).behavior
35261 var annotation = entityIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.rotate.annotation.feature", { n: entityIDs.length });
35264 var _prevTransform;
35266 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35267 function doRotate(d3_event) {
35269 if (context.graph() !== _prevGraph) {
35270 fn = context.perform;
35272 fn = context.replace;
35274 var projection2 = context.projection;
35275 var currTransform = projection2.transform();
35276 if (!_prevTransform || currTransform.k !== _prevTransform.k || currTransform.x !== _prevTransform.x || currTransform.y !== _prevTransform.y) {
35277 var nodes = utilGetAllNodes(entityIDs, context.graph());
35278 var points = nodes.map(function(n3) {
35279 return projection2(n3.loc);
35281 _pivot = getPivot(points);
35282 _prevAngle = void 0;
35284 var currMouse = context.map().mouse(d3_event);
35285 var currAngle = Math.atan2(currMouse[1] - _pivot[1], currMouse[0] - _pivot[0]);
35286 if (typeof _prevAngle === "undefined")
35287 _prevAngle = currAngle;
35288 var delta = currAngle - _prevAngle;
35289 fn(actionRotate(entityIDs, _pivot, delta, projection2));
35290 _prevTransform = currTransform;
35291 _prevAngle = currAngle;
35292 _prevGraph = context.graph();
35294 function getPivot(points) {
35296 if (points.length === 1) {
35297 _pivot2 = points[0];
35298 } else if (points.length === 2) {
35299 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
35301 var polygonHull = hull_default(points);
35302 if (polygonHull.length === 2) {
35303 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
35305 _pivot2 = centroid_default2(hull_default(points));
35310 function finish(d3_event) {
35311 d3_event.stopPropagation();
35312 context.replace(actionNoop(), annotation);
35313 context.enter(modeSelect(context, entityIDs));
35315 function cancel() {
35318 context.enter(modeSelect(context, entityIDs));
35320 function undone() {
35321 context.enter(modeBrowse(context));
35323 mode.enter = function() {
35325 context.features().forceVisible(entityIDs);
35326 behaviors.forEach(context.install);
35328 context.surface().on(_pointerPrefix + "down.modeRotate", function(d3_event) {
35329 downEvent = d3_event;
35331 select_default2(window).on(_pointerPrefix + "move.modeRotate", doRotate, true).on(_pointerPrefix + "up.modeRotate", function(d3_event) {
35334 var mapNode = context.container().select(".main-map").node();
35335 var pointGetter = utilFastMouse(mapNode);
35336 var p1 = pointGetter(downEvent);
35337 var p2 = pointGetter(d3_event);
35338 var dist = geoVecLength(p1, p2);
35339 if (dist <= _tolerancePx)
35343 context.history().on("undone.modeRotate", undone);
35344 keybinding.on("\u238B", cancel).on("\u21A9", finish);
35345 select_default2(document).call(keybinding);
35347 mode.exit = function() {
35348 behaviors.forEach(context.uninstall);
35349 context.surface().on(_pointerPrefix + "down.modeRotate", null);
35350 select_default2(window).on(_pointerPrefix + "move.modeRotate", null, true).on(_pointerPrefix + "up.modeRotate", null, true);
35351 context.history().on("undone.modeRotate", null);
35352 select_default2(document).call(keybinding.unbind);
35353 context.features().forceVisible([]);
35355 mode.selectedIDs = function() {
35356 if (!arguments.length)
35363 // modules/operations/rotate.js
35364 function operationRotate(context, selectedIDs) {
35365 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35366 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35367 var coords = nodes.map(function(n3) {
35370 var extent = utilTotalExtent(selectedIDs, context.graph());
35371 var operation = function() {
35372 context.enter(modeRotate(context, selectedIDs));
35374 operation.available = function() {
35375 return nodes.length >= 2;
35377 operation.disabled = function() {
35378 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35379 return "too_large";
35380 } else if (someMissing()) {
35381 return "not_downloaded";
35382 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35383 return "connected_to_hidden";
35384 } else if (selectedIDs.some(incompleteRelation)) {
35385 return "incomplete_relation";
35388 function someMissing() {
35389 if (context.inIntro())
35391 var osm = context.connection();
35393 var missing = coords.filter(function(loc) {
35394 return !osm.isDataLoaded(loc);
35396 if (missing.length) {
35397 missing.forEach(function(loc) {
35398 context.loadTileAtLoc(loc);
35405 function incompleteRelation(id2) {
35406 var entity = context.entity(id2);
35407 return entity.type === "relation" && !entity.isComplete(context.graph());
35410 operation.tooltip = function() {
35411 var disable = operation.disabled();
35412 return disable ? _t.append("operations.rotate." + disable + "." + multi) : _t.append("operations.rotate.description." + multi);
35414 operation.annotation = function() {
35415 return selectedIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.rotate.annotation.feature", { n: selectedIDs.length });
35417 operation.id = "rotate";
35418 operation.keys = [_t("operations.rotate.key")];
35419 operation.title = _t.append("operations.rotate.title");
35420 operation.behavior = behaviorOperation(context).which(operation);
35421 operation.mouseOnly = true;
35425 // modules/modes/move.js
35426 function modeMove(context, entityIDs, baseGraph) {
35427 var _tolerancePx = 4;
35432 var keybinding = utilKeybinding("move");
35434 behaviorEdit(context),
35435 operationCircularize(context, entityIDs).behavior,
35436 operationDelete(context, entityIDs).behavior,
35437 operationOrthogonalize(context, entityIDs).behavior,
35438 operationReflectLong(context, entityIDs).behavior,
35439 operationReflectShort(context, entityIDs).behavior,
35440 operationRotate(context, entityIDs).behavior
35442 var annotation = entityIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.move.annotation.feature", { n: entityIDs.length });
35446 var _nudgeInterval;
35447 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35448 function doMove(nudge) {
35449 nudge = nudge || [0, 0];
35451 if (_prevGraph !== context.graph()) {
35453 _origin = context.map().mouseCoordinates();
35454 fn = context.perform;
35456 fn = context.overwrite;
35458 var currMouse = context.map().mouse();
35459 var origMouse = context.projection(_origin);
35460 var delta = geoVecSubtract(geoVecSubtract(currMouse, origMouse), nudge);
35461 fn(actionMove(entityIDs, delta, context.projection, _cache4));
35462 _prevGraph = context.graph();
35464 function startNudge(nudge) {
35465 if (_nudgeInterval)
35466 window.clearInterval(_nudgeInterval);
35467 _nudgeInterval = window.setInterval(function() {
35468 context.map().pan(nudge);
35472 function stopNudge() {
35473 if (_nudgeInterval) {
35474 window.clearInterval(_nudgeInterval);
35475 _nudgeInterval = null;
35480 var nudge = geoViewportEdge(context.map().mouse(), context.map().dimensions());
35487 function finish(d3_event) {
35488 d3_event.stopPropagation();
35489 context.replace(actionNoop(), annotation);
35490 context.enter(modeSelect(context, entityIDs));
35493 function cancel() {
35495 while (context.graph() !== baseGraph)
35497 context.enter(modeBrowse(context));
35501 context.enter(modeSelect(context, entityIDs));
35505 function undone() {
35506 context.enter(modeBrowse(context));
35508 mode.enter = function() {
35509 _origin = context.map().mouseCoordinates();
35512 context.features().forceVisible(entityIDs);
35513 behaviors.forEach(context.install);
35515 context.surface().on(_pointerPrefix + "down.modeMove", function(d3_event) {
35516 downEvent = d3_event;
35518 select_default2(window).on(_pointerPrefix + "move.modeMove", move, true).on(_pointerPrefix + "up.modeMove", function(d3_event) {
35521 var mapNode = context.container().select(".main-map").node();
35522 var pointGetter = utilFastMouse(mapNode);
35523 var p1 = pointGetter(downEvent);
35524 var p2 = pointGetter(d3_event);
35525 var dist = geoVecLength(p1, p2);
35526 if (dist <= _tolerancePx)
35530 context.history().on("undone.modeMove", undone);
35531 keybinding.on("\u238B", cancel).on("\u21A9", finish);
35532 select_default2(document).call(keybinding);
35534 mode.exit = function() {
35536 behaviors.forEach(function(behavior) {
35537 context.uninstall(behavior);
35539 context.surface().on(_pointerPrefix + "down.modeMove", null);
35540 select_default2(window).on(_pointerPrefix + "move.modeMove", null, true).on(_pointerPrefix + "up.modeMove", null, true);
35541 context.history().on("undone.modeMove", null);
35542 select_default2(document).call(keybinding.unbind);
35543 context.features().forceVisible([]);
35545 mode.selectedIDs = function() {
35546 if (!arguments.length)
35553 // modules/behavior/paste.js
35554 function behaviorPaste(context) {
35555 function doPaste(d3_event) {
35556 if (!context.map().withinEditableZoom())
35558 d3_event.preventDefault();
35559 var baseGraph = context.graph();
35560 var mouse = context.map().mouse();
35561 var projection2 = context.projection;
35562 var viewport = geoExtent(projection2.clipExtent()).polygon();
35563 if (!geoPointInPolygon(mouse, viewport))
35565 var oldIDs = context.copyIDs();
35566 if (!oldIDs.length)
35568 var extent = geoExtent();
35569 var oldGraph = context.copyGraph();
35571 var action = actionCopyEntities(oldIDs, oldGraph);
35572 context.perform(action);
35573 var copies = action.copies();
35574 var originals = /* @__PURE__ */ new Set();
35575 Object.values(copies).forEach(function(entity) {
35576 originals.add(entity.id);
35578 for (var id2 in copies) {
35579 var oldEntity = oldGraph.entity(id2);
35580 var newEntity = copies[id2];
35581 extent._extend(oldEntity.extent(oldGraph));
35582 var parents = context.graph().parentWays(newEntity);
35583 var parentCopied = parents.some(function(parent) {
35584 return originals.has(parent.id);
35586 if (!parentCopied) {
35587 newIDs.push(newEntity.id);
35590 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
35591 var delta = geoVecSubtract(mouse, copyPoint);
35592 context.perform(actionMove(newIDs, delta, projection2));
35593 context.enter(modeMove(context, newIDs, baseGraph));
35595 function behavior() {
35596 context.keybinding().on(uiCmd("\u2318V"), doPaste);
35599 behavior.off = function() {
35600 context.keybinding().off(uiCmd("\u2318V"));
35605 // modules/behavior/drag.js
35606 function behaviorDrag() {
35607 var dispatch14 = dispatch_default("start", "move", "end");
35608 var _tolerancePx = 1;
35609 var _penTolerancePx = 4;
35610 var _origin = null;
35611 var _selector = "";
35616 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35617 var d3_event_userSelectProperty = utilPrefixCSSProperty("UserSelect");
35618 var d3_event_userSelectSuppress = function() {
35619 var selection2 = selection_default();
35620 var select = selection2.style(d3_event_userSelectProperty);
35621 selection2.style(d3_event_userSelectProperty, "none");
35622 return function() {
35623 selection2.style(d3_event_userSelectProperty, select);
35626 function pointerdown(d3_event) {
35629 _pointerId = d3_event.pointerId || "mouse";
35630 _targetNode = this;
35631 var pointerLocGetter = utilFastMouse(_surface || _targetNode.parentNode);
35633 var startOrigin = pointerLocGetter(d3_event);
35634 var started = false;
35635 var selectEnable = d3_event_userSelectSuppress();
35636 select_default2(window).on(_pointerPrefix + "move.drag", pointermove).on(_pointerPrefix + "up.drag pointercancel.drag", pointerup, true);
35638 offset = _origin.call(_targetNode, _targetEntity);
35639 offset = [offset[0] - startOrigin[0], offset[1] - startOrigin[1]];
35643 d3_event.stopPropagation();
35644 function pointermove(d3_event2) {
35645 if (_pointerId !== (d3_event2.pointerId || "mouse"))
35647 var p2 = pointerLocGetter(d3_event2);
35649 var dist = geoVecLength(startOrigin, p2);
35650 var tolerance = d3_event2.pointerType === "pen" ? _penTolerancePx : _tolerancePx;
35651 if (dist < tolerance)
35654 dispatch14.call("start", this, d3_event2, _targetEntity);
35657 d3_event2.stopPropagation();
35658 d3_event2.preventDefault();
35659 var dx = p2[0] - startOrigin[0];
35660 var dy = p2[1] - startOrigin[1];
35661 dispatch14.call("move", this, d3_event2, _targetEntity, [p2[0] + offset[0], p2[1] + offset[1]], [dx, dy]);
35664 function pointerup(d3_event2) {
35665 if (_pointerId !== (d3_event2.pointerId || "mouse"))
35669 dispatch14.call("end", this, d3_event2, _targetEntity);
35670 d3_event2.preventDefault();
35672 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
35676 function behavior(selection2) {
35677 var matchesSelector = utilPrefixDOMProperty("matchesSelector");
35678 var delegate = pointerdown;
35680 delegate = function(d3_event) {
35682 var target = d3_event.target;
35683 for (; target && target !== root3; target = target.parentNode) {
35684 var datum2 = target.__data__;
35685 _targetEntity = datum2 instanceof osmNote ? datum2 : datum2 && datum2.properties && datum2.properties.entity;
35686 if (_targetEntity && target[matchesSelector](_selector)) {
35687 return pointerdown.call(target, d3_event);
35692 selection2.on(_pointerPrefix + "down.drag" + _selector, delegate);
35694 behavior.off = function(selection2) {
35695 selection2.on(_pointerPrefix + "down.drag" + _selector, null);
35697 behavior.selector = function(_2) {
35698 if (!arguments.length)
35703 behavior.origin = function(_2) {
35704 if (!arguments.length)
35709 behavior.cancel = function() {
35710 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
35713 behavior.targetNode = function(_2) {
35714 if (!arguments.length)
35715 return _targetNode;
35719 behavior.targetEntity = function(_2) {
35720 if (!arguments.length)
35721 return _targetEntity;
35722 _targetEntity = _2;
35725 behavior.surface = function(_2) {
35726 if (!arguments.length)
35731 return utilRebind(behavior, dispatch14, "on");
35734 // modules/modes/drag_node.js
35735 function modeDragNode(context) {
35740 var hover = behaviorHover(context).altDisables(true).on("hover", context.ui().sidebar.hover);
35741 var edit2 = behaviorEdit(context);
35742 var _nudgeInterval;
35743 var _restoreSelectedIDs = [];
35744 var _wasMidpoint = false;
35745 var _isCancelled = false;
35749 function startNudge(d3_event, entity, nudge) {
35750 if (_nudgeInterval)
35751 window.clearInterval(_nudgeInterval);
35752 _nudgeInterval = window.setInterval(function() {
35753 context.map().pan(nudge);
35754 doMove(d3_event, entity, nudge);
35757 function stopNudge() {
35758 if (_nudgeInterval) {
35759 window.clearInterval(_nudgeInterval);
35760 _nudgeInterval = null;
35763 function moveAnnotation(entity) {
35764 return _t("operations.move.annotation." + entity.geometry(context.graph()));
35766 function connectAnnotation(nodeEntity, targetEntity) {
35767 var nodeGeometry = nodeEntity.geometry(context.graph());
35768 var targetGeometry = targetEntity.geometry(context.graph());
35769 if (nodeGeometry === "vertex" && targetGeometry === "vertex") {
35770 var nodeParentWayIDs = context.graph().parentWays(nodeEntity);
35771 var targetParentWayIDs = context.graph().parentWays(targetEntity);
35772 var sharedParentWays = utilArrayIntersection(nodeParentWayIDs, targetParentWayIDs);
35773 if (sharedParentWays.length !== 0) {
35774 if (sharedParentWays[0].areAdjacent(nodeEntity.id, targetEntity.id)) {
35775 return _t("operations.connect.annotation.from_vertex.to_adjacent_vertex");
35777 return _t("operations.connect.annotation.from_vertex.to_sibling_vertex");
35780 return _t("operations.connect.annotation.from_" + nodeGeometry + ".to_" + targetGeometry);
35782 function shouldSnapToNode(target) {
35783 if (!_activeEntity)
35785 return _activeEntity.geometry(context.graph()) !== "vertex" || (target.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(target, context.graph()));
35787 function origin(entity) {
35788 return context.projection(entity.loc);
35790 function keydown(d3_event) {
35791 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
35792 if (context.surface().classed("nope")) {
35793 context.surface().classed("nope-suppressed", true);
35795 context.surface().classed("nope", false).classed("nope-disabled", true);
35798 function keyup(d3_event) {
35799 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
35800 if (context.surface().classed("nope-suppressed")) {
35801 context.surface().classed("nope", true);
35803 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
35806 function start2(d3_event, entity) {
35807 _wasMidpoint = entity.type === "midpoint";
35808 var hasHidden = context.features().hasHiddenConnections(entity, context.graph());
35809 _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden;
35810 if (_isCancelled) {
35812 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("modes.drag_node.connected_to_hidden"))();
35814 return drag.cancel();
35816 if (_wasMidpoint) {
35817 var midpoint = entity;
35818 entity = osmNode();
35819 context.perform(actionAddMidpoint(midpoint, entity));
35820 entity = context.entity(entity.id);
35821 var vertex = context.surface().selectAll("." + entity.id);
35822 drag.targetNode(vertex.node()).targetEntity(entity);
35824 context.perform(actionNoop());
35826 _activeEntity = entity;
35827 _startLoc = entity.loc;
35828 hover.ignoreVertex(entity.geometry(context.graph()) === "vertex");
35829 context.surface().selectAll("." + _activeEntity.id).classed("active", true);
35830 context.enter(mode);
35832 function datum2(d3_event) {
35833 if (!d3_event || d3_event.altKey) {
35836 var d2 = d3_event.target.__data__;
35837 return d2 && d2.properties && d2.properties.target ? d2 : {};
35840 function doMove(d3_event, entity, nudge) {
35841 nudge = nudge || [0, 0];
35842 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
35843 var currMouse = geoVecSubtract(currPoint, nudge);
35844 var loc = context.projection.invert(currMouse);
35846 if (!_nudgeInterval) {
35847 var d2 = datum2(d3_event);
35848 target = d2 && d2.properties && d2.properties.entity;
35849 var targetLoc = target && target.loc;
35850 var targetNodes = d2 && d2.properties && d2.properties.nodes;
35852 if (shouldSnapToNode(target)) {
35855 } else if (targetNodes) {
35856 edge = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, end.id);
35863 actionMoveNode(entity.id, loc)
35865 var isInvalid = false;
35867 isInvalid = hasRelationConflict(entity, target, edge, context.graph());
35870 isInvalid = hasInvalidGeometry(entity, context.graph());
35872 var nope = context.surface().classed("nope");
35873 if (isInvalid === "relation" || isInvalid === "restriction") {
35875 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(
35876 "operations.connect." + isInvalid,
35877 { relation: _mainPresetIndex.item("type/restriction").name() }
35880 } else if (isInvalid) {
35881 var errorID = isInvalid === "line" ? "lines" : "areas";
35882 context.ui().flash.duration(3e3).iconName("#iD-icon-no").label(_t.append("self_intersection.error." + errorID))();
35885 context.ui().flash.duration(1).label("")();
35888 var nopeDisabled = context.surface().classed("nope-disabled");
35889 if (nopeDisabled) {
35890 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
35892 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
35896 function hasRelationConflict(entity, target, edge, graph) {
35897 var testGraph = graph.update();
35899 var midpoint = osmNode();
35900 var action = actionAddMidpoint({
35902 edge: [target.nodes[edge.index - 1], target.nodes[edge.index]]
35904 testGraph = action(testGraph);
35907 var ids = [entity.id, target.id];
35908 return actionConnect(ids).disabled(testGraph);
35910 function hasInvalidGeometry(entity, graph) {
35911 var parents = graph.parentWays(entity);
35913 for (i3 = 0; i3 < parents.length; i3++) {
35914 var parent = parents[i3];
35916 var activeIndex = null;
35917 var relations = graph.parentRelations(parent);
35918 for (j3 = 0; j3 < relations.length; j3++) {
35919 if (!relations[j3].isMultipolygon())
35921 var rings = osmJoinWays(relations[j3].members, graph);
35922 for (k2 = 0; k2 < rings.length; k2++) {
35923 nodes = rings[k2].nodes;
35924 if (nodes.find(function(n3) {
35925 return n3.id === entity.id;
35928 if (geoHasSelfIntersections(nodes, entity.id)) {
35929 return "multipolygonMember";
35932 rings[k2].coords = nodes.map(function(n3) {
35936 for (k2 = 0; k2 < rings.length; k2++) {
35937 if (k2 === activeIndex)
35939 if (geoHasLineIntersections(rings[activeIndex].nodes, rings[k2].nodes, entity.id)) {
35940 return "multipolygonRing";
35944 if (activeIndex === null) {
35945 nodes = parent.nodes.map(function(nodeID) {
35946 return graph.entity(nodeID);
35948 if (nodes.length && geoHasSelfIntersections(nodes, entity.id)) {
35949 return parent.geometry(graph);
35955 function move(d3_event, entity, point2) {
35958 d3_event.stopPropagation();
35959 context.surface().classed("nope-disabled", d3_event.altKey);
35960 _lastLoc = context.projection.invert(point2);
35961 doMove(d3_event, entity);
35962 var nudge = geoViewportEdge(point2, context.map().dimensions());
35964 startNudge(d3_event, entity, nudge);
35969 function end(d3_event, entity) {
35972 var wasPoint = entity.geometry(context.graph()) === "point";
35973 var d2 = datum2(d3_event);
35974 var nope = d2 && d2.properties && d2.properties.nope || context.surface().classed("nope");
35975 var target = d2 && d2.properties && d2.properties.entity;
35978 _actionBounceBack(entity.id, _startLoc)
35980 } else if (target && target.type === "way") {
35981 var choice = geoChooseEdge(context.graph().childNodes(target), context.map().mouse(), context.projection, entity.id);
35983 actionAddMidpoint({
35985 edge: [target.nodes[choice.index - 1], target.nodes[choice.index]]
35987 connectAnnotation(entity, target)
35989 } else if (target && target.type === "node" && shouldSnapToNode(target)) {
35991 actionConnect([target.id, entity.id]),
35992 connectAnnotation(entity, target)
35994 } else if (_wasMidpoint) {
35997 _t("operations.add.annotation.vertex")
36002 moveAnnotation(entity)
36006 context.enter(modeSelect(context, [entity.id]));
36008 var reselection = _restoreSelectedIDs.filter(function(id2) {
36009 return context.graph().hasEntity(id2);
36011 if (reselection.length) {
36012 context.enter(modeSelect(context, reselection));
36014 context.enter(modeBrowse(context));
36018 function _actionBounceBack(nodeID, toLoc) {
36019 var moveNode = actionMoveNode(nodeID, toLoc);
36020 var action = function(graph, t2) {
36023 return moveNode(graph, t2);
36025 action.transitionable = true;
36028 function cancel() {
36030 context.enter(modeBrowse(context));
36032 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);
36033 mode.enter = function() {
36034 context.install(hover);
36035 context.install(edit2);
36036 select_default2(window).on("keydown.dragNode", keydown).on("keyup.dragNode", keyup);
36037 context.history().on("undone.drag-node", cancel);
36039 mode.exit = function() {
36040 context.ui().sidebar.hover.cancel();
36041 context.uninstall(hover);
36042 context.uninstall(edit2);
36043 select_default2(window).on("keydown.dragNode", null).on("keyup.dragNode", null);
36044 context.history().on("undone.drag-node", null);
36045 _activeEntity = null;
36046 context.surface().classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false).selectAll(".active").classed("active", false);
36049 mode.selectedIDs = function() {
36050 if (!arguments.length)
36051 return _activeEntity ? [_activeEntity.id] : [];
36054 mode.activeID = function() {
36055 if (!arguments.length)
36056 return _activeEntity && _activeEntity.id;
36059 mode.restoreSelectedIDs = function(_2) {
36060 if (!arguments.length)
36061 return _restoreSelectedIDs;
36062 _restoreSelectedIDs = _2;
36065 mode.behavior = drag;
36069 // modules/services/keepRight.js
36070 var import_rbush = __toESM(require_rbush_min());
36072 // node_modules/d3-fetch/src/text.js
36073 function responseText(response) {
36075 throw new Error(response.status + " " + response.statusText);
36076 return response.text();
36078 function text_default3(input, init2) {
36079 return fetch(input, init2).then(responseText);
36082 // node_modules/d3-fetch/src/json.js
36083 function responseJson(response) {
36085 throw new Error(response.status + " " + response.statusText);
36086 if (response.status === 204 || response.status === 205)
36088 return response.json();
36090 function json_default(input, init2) {
36091 return fetch(input, init2).then(responseJson);
36094 // node_modules/d3-fetch/src/xml.js
36095 function parser(type2) {
36096 return (input, init2) => text_default3(input, init2).then((text2) => new DOMParser().parseFromString(text2, type2));
36098 var xml_default = parser("application/xml");
36099 var html = parser("text/html");
36100 var svg = parser("image/svg+xml");
36102 // modules/services/keepRight.js
36103 var tiler = utilTiler();
36104 var dispatch2 = dispatch_default("loaded");
36105 var _tileZoom = 14;
36106 var _krUrlRoot = "https://www.keepright.at";
36107 var _krData = { errorTypes: {}, localizeStrings: {} };
36110 // no 20 - multiple node on same spot - these are mostly boundaries overlapping roads
36183 function abortRequest(controller) {
36185 controller.abort();
36188 function abortUnwantedRequests(cache, tiles) {
36189 Object.keys(cache.inflightTile).forEach((k2) => {
36190 const wanted = tiles.find((tile) => k2 === tile.id);
36192 abortRequest(cache.inflightTile[k2]);
36193 delete cache.inflightTile[k2];
36197 function encodeIssueRtree(d2) {
36198 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
36200 function updateRtree(item, replace) {
36201 _cache.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
36203 _cache.rtree.insert(item);
36206 function tokenReplacements(d2) {
36207 if (!(d2 instanceof QAItem))
36209 const replacements = {};
36210 const issueTemplate = _krData.errorTypes[d2.whichType];
36211 if (!issueTemplate) {
36212 console.log("No Template: ", d2.whichType);
36213 console.log(" ", d2.description);
36216 if (!issueTemplate.regex)
36218 const errorRegex = new RegExp(issueTemplate.regex, "i");
36219 const errorMatch = errorRegex.exec(d2.description);
36221 console.log("Unmatched: ", d2.whichType);
36222 console.log(" ", d2.description);
36223 console.log(" ", errorRegex);
36226 for (let i3 = 1; i3 < errorMatch.length; i3++) {
36227 let capture = errorMatch[i3];
36229 idType = "IDs" in issueTemplate ? issueTemplate.IDs[i3 - 1] : "";
36230 if (idType && capture) {
36231 capture = parseError(capture, idType);
36233 const compare = capture.toLowerCase();
36234 if (_krData.localizeStrings[compare]) {
36235 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare]);
36237 capture = unescape_default(capture);
36240 replacements["var" + i3] = capture;
36242 return replacements;
36244 function parseError(capture, idType) {
36245 const compare = capture.toLowerCase();
36246 if (_krData.localizeStrings[compare]) {
36247 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare]);
36251 capture = linkErrorObject2(capture);
36254 capture = linkURL(capture);
36259 capture = linkEntity2(idType + capture);
36262 capture = parse20(capture);
36265 capture = parse211(capture);
36268 capture = parse231(capture);
36271 capture = parse294(capture);
36274 capture = parse370(capture);
36278 function linkErrorObject2(d2) {
36279 return { html: `<a class="error_object_link">${d2}</a>` };
36281 function linkEntity2(d2) {
36282 return { html: `<a class="error_entity_link">${d2}</a>` };
36284 function linkURL(d2) {
36285 return { html: `<a class="kr_external_link" target="_blank" href="${d2}">${d2}</a>` };
36287 function parse211(capture2) {
36289 const items = capture2.split(", ");
36290 items.forEach((item) => {
36291 let id2 = linkEntity2("n" + item.slice(1));
36294 return newList.join(", ");
36296 function parse231(capture2) {
36298 const items = capture2.split("),");
36299 items.forEach((item) => {
36300 const match = item.match(/\#(\d+)\((.+)\)?/);
36301 if (match !== null && match.length > 2) {
36303 linkEntity2("w" + match[1]) + " " + _t("QA.keepRight.errorTypes.231.layer", { layer: match[2] })
36307 return newList.join(", ");
36309 function parse294(capture2) {
36311 const items = capture2.split(",");
36312 items.forEach((item) => {
36313 item = item.split(" ");
36314 const role = `"${item[0]}"`;
36315 const idType2 = item[1].slice(0, 1);
36316 let id2 = item[2].slice(1);
36317 id2 = linkEntity2(idType2 + id2);
36318 newList.push(`${role} ${item[1]} ${id2}`);
36320 return newList.join(", ");
36322 function parse370(capture2) {
36325 const match = capture2.match(/\(including the name (\'.+\')\)/);
36326 if (match && match.length) {
36327 return _t("QA.keepRight.errorTypes.370.including_the_name", { name: match[1] });
36331 function parse20(capture2) {
36333 const items = capture2.split(",");
36334 items.forEach((item) => {
36335 const id2 = linkEntity2("n" + item.slice(1));
36338 return newList.join(", ");
36341 var keepRight_default = {
36342 title: "keepRight",
36344 _mainFileFetcher.get("keepRight").then((d2) => _krData = d2);
36348 this.event = utilRebind(this, dispatch2, "on");
36352 Object.values(_cache.inflightTile).forEach(abortRequest);
36360 rtree: new import_rbush.default()
36363 // KeepRight API: http://osm.mueschelsoft.de/keepright/interfacing.php
36364 loadIssues(projection2) {
36369 const tiles = tiler.zoomExtent([_tileZoom, _tileZoom]).getTiles(projection2);
36370 abortUnwantedRequests(_cache, tiles);
36371 tiles.forEach((tile) => {
36372 if (_cache.loadedTile[tile.id] || _cache.inflightTile[tile.id])
36374 const [left, top, right, bottom] = tile.extent.rectangle();
36375 const params = Object.assign({}, options2, { left, bottom, right, top });
36376 const url = `${_krUrlRoot}/export.php?` + utilQsString(params);
36377 const controller = new AbortController();
36378 _cache.inflightTile[tile.id] = controller;
36379 json_default(url, { signal: controller.signal }).then((data) => {
36380 delete _cache.inflightTile[tile.id];
36381 _cache.loadedTile[tile.id] = true;
36382 if (!data || !data.features || !data.features.length) {
36383 throw new Error("No Data");
36385 data.features.forEach((feature3) => {
36388 error_type: itemType,
36391 object_id: objectId,
36392 object_type: objectType,
36398 geometry: { coordinates: loc },
36399 properties: { description = "" }
36401 const issueTemplate = _krData.errorTypes[itemType];
36402 const parentIssueType = (Math.floor(itemType / 10) * 10).toString();
36403 const whichType = issueTemplate ? itemType : parentIssueType;
36404 const whichTemplate = _krData.errorTypes[whichType];
36405 switch (whichType) {
36407 description = `This feature has a FIXME tag: ${description}`;
36411 description = description.replace("A turn-", "This turn-");
36418 description = `This turn-restriction~${description}`;
36421 description = "This highway is missing a maxspeed tag";
36426 description = `This feature~${description}`;
36429 let coincident = false;
36431 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
36432 loc = geoVecAdd(loc, delta);
36433 let bbox2 = geoExtent(loc).bbox();
36434 coincident = _cache.rtree.search(bbox2).length;
36435 } while (coincident);
36436 let d2 = new QAItem(loc, this, itemType, id2, {
36441 severity: whichTemplate.severity || "error",
36447 d2.replacements = tokenReplacements(d2);
36448 _cache.data[id2] = d2;
36449 _cache.rtree.insert(encodeIssueRtree(d2));
36451 dispatch2.call("loaded");
36453 delete _cache.inflightTile[tile.id];
36454 _cache.loadedTile[tile.id] = true;
36458 postUpdate(d2, callback) {
36459 if (_cache.inflightPost[d2.id]) {
36460 return callback({ message: "Error update already inflight", status: -2 }, d2);
36462 const params = { schema: d2.schema, id: d2.id };
36463 if (d2.newStatus) {
36464 params.st = d2.newStatus;
36466 if (d2.newComment !== void 0) {
36467 params.co = d2.newComment;
36469 const url = `${_krUrlRoot}/comment.php?` + utilQsString(params);
36470 const controller = new AbortController();
36471 _cache.inflightPost[d2.id] = controller;
36472 json_default(url, { signal: controller.signal }).finally(() => {
36473 delete _cache.inflightPost[d2.id];
36474 if (d2.newStatus === "ignore") {
36475 this.removeItem(d2);
36476 } else if (d2.newStatus === "ignore_t") {
36477 this.removeItem(d2);
36478 _cache.closed[`${d2.schema}:${d2.id}`] = true;
36480 d2 = this.replaceItem(d2.update({
36481 comment: d2.newComment,
36482 newComment: void 0,
36487 callback(null, d2);
36490 // Get all cached QAItems covering the viewport
36491 getItems(projection2) {
36492 const viewport = projection2.clipExtent();
36493 const min3 = [viewport[0][0], viewport[1][1]];
36494 const max3 = [viewport[1][0], viewport[0][1]];
36495 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
36496 return _cache.rtree.search(bbox2).map((d2) => d2.data);
36498 // Get a QAItem from cache
36499 // NOTE: Don't change method name until UI v3 is merged
36501 return _cache.data[id2];
36503 // Replace a single QAItem in the cache
36504 replaceItem(item) {
36505 if (!(item instanceof QAItem) || !item.id)
36507 _cache.data[item.id] = item;
36508 updateRtree(encodeIssueRtree(item), true);
36511 // Remove a single QAItem from the cache
36513 if (!(item instanceof QAItem) || !item.id)
36515 delete _cache.data[item.id];
36516 updateRtree(encodeIssueRtree(item), false);
36519 return `${_krUrlRoot}/report_map.php?schema=${item.schema}&error=${item.id}`;
36521 // Get an array of issues closed during this session.
36522 // Used to populate `closed:keepright` changeset tag
36524 return Object.keys(_cache.closed).sort();
36528 // modules/services/improveOSM.js
36529 var import_rbush2 = __toESM(require_rbush_min());
36530 var tiler2 = utilTiler();
36531 var dispatch3 = dispatch_default("loaded");
36532 var _tileZoom2 = 14;
36533 var _impOsmUrls = {
36534 ow: "https://grab.community.improve-osm.org/directionOfFlowService",
36535 mr: "https://grab.community.improve-osm.org/missingGeoService",
36536 tr: "https://grab.community.improve-osm.org/turnRestrictionService"
36538 var _impOsmData = { icons: {} };
36540 function abortRequest2(i3) {
36541 Object.values(i3).forEach((controller) => {
36543 controller.abort();
36547 function abortUnwantedRequests2(cache, tiles) {
36548 Object.keys(cache.inflightTile).forEach((k2) => {
36549 const wanted = tiles.find((tile) => k2 === tile.id);
36551 abortRequest2(cache.inflightTile[k2]);
36552 delete cache.inflightTile[k2];
36556 function encodeIssueRtree2(d2) {
36557 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
36559 function updateRtree2(item, replace) {
36560 _cache2.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
36562 _cache2.rtree.insert(item);
36565 function linkErrorObject(d2) {
36566 return { html: `<a class="error_object_link">${d2}</a>` };
36568 function linkEntity(d2) {
36569 return { html: `<a class="error_entity_link">${d2}</a>` };
36571 function pointAverage(points) {
36572 if (points.length) {
36573 const sum = points.reduce(
36574 (acc, point2) => geoVecAdd(acc, [point2.lon, point2.lat]),
36577 return geoVecScale(sum, 1 / points.length);
36582 function relativeBearing(p1, p2) {
36583 let angle2 = Math.atan2(p2.lon - p1.lon, p2.lat - p1.lat);
36585 angle2 += 2 * Math.PI;
36587 return angle2 * 180 / Math.PI;
36589 function cardinalDirection(bearing) {
36590 const dir = 45 * Math.round(bearing / 45);
36602 return _t(`QA.improveOSM.directions.${compass[dir]}`);
36604 function preventCoincident(loc, bumpUp) {
36605 let coincident = false;
36607 let delta = coincident ? [1e-5, 0] : bumpUp ? [0, 1e-5] : [0, 0];
36608 loc = geoVecAdd(loc, delta);
36609 let bbox2 = geoExtent(loc).bbox();
36610 coincident = _cache2.rtree.search(bbox2).length;
36611 } while (coincident);
36614 var improveOSM_default = {
36615 title: "improveOSM",
36617 _mainFileFetcher.get("qa_data").then((d2) => _impOsmData = d2.improveOSM);
36621 this.event = utilRebind(this, dispatch3, "on");
36625 Object.values(_cache2.inflightTile).forEach(abortRequest2);
36633 rtree: new import_rbush2.default()
36636 loadIssues(projection2) {
36641 // Use a high zoom so that clusters aren't returned
36643 const tiles = tiler2.zoomExtent([_tileZoom2, _tileZoom2]).getTiles(projection2);
36644 abortUnwantedRequests2(_cache2, tiles);
36645 tiles.forEach((tile) => {
36646 if (_cache2.loadedTile[tile.id] || _cache2.inflightTile[tile.id])
36648 const [east, north, west, south] = tile.extent.rectangle();
36649 const params = Object.assign({}, options2, { east, south, west, north });
36650 const requests = {};
36651 Object.keys(_impOsmUrls).forEach((k2) => {
36652 const kParams = Object.assign(
36655 k2 === "mr" ? { type: "PARKING,ROAD,BOTH,PATH" } : { confidenceLevel: "C1" }
36657 const url = `${_impOsmUrls[k2]}/search?` + utilQsString(kParams);
36658 const controller = new AbortController();
36659 requests[k2] = controller;
36660 json_default(url, { signal: controller.signal }).then((data) => {
36661 delete _cache2.inflightTile[tile.id][k2];
36662 if (!Object.keys(_cache2.inflightTile[tile.id]).length) {
36663 delete _cache2.inflightTile[tile.id];
36664 _cache2.loadedTile[tile.id] = true;
36666 if (data.roadSegments) {
36667 data.roadSegments.forEach((feature3) => {
36668 const { points, wayId, fromNodeId, toNodeId } = feature3;
36669 const itemId = `${wayId}${fromNodeId}${toNodeId}`;
36670 let mid = points.length / 2;
36672 if (mid % 1 === 0) {
36673 loc = pointAverage([points[mid - 1], points[mid]]);
36675 mid = points[Math.floor(mid)];
36676 loc = [mid.lon, mid.lat];
36678 loc = preventCoincident(loc, false);
36679 let d2 = new QAItem(loc, this, k2, itemId, {
36681 // used as a category
36683 // used to post changes
36691 d2.replacements = {
36692 percentage: feature3.percentOfTrips,
36693 num_trips: feature3.numberOfTrips,
36694 highway: linkErrorObject(_t("QA.keepRight.error_parts.highway")),
36695 from_node: linkEntity("n" + feature3.fromNodeId),
36696 to_node: linkEntity("n" + feature3.toNodeId)
36698 _cache2.data[d2.id] = d2;
36699 _cache2.rtree.insert(encodeIssueRtree2(d2));
36703 data.tiles.forEach((feature3) => {
36704 const { type: type2, x: x2, y: y2, numberOfTrips } = feature3;
36705 const geoType = type2.toLowerCase();
36706 const itemId = `${geoType}${x2}${y2}${numberOfTrips}`;
36707 let loc = pointAverage(feature3.points);
36708 loc = preventCoincident(loc, false);
36709 let d2 = new QAItem(loc, this, `${k2}-${geoType}`, itemId, {
36711 identifier: { x: x2, y: y2 }
36713 d2.replacements = {
36714 num_trips: numberOfTrips,
36715 geometry_type: _t(`QA.improveOSM.geometry_types.${geoType}`)
36717 if (numberOfTrips === -1) {
36718 d2.desc = _t("QA.improveOSM.error_types.mr.description_alt", d2.replacements);
36720 _cache2.data[d2.id] = d2;
36721 _cache2.rtree.insert(encodeIssueRtree2(d2));
36724 if (data.entities) {
36725 data.entities.forEach((feature3) => {
36726 const { point: point2, id: id2, segments, numberOfPasses, turnType } = feature3;
36727 const itemId = `${id2.replace(/[,:+#]/g, "_")}`;
36728 const loc = preventCoincident([point2.lon, point2.lat], true);
36729 const ids = id2.split(",");
36730 const from_way = ids[0];
36731 const via_node = ids[3];
36732 const to_way = ids[2].split(":")[1];
36733 let d2 = new QAItem(loc, this, k2, itemId, {
36736 objectId: via_node,
36739 const [p1, p2] = segments[0].points;
36740 const dir_of_travel = cardinalDirection(relativeBearing(p1, p2));
36741 d2.replacements = {
36742 num_passed: numberOfPasses,
36743 num_trips: segments[0].numberOfTrips,
36744 turn_restriction: turnType.toLowerCase(),
36745 from_way: linkEntity("w" + from_way),
36746 to_way: linkEntity("w" + to_way),
36747 travel_direction: dir_of_travel,
36748 junction: linkErrorObject(_t("QA.keepRight.error_parts.this_node"))
36750 _cache2.data[d2.id] = d2;
36751 _cache2.rtree.insert(encodeIssueRtree2(d2));
36752 dispatch3.call("loaded");
36756 delete _cache2.inflightTile[tile.id][k2];
36757 if (!Object.keys(_cache2.inflightTile[tile.id]).length) {
36758 delete _cache2.inflightTile[tile.id];
36759 _cache2.loadedTile[tile.id] = true;
36763 _cache2.inflightTile[tile.id] = requests;
36766 getComments(item) {
36767 if (item.comments) {
36768 return Promise.resolve(item);
36770 const key = item.issueKey;
36772 if (key === "ow") {
36773 qParams = item.identifier;
36774 } else if (key === "mr") {
36775 qParams.tileX = item.identifier.x;
36776 qParams.tileY = item.identifier.y;
36777 } else if (key === "tr") {
36778 qParams.targetId = item.identifier;
36780 const url = `${_impOsmUrls[key]}/retrieveComments?` + utilQsString(qParams);
36781 const cacheComments = (data) => {
36782 item.comments = data.comments ? data.comments.reverse() : [];
36783 this.replaceItem(item);
36785 return json_default(url).then(cacheComments).then(() => item);
36787 postUpdate(d2, callback) {
36788 if (!osm_default.authenticated()) {
36789 return callback({ message: "Not Authenticated", status: -3 }, d2);
36791 if (_cache2.inflightPost[d2.id]) {
36792 return callback({ message: "Error update already inflight", status: -2 }, d2);
36794 osm_default.userDetails(sendPayload.bind(this));
36795 function sendPayload(err, user) {
36797 return callback(err, d2);
36799 const key = d2.issueKey;
36800 const url = `${_impOsmUrls[key]}/comment`;
36802 username: user.display_name,
36803 targetIds: [d2.identifier]
36805 if (d2.newStatus) {
36806 payload.status = d2.newStatus;
36807 payload.text = "status changed";
36809 if (d2.newComment) {
36810 payload.text = d2.newComment;
36812 const controller = new AbortController();
36813 _cache2.inflightPost[d2.id] = controller;
36816 signal: controller.signal,
36817 body: JSON.stringify(payload)
36819 json_default(url, options2).then(() => {
36820 delete _cache2.inflightPost[d2.id];
36821 if (!d2.newStatus) {
36822 const now3 = /* @__PURE__ */ new Date();
36823 let comments = d2.comments ? d2.comments : [];
36825 username: payload.username,
36826 text: payload.text,
36827 timestamp: now3.getTime() / 1e3
36829 this.replaceItem(d2.update({
36834 this.removeItem(d2);
36835 if (d2.newStatus === "SOLVED") {
36836 if (!(d2.issueKey in _cache2.closed)) {
36837 _cache2.closed[d2.issueKey] = 0;
36839 _cache2.closed[d2.issueKey] += 1;
36843 callback(null, d2);
36844 }).catch((err2) => {
36845 delete _cache2.inflightPost[d2.id];
36847 callback(err2.message);
36851 // Get all cached QAItems covering the viewport
36852 getItems(projection2) {
36853 const viewport = projection2.clipExtent();
36854 const min3 = [viewport[0][0], viewport[1][1]];
36855 const max3 = [viewport[1][0], viewport[0][1]];
36856 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
36857 return _cache2.rtree.search(bbox2).map((d2) => d2.data);
36859 // Get a QAItem from cache
36860 // NOTE: Don't change method name until UI v3 is merged
36862 return _cache2.data[id2];
36864 // get the name of the icon to display for this item
36865 getIcon(itemType) {
36866 return _impOsmData.icons[itemType];
36868 // Replace a single QAItem in the cache
36869 replaceItem(issue) {
36870 if (!(issue instanceof QAItem) || !issue.id)
36872 _cache2.data[issue.id] = issue;
36873 updateRtree2(encodeIssueRtree2(issue), true);
36876 // Remove a single QAItem from the cache
36877 removeItem(issue) {
36878 if (!(issue instanceof QAItem) || !issue.id)
36880 delete _cache2.data[issue.id];
36881 updateRtree2(encodeIssueRtree2(issue), false);
36883 // Used to populate `closed:improveosm:*` changeset tags
36884 getClosedCounts() {
36885 return _cache2.closed;
36889 // modules/services/osmose.js
36890 var import_rbush3 = __toESM(require_rbush_min());
36892 // node_modules/marked/lib/marked.esm.js
36893 function _getDefaults() {
36904 langPrefix: "language-",
36911 smartypants: false,
36917 var _defaults = _getDefaults();
36918 function changeDefaults(newDefaults) {
36919 _defaults = newDefaults;
36921 var escapeTest = /[&<>"']/;
36922 var escapeReplace = new RegExp(escapeTest.source, "g");
36923 var escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
36924 var escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g");
36925 var escapeReplacements = {
36932 var getEscapeReplacement = (ch) => escapeReplacements[ch];
36933 function escape4(html2, encode) {
36935 if (escapeTest.test(html2)) {
36936 return html2.replace(escapeReplace, getEscapeReplacement);
36939 if (escapeTestNoEncode.test(html2)) {
36940 return html2.replace(escapeReplaceNoEncode, getEscapeReplacement);
36945 var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
36946 function unescape3(html2) {
36947 return html2.replace(unescapeTest, (_2, n3) => {
36948 n3 = n3.toLowerCase();
36949 if (n3 === "colon")
36951 if (n3.charAt(0) === "#") {
36952 return n3.charAt(1) === "x" ? String.fromCharCode(parseInt(n3.substring(2), 16)) : String.fromCharCode(+n3.substring(1));
36957 var caret = /(^|[^\[])\^/g;
36958 function edit(regex, opt) {
36959 regex = typeof regex === "string" ? regex : regex.source;
36962 replace: (name, val) => {
36963 val = typeof val === "object" && "source" in val ? val.source : val;
36964 val = val.replace(caret, "$1");
36965 regex = regex.replace(name, val);
36969 return new RegExp(regex, opt);
36974 var nonWordAndColonTest = /[^\w:]/g;
36975 var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
36976 function cleanUrl(sanitize, base, href) {
36980 prot = decodeURIComponent(unescape3(href)).replace(nonWordAndColonTest, "").toLowerCase();
36984 if (prot.indexOf("javascript:") === 0 || prot.indexOf("vbscript:") === 0 || prot.indexOf("data:") === 0) {
36988 if (base && !originIndependentUrl.test(href)) {
36989 href = resolveUrl(base, href);
36992 href = encodeURI(href).replace(/%25/g, "%");
36999 var justDomain = /^[^:]+:\/*[^/]*$/;
37000 var protocol = /^([^:]+:)[\s\S]*$/;
37001 var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
37002 function resolveUrl(base, href) {
37003 if (!baseUrls[" " + base]) {
37004 if (justDomain.test(base)) {
37005 baseUrls[" " + base] = base + "/";
37007 baseUrls[" " + base] = rtrim(base, "/", true);
37010 base = baseUrls[" " + base];
37011 const relativeBase = base.indexOf(":") === -1;
37012 if (href.substring(0, 2) === "//") {
37013 if (relativeBase) {
37016 return base.replace(protocol, "$1") + href;
37017 } else if (href.charAt(0) === "/") {
37018 if (relativeBase) {
37021 return base.replace(domain, "$1") + href;
37023 return base + href;
37026 var noopTest = { exec: () => null };
37027 function splitCells(tableRow, count) {
37028 const row = tableRow.replace(/\|/g, (match, offset, str2) => {
37029 let escaped = false, curr = offset;
37030 while (--curr >= 0 && str2[curr] === "\\")
37031 escaped = !escaped;
37037 }), cells = row.split(/ \|/);
37039 if (!cells[0].trim()) {
37042 if (cells.length > 0 && !cells[cells.length - 1].trim()) {
37046 if (cells.length > count) {
37047 cells.splice(count);
37049 while (cells.length < count)
37053 for (; i3 < cells.length; i3++) {
37054 cells[i3] = cells[i3].trim().replace(/\\\|/g, "|");
37058 function rtrim(str2, c2, invert) {
37059 const l2 = str2.length;
37064 while (suffLen < l2) {
37065 const currChar = str2.charAt(l2 - suffLen - 1);
37066 if (currChar === c2 && !invert) {
37068 } else if (currChar !== c2 && invert) {
37074 return str2.slice(0, l2 - suffLen);
37076 function findClosingBracket(str2, b2) {
37077 if (str2.indexOf(b2[1]) === -1) {
37080 const l2 = str2.length;
37081 let level = 0, i3 = 0;
37082 for (; i3 < l2; i3++) {
37083 if (str2[i3] === "\\") {
37085 } else if (str2[i3] === b2[0]) {
37087 } else if (str2[i3] === b2[1]) {
37096 function checkDeprecations(opt, callback) {
37097 if (!opt || opt.silent) {
37101 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");
37103 if (opt.sanitize || opt.sanitizer) {
37104 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");
37106 if (opt.highlight || opt.langPrefix !== "language-") {
37107 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.");
37110 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}`.");
37113 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.");
37115 if (opt.smartypants) {
37116 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.");
37119 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.");
37121 if (opt.headerIds || opt.headerPrefix) {
37122 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}`.");
37125 function outputLink(cap, link2, raw, lexer2) {
37126 const href = link2.href;
37127 const title = link2.title ? escape4(link2.title) : null;
37128 const text2 = cap[1].replace(/\\([\[\]])/g, "$1");
37129 if (cap[0].charAt(0) !== "!") {
37130 lexer2.state.inLink = true;
37137 tokens: lexer2.inlineTokens(text2)
37139 lexer2.state.inLink = false;
37147 text: escape4(text2)
37150 function indentCodeCompensation(raw, text2) {
37151 const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
37152 if (matchIndentToCode === null) {
37155 const indentToCode = matchIndentToCode[1];
37156 return text2.split("\n").map((node) => {
37157 const matchIndentInNode = node.match(/^\s+/);
37158 if (matchIndentInNode === null) {
37161 const [indentInNode] = matchIndentInNode;
37162 if (indentInNode.length >= indentToCode.length) {
37163 return node.slice(indentToCode.length);
37168 var _Tokenizer = class {
37172 constructor(options2) {
37173 this.options = options2 || _defaults;
37176 const cap = this.rules.block.newline.exec(src);
37177 if (cap && cap[0].length > 0) {
37185 const cap = this.rules.block.code.exec(src);
37187 const text2 = cap[0].replace(/^ {1,4}/gm, "");
37191 codeBlockStyle: "indented",
37192 text: !this.options.pedantic ? rtrim(text2, "\n") : text2
37197 const cap = this.rules.block.fences.exec(src);
37199 const raw = cap[0];
37200 const text2 = indentCodeCompensation(raw, cap[3] || "");
37204 lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, "$1") : cap[2],
37210 const cap = this.rules.block.heading.exec(src);
37212 let text2 = cap[2].trim();
37213 if (/#$/.test(text2)) {
37214 const trimmed = rtrim(text2, "#");
37215 if (this.options.pedantic) {
37216 text2 = trimmed.trim();
37217 } else if (!trimmed || / $/.test(trimmed)) {
37218 text2 = trimmed.trim();
37224 depth: cap[1].length,
37226 tokens: this.lexer.inline(text2)
37231 const cap = this.rules.block.hr.exec(src);
37240 const cap = this.rules.block.blockquote.exec(src);
37242 const text2 = cap[0].replace(/^ *>[ \t]?/gm, "");
37243 const top = this.lexer.state.top;
37244 this.lexer.state.top = true;
37245 const tokens = this.lexer.blockTokens(text2);
37246 this.lexer.state.top = top;
37248 type: "blockquote",
37256 let cap = this.rules.block.list.exec(src);
37258 let raw, istask, ischecked, indent2, i3, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
37259 let bull = cap[1].trim();
37260 const isordered = bull.length > 1;
37264 ordered: isordered,
37265 start: isordered ? +bull.slice(0, -1) : "",
37269 bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
37270 if (this.options.pedantic) {
37271 bull = isordered ? bull : "[*+-]";
37273 const itemRegex = new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`);
37276 if (!(cap = itemRegex.exec(src))) {
37279 if (this.rules.block.hr.test(src)) {
37283 src = src.substring(raw.length);
37284 line = cap[2].split("\n", 1)[0].replace(/^\t+/, (t2) => " ".repeat(3 * t2.length));
37285 nextLine = src.split("\n", 1)[0];
37286 if (this.options.pedantic) {
37288 itemContents = line.trimLeft();
37290 indent2 = cap[2].search(/[^ ]/);
37291 indent2 = indent2 > 4 ? 1 : indent2;
37292 itemContents = line.slice(indent2);
37293 indent2 += cap[1].length;
37296 if (!line && /^ *$/.test(nextLine)) {
37297 raw += nextLine + "\n";
37298 src = src.substring(nextLine.length + 1);
37302 const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`);
37303 const hrRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
37304 const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}(?:\`\`\`|~~~)`);
37305 const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}#`);
37307 rawLine = src.split("\n", 1)[0];
37308 nextLine = rawLine;
37309 if (this.options.pedantic) {
37310 nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ");
37312 if (fencesBeginRegex.test(nextLine)) {
37315 if (headingBeginRegex.test(nextLine)) {
37318 if (nextBulletRegex.test(nextLine)) {
37321 if (hrRegex.test(src)) {
37324 if (nextLine.search(/[^ ]/) >= indent2 || !nextLine.trim()) {
37325 itemContents += "\n" + nextLine.slice(indent2);
37330 if (line.search(/[^ ]/) >= 4) {
37333 if (fencesBeginRegex.test(line)) {
37336 if (headingBeginRegex.test(line)) {
37339 if (hrRegex.test(line)) {
37342 itemContents += "\n" + nextLine;
37344 if (!blankLine && !nextLine.trim()) {
37347 raw += rawLine + "\n";
37348 src = src.substring(rawLine.length + 1);
37349 line = nextLine.slice(indent2);
37353 if (endsWithBlankLine) {
37355 } else if (/\n *\n *$/.test(raw)) {
37356 endsWithBlankLine = true;
37359 if (this.options.gfm) {
37360 istask = /^\[[ xX]\] /.exec(itemContents);
37362 ischecked = istask[0] !== "[ ] ";
37363 itemContents = itemContents.replace(/^\[[ xX]\] +/, "");
37370 checked: ischecked,
37376 list.items[list.items.length - 1].raw = raw.trimRight();
37377 list.items[list.items.length - 1].text = itemContents.trimRight();
37378 list.raw = list.raw.trimRight();
37379 const l2 = list.items.length;
37380 for (i3 = 0; i3 < l2; i3++) {
37381 this.lexer.state.top = false;
37382 list.items[i3].tokens = this.lexer.blockTokens(list.items[i3].text, []);
37384 const spacers = list.items[i3].tokens.filter((t2) => t2.type === "space");
37385 const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t2) => /\n.*\n/.test(t2.raw));
37386 list.loose = hasMultipleLineBreaks;
37390 for (i3 = 0; i3 < l2; i3++) {
37391 list.items[i3].loose = true;
37398 const cap = this.rules.block.html.exec(src);
37404 pre: !this.options.sanitizer && (cap[1] === "pre" || cap[1] === "script" || cap[1] === "style"),
37407 if (this.options.sanitize) {
37408 const text2 = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]);
37409 const paragraph = token;
37410 paragraph.type = "paragraph";
37411 paragraph.text = text2;
37412 paragraph.tokens = this.lexer.inline(text2);
37418 const cap = this.rules.block.def.exec(src);
37420 const tag = cap[1].toLowerCase().replace(/\s+/g, " ");
37421 const href = cap[2] ? cap[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "";
37422 const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, "$1") : cap[3];
37433 const cap = this.rules.block.table.exec(src);
37438 header: splitCells(cap[1]).map((c2) => {
37439 return { text: c2 };
37441 align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
37442 rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, "").split("\n") : []
37444 if (item.header.length === item.align.length) {
37445 let l2 = item.align.length;
37446 let i3, j3, k2, row;
37447 for (i3 = 0; i3 < l2; i3++) {
37448 if (/^ *-+: *$/.test(item.align[i3])) {
37449 item.align[i3] = "right";
37450 } else if (/^ *:-+: *$/.test(item.align[i3])) {
37451 item.align[i3] = "center";
37452 } else if (/^ *:-+ *$/.test(item.align[i3])) {
37453 item.align[i3] = "left";
37455 item.align[i3] = null;
37458 l2 = item.rows.length;
37459 for (i3 = 0; i3 < l2; i3++) {
37460 item.rows[i3] = splitCells(item.rows[i3], item.header.length).map((c2) => {
37461 return { text: c2 };
37464 l2 = item.header.length;
37465 for (j3 = 0; j3 < l2; j3++) {
37466 item.header[j3].tokens = this.lexer.inline(item.header[j3].text);
37468 l2 = item.rows.length;
37469 for (j3 = 0; j3 < l2; j3++) {
37470 row = item.rows[j3];
37471 for (k2 = 0; k2 < row.length; k2++) {
37472 row[k2].tokens = this.lexer.inline(row[k2].text);
37480 const cap = this.rules.block.lheading.exec(src);
37485 depth: cap[2].charAt(0) === "=" ? 1 : 2,
37487 tokens: this.lexer.inline(cap[1])
37492 const cap = this.rules.block.paragraph.exec(src);
37494 const text2 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
37499 tokens: this.lexer.inline(text2)
37504 const cap = this.rules.block.text.exec(src);
37510 tokens: this.lexer.inline(cap[0])
37515 const cap = this.rules.inline.escape.exec(src);
37520 text: escape4(cap[1])
37525 const cap = this.rules.inline.tag.exec(src);
37527 if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
37528 this.lexer.state.inLink = true;
37529 } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
37530 this.lexer.state.inLink = false;
37532 if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
37533 this.lexer.state.inRawBlock = true;
37534 } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
37535 this.lexer.state.inRawBlock = false;
37538 type: this.options.sanitize ? "text" : "html",
37540 inLink: this.lexer.state.inLink,
37541 inRawBlock: this.lexer.state.inRawBlock,
37543 text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]) : cap[0]
37548 const cap = this.rules.inline.link.exec(src);
37550 const trimmedUrl = cap[2].trim();
37551 if (!this.options.pedantic && /^</.test(trimmedUrl)) {
37552 if (!/>$/.test(trimmedUrl)) {
37555 const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
37556 if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
37560 const lastParenIndex = findClosingBracket(cap[2], "()");
37561 if (lastParenIndex > -1) {
37562 const start2 = cap[0].indexOf("!") === 0 ? 5 : 4;
37563 const linkLen = start2 + cap[1].length + lastParenIndex;
37564 cap[2] = cap[2].substring(0, lastParenIndex);
37565 cap[0] = cap[0].substring(0, linkLen).trim();
37571 if (this.options.pedantic) {
37572 const link2 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
37578 title = cap[3] ? cap[3].slice(1, -1) : "";
37580 href = href.trim();
37581 if (/^</.test(href)) {
37582 if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
37583 href = href.slice(1);
37585 href = href.slice(1, -1);
37588 return outputLink(cap, {
37589 href: href ? href.replace(this.rules.inline._escapes, "$1") : href,
37590 title: title ? title.replace(this.rules.inline._escapes, "$1") : title
37591 }, cap[0], this.lexer);
37594 reflink(src, links) {
37596 if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
37597 let link2 = (cap[2] || cap[1]).replace(/\s+/g, " ");
37598 link2 = links[link2.toLowerCase()];
37600 const text2 = cap[0].charAt(0);
37607 return outputLink(cap, link2, cap[0], this.lexer);
37610 emStrong(src, maskedSrc, prevChar = "") {
37611 let match = this.rules.inline.emStrong.lDelim.exec(src);
37614 if (match[3] && prevChar.match(/[\p{L}\p{N}]/u))
37616 const nextChar = match[1] || match[2] || "";
37617 if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
37618 const lLength = [...match[0]].length - 1;
37619 let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
37620 const endReg = match[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
37621 endReg.lastIndex = 0;
37622 maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
37623 while ((match = endReg.exec(maskedSrc)) != null) {
37624 rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
37627 rLength = [...rDelim].length;
37628 if (match[3] || match[4]) {
37629 delimTotal += rLength;
37631 } else if (match[5] || match[6]) {
37632 if (lLength % 3 && !((lLength + rLength) % 3)) {
37633 midDelimTotal += rLength;
37637 delimTotal -= rLength;
37638 if (delimTotal > 0)
37640 rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
37641 const raw = [...src].slice(0, lLength + match.index + rLength + 1).join("");
37642 if (Math.min(lLength, rLength) % 2) {
37643 const text3 = raw.slice(1, -1);
37648 tokens: this.lexer.inlineTokens(text3)
37651 const text2 = raw.slice(2, -2);
37656 tokens: this.lexer.inlineTokens(text2)
37662 const cap = this.rules.inline.code.exec(src);
37664 let text2 = cap[2].replace(/\n/g, " ");
37665 const hasNonSpaceChars = /[^ ]/.test(text2);
37666 const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2);
37667 if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
37668 text2 = text2.substring(1, text2.length - 1);
37670 text2 = escape4(text2, true);
37679 const cap = this.rules.inline.br.exec(src);
37688 const cap = this.rules.inline.del.exec(src);
37694 tokens: this.lexer.inlineTokens(cap[2])
37698 autolink(src, mangle2) {
37699 const cap = this.rules.inline.autolink.exec(src);
37702 if (cap[2] === "@") {
37703 text2 = escape4(this.options.mangle ? mangle2(cap[1]) : cap[1]);
37704 href = "mailto:" + text2;
37706 text2 = escape4(cap[1]);
37724 url(src, mangle2) {
37726 if (cap = this.rules.inline.url.exec(src)) {
37728 if (cap[2] === "@") {
37729 text2 = escape4(this.options.mangle ? mangle2(cap[0]) : cap[0]);
37730 href = "mailto:" + text2;
37734 prevCapZero = cap[0];
37735 cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
37736 } while (prevCapZero !== cap[0]);
37737 text2 = escape4(cap[0]);
37738 if (cap[1] === "www.") {
37739 href = "http://" + cap[0];
37759 inlineText(src, smartypants2) {
37760 const cap = this.rules.inline.text.exec(src);
37763 if (this.lexer.state.inRawBlock) {
37764 text2 = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]) : cap[0];
37766 text2 = escape4(this.options.smartypants ? smartypants2(cap[0]) : cap[0]);
37777 newline: /^(?: *(?:\n|$))+/,
37778 code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
37779 fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
37780 hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
37781 heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
37782 blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
37783 list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
37784 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|$))",
37785 def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
37787 lheading: /^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
37788 // regex template, placeholders will be replaced according to different paragraph
37789 // interruption rules of commonmark and the original markdown spec:
37790 _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
37793 block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
37794 block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
37795 block.def = edit(block.def).replace("label", block._label).replace("title", block._title).getRegex();
37796 block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
37797 block.listItemStart = edit(/^( *)(bull) */).replace("bull", block.bullet).getRegex();
37798 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();
37799 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";
37800 block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
37801 block.html = edit(block.html, "i").replace("comment", block._comment).replace("tag", block._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
37802 block.lheading = edit(block.lheading).replace(/bull/g, block.bullet).getRegex();
37803 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();
37804 block.blockquote = edit(block.blockquote).replace("paragraph", block.paragraph).getRegex();
37805 block.normal = { ...block };
37808 table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
37811 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();
37812 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();
37815 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(),
37816 def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
37817 heading: /^(#{1,6})(.*)(?:\n+|$)/,
37819 lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
37820 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()
37823 escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
37824 autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
37826 tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
37827 link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
37828 reflink: /^!?\[(label)\]\[(ref)\]/,
37829 nolink: /^!?\[(ref)\](?:\[\])?/,
37830 reflinkSearch: "reflink|nolink(?!\\()",
37832 lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,
37833 // (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.
37834 // | Skip orphan inside strong | Consume to delim | (1) #*** | (2) a***#, a*** | (3) #***a, ***a | (4) ***# | (5) #***# | (6) a***a
37835 rDelimAst: /^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,
37836 rDelimUnd: /^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/
37837 // ^- Not allowed for _
37839 code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
37840 br: /^( {2,}|\\)\n(?!\s*$)/,
37842 text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
37843 punctuation: /^((?![*_])[\spunctuation])/
37845 inline._punctuation = "\\p{P}$+<=>`^|~";
37846 inline.punctuation = edit(inline.punctuation, "u").replace(/punctuation/g, inline._punctuation).getRegex();
37847 inline.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
37848 inline.anyPunctuation = /\\[punct]/g;
37849 inline._escapes = /\\([punct])/g;
37850 inline._comment = edit(block._comment).replace("(?:-->|$)", "-->").getRegex();
37851 inline.emStrong.lDelim = edit(inline.emStrong.lDelim, "u").replace(/punct/g, inline._punctuation).getRegex();
37852 inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, "gu").replace(/punct/g, inline._punctuation).getRegex();
37853 inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, "gu").replace(/punct/g, inline._punctuation).getRegex();
37854 inline.anyPunctuation = edit(inline.anyPunctuation, "gu").replace(/punct/g, inline._punctuation).getRegex();
37855 inline._escapes = edit(inline._escapes, "gu").replace(/punct/g, inline._punctuation).getRegex();
37856 inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
37857 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])?)+(?![-_])/;
37858 inline.autolink = edit(inline.autolink).replace("scheme", inline._scheme).replace("email", inline._email).getRegex();
37859 inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
37860 inline.tag = edit(inline.tag).replace("comment", inline._comment).replace("attribute", inline._attribute).getRegex();
37861 inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
37862 inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
37863 inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
37864 inline.link = edit(inline.link).replace("label", inline._label).replace("href", inline._href).replace("title", inline._title).getRegex();
37865 inline.reflink = edit(inline.reflink).replace("label", inline._label).replace("ref", block._label).getRegex();
37866 inline.nolink = edit(inline.nolink).replace("ref", block._label).getRegex();
37867 inline.reflinkSearch = edit(inline.reflinkSearch, "g").replace("reflink", inline.reflink).replace("nolink", inline.nolink).getRegex();
37868 inline.normal = { ...inline };
37869 inline.pedantic = {
37873 middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
37874 endAst: /\*\*(?!\*)/g,
37879 middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
37880 endAst: /\*(?!\*)/g,
37883 link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", inline._label).getRegex(),
37884 reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", inline._label).getRegex()
37888 escape: edit(inline.escape).replace("])", "~|])").getRegex(),
37889 _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
37890 url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
37891 _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
37892 del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
37893 text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
37895 inline.gfm.url = edit(inline.gfm.url, "i").replace("email", inline.gfm._extended_email).getRegex();
37898 br: edit(inline.br).replace("{2,}", "*").getRegex(),
37899 text: edit(inline.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
37901 function smartypants(text2) {
37902 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");
37904 function mangle(text2) {
37905 let out = "", i3, ch;
37906 const l2 = text2.length;
37907 for (i3 = 0; i3 < l2; i3++) {
37908 ch = text2.charCodeAt(i3);
37909 if (Math.random() > 0.5) {
37910 ch = "x" + ch.toString(16);
37912 out += "&#" + ch + ";";
37916 var _Lexer = class __Lexer {
37922 constructor(options2) {
37924 this.tokens.links = /* @__PURE__ */ Object.create(null);
37925 this.options = options2 || _defaults;
37926 this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
37927 this.tokenizer = this.options.tokenizer;
37928 this.tokenizer.options = this.options;
37929 this.tokenizer.lexer = this;
37930 this.inlineQueue = [];
37937 block: block.normal,
37938 inline: inline.normal
37940 if (this.options.pedantic) {
37941 rules.block = block.pedantic;
37942 rules.inline = inline.pedantic;
37943 } else if (this.options.gfm) {
37944 rules.block = block.gfm;
37945 if (this.options.breaks) {
37946 rules.inline = inline.breaks;
37948 rules.inline = inline.gfm;
37951 this.tokenizer.rules = rules;
37956 static get rules() {
37963 * Static Lex Method
37965 static lex(src, options2) {
37966 const lexer2 = new __Lexer(options2);
37967 return lexer2.lex(src);
37970 * Static Lex Inline Method
37972 static lexInline(src, options2) {
37973 const lexer2 = new __Lexer(options2);
37974 return lexer2.inlineTokens(src);
37980 src = src.replace(/\r\n|\r/g, "\n");
37981 this.blockTokens(src, this.tokens);
37983 while (next = this.inlineQueue.shift()) {
37984 this.inlineTokens(next.src, next.tokens);
37986 return this.tokens;
37988 blockTokens(src, tokens = []) {
37989 if (this.options.pedantic) {
37990 src = src.replace(/\t/g, " ").replace(/^ +$/gm, "");
37992 src = src.replace(/^( *)(\t+)/gm, (_2, leading, tabs) => {
37993 return leading + " ".repeat(tabs.length);
37999 let lastParagraphClipped;
38001 if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => {
38002 if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
38003 src = src.substring(token.raw.length);
38004 tokens.push(token);
38011 if (token = this.tokenizer.space(src)) {
38012 src = src.substring(token.raw.length);
38013 if (token.raw.length === 1 && tokens.length > 0) {
38014 tokens[tokens.length - 1].raw += "\n";
38016 tokens.push(token);
38020 if (token = this.tokenizer.code(src)) {
38021 src = src.substring(token.raw.length);
38022 lastToken = tokens[tokens.length - 1];
38023 if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
38024 lastToken.raw += "\n" + token.raw;
38025 lastToken.text += "\n" + token.text;
38026 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38028 tokens.push(token);
38032 if (token = this.tokenizer.fences(src)) {
38033 src = src.substring(token.raw.length);
38034 tokens.push(token);
38037 if (token = this.tokenizer.heading(src)) {
38038 src = src.substring(token.raw.length);
38039 tokens.push(token);
38042 if (token = this.tokenizer.hr(src)) {
38043 src = src.substring(token.raw.length);
38044 tokens.push(token);
38047 if (token = this.tokenizer.blockquote(src)) {
38048 src = src.substring(token.raw.length);
38049 tokens.push(token);
38052 if (token = this.tokenizer.list(src)) {
38053 src = src.substring(token.raw.length);
38054 tokens.push(token);
38057 if (token = this.tokenizer.html(src)) {
38058 src = src.substring(token.raw.length);
38059 tokens.push(token);
38062 if (token = this.tokenizer.def(src)) {
38063 src = src.substring(token.raw.length);
38064 lastToken = tokens[tokens.length - 1];
38065 if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
38066 lastToken.raw += "\n" + token.raw;
38067 lastToken.text += "\n" + token.raw;
38068 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38069 } else if (!this.tokens.links[token.tag]) {
38070 this.tokens.links[token.tag] = {
38077 if (token = this.tokenizer.table(src)) {
38078 src = src.substring(token.raw.length);
38079 tokens.push(token);
38082 if (token = this.tokenizer.lheading(src)) {
38083 src = src.substring(token.raw.length);
38084 tokens.push(token);
38088 if (this.options.extensions && this.options.extensions.startBlock) {
38089 let startIndex = Infinity;
38090 const tempSrc = src.slice(1);
38092 this.options.extensions.startBlock.forEach((getStartIndex) => {
38093 tempStart = getStartIndex.call({ lexer: this }, tempSrc);
38094 if (typeof tempStart === "number" && tempStart >= 0) {
38095 startIndex = Math.min(startIndex, tempStart);
38098 if (startIndex < Infinity && startIndex >= 0) {
38099 cutSrc = src.substring(0, startIndex + 1);
38102 if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
38103 lastToken = tokens[tokens.length - 1];
38104 if (lastParagraphClipped && lastToken.type === "paragraph") {
38105 lastToken.raw += "\n" + token.raw;
38106 lastToken.text += "\n" + token.text;
38107 this.inlineQueue.pop();
38108 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38110 tokens.push(token);
38112 lastParagraphClipped = cutSrc.length !== src.length;
38113 src = src.substring(token.raw.length);
38116 if (token = this.tokenizer.text(src)) {
38117 src = src.substring(token.raw.length);
38118 lastToken = tokens[tokens.length - 1];
38119 if (lastToken && lastToken.type === "text") {
38120 lastToken.raw += "\n" + token.raw;
38121 lastToken.text += "\n" + token.text;
38122 this.inlineQueue.pop();
38123 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38125 tokens.push(token);
38130 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
38131 if (this.options.silent) {
38132 console.error(errMsg);
38135 throw new Error(errMsg);
38139 this.state.top = true;
38142 inline(src, tokens = []) {
38143 this.inlineQueue.push({ src, tokens });
38149 inlineTokens(src, tokens = []) {
38150 let token, lastToken, cutSrc;
38151 let maskedSrc = src;
38153 let keepPrevChar, prevChar;
38154 if (this.tokens.links) {
38155 const links = Object.keys(this.tokens.links);
38156 if (links.length > 0) {
38157 while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
38158 if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
38159 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
38164 while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
38165 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
38167 while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
38168 maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
38171 if (!keepPrevChar) {
38174 keepPrevChar = false;
38175 if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => {
38176 if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
38177 src = src.substring(token.raw.length);
38178 tokens.push(token);
38185 if (token = this.tokenizer.escape(src)) {
38186 src = src.substring(token.raw.length);
38187 tokens.push(token);
38190 if (token = this.tokenizer.tag(src)) {
38191 src = src.substring(token.raw.length);
38192 lastToken = tokens[tokens.length - 1];
38193 if (lastToken && token.type === "text" && lastToken.type === "text") {
38194 lastToken.raw += token.raw;
38195 lastToken.text += token.text;
38197 tokens.push(token);
38201 if (token = this.tokenizer.link(src)) {
38202 src = src.substring(token.raw.length);
38203 tokens.push(token);
38206 if (token = this.tokenizer.reflink(src, this.tokens.links)) {
38207 src = src.substring(token.raw.length);
38208 lastToken = tokens[tokens.length - 1];
38209 if (lastToken && token.type === "text" && lastToken.type === "text") {
38210 lastToken.raw += token.raw;
38211 lastToken.text += token.text;
38213 tokens.push(token);
38217 if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
38218 src = src.substring(token.raw.length);
38219 tokens.push(token);
38222 if (token = this.tokenizer.codespan(src)) {
38223 src = src.substring(token.raw.length);
38224 tokens.push(token);
38227 if (token = this.tokenizer.br(src)) {
38228 src = src.substring(token.raw.length);
38229 tokens.push(token);
38232 if (token = this.tokenizer.del(src)) {
38233 src = src.substring(token.raw.length);
38234 tokens.push(token);
38237 if (token = this.tokenizer.autolink(src, mangle)) {
38238 src = src.substring(token.raw.length);
38239 tokens.push(token);
38242 if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
38243 src = src.substring(token.raw.length);
38244 tokens.push(token);
38248 if (this.options.extensions && this.options.extensions.startInline) {
38249 let startIndex = Infinity;
38250 const tempSrc = src.slice(1);
38252 this.options.extensions.startInline.forEach((getStartIndex) => {
38253 tempStart = getStartIndex.call({ lexer: this }, tempSrc);
38254 if (typeof tempStart === "number" && tempStart >= 0) {
38255 startIndex = Math.min(startIndex, tempStart);
38258 if (startIndex < Infinity && startIndex >= 0) {
38259 cutSrc = src.substring(0, startIndex + 1);
38262 if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
38263 src = src.substring(token.raw.length);
38264 if (token.raw.slice(-1) !== "_") {
38265 prevChar = token.raw.slice(-1);
38267 keepPrevChar = true;
38268 lastToken = tokens[tokens.length - 1];
38269 if (lastToken && lastToken.type === "text") {
38270 lastToken.raw += token.raw;
38271 lastToken.text += token.text;
38273 tokens.push(token);
38278 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
38279 if (this.options.silent) {
38280 console.error(errMsg);
38283 throw new Error(errMsg);
38290 var _Renderer = class {
38292 constructor(options2) {
38293 this.options = options2 || _defaults;
38295 code(code, infostring, escaped) {
38296 const lang = (infostring || "").match(/\S*/)[0];
38297 if (this.options.highlight) {
38298 const out = this.options.highlight(code, lang);
38299 if (out != null && out !== code) {
38304 code = code.replace(/\n$/, "") + "\n";
38306 return "<pre><code>" + (escaped ? code : escape4(code, true)) + "</code></pre>\n";
38308 return '<pre><code class="' + this.options.langPrefix + escape4(lang) + '">' + (escaped ? code : escape4(code, true)) + "</code></pre>\n";
38310 blockquote(quote2) {
38311 return `<blockquote>
38312 ${quote2}</blockquote>
38315 html(html2, block2) {
38318 heading(text2, level, raw, slugger) {
38319 if (this.options.headerIds) {
38320 const id2 = this.options.headerPrefix + slugger.slug(raw);
38321 return `<h${level} id="${id2}">${text2}</h${level}>
38324 return `<h${level}>${text2}</h${level}>
38328 return this.options.xhtml ? "<hr/>\n" : "<hr>\n";
38330 list(body, ordered, start2) {
38331 const type2 = ordered ? "ol" : "ul", startatt = ordered && start2 !== 1 ? ' start="' + start2 + '"' : "";
38332 return "<" + type2 + startatt + ">\n" + body + "</" + type2 + ">\n";
38334 listitem(text2, task, checked) {
38335 return `<li>${text2}</li>
38338 checkbox(checked) {
38339 return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
38342 return `<p>${text2}</p>
38345 table(header, body) {
38347 body = `<tbody>${body}</tbody>`;
38348 return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
38350 tablerow(content) {
38355 tablecell(content, flags) {
38356 const type2 = flags.header ? "th" : "td";
38357 const tag = flags.align ? `<${type2} align="${flags.align}">` : `<${type2}>`;
38358 return tag + content + `</${type2}>
38362 * span level renderer
38365 return `<strong>${text2}</strong>`;
38368 return `<em>${text2}</em>`;
38371 return `<code>${text2}</code>`;
38374 return this.options.xhtml ? "<br/>" : "<br>";
38377 return `<del>${text2}</del>`;
38379 link(href, title, text2) {
38380 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
38381 if (href === null) {
38384 let out = '<a href="' + href + '"';
38386 out += ' title="' + title + '"';
38388 out += ">" + text2 + "</a>";
38391 image(href, title, text2) {
38392 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
38393 if (href === null) {
38396 let out = `<img src="${href}" alt="${text2}"`;
38398 out += ` title="${title}"`;
38400 out += this.options.xhtml ? "/>" : ">";
38407 var _TextRenderer = class {
38408 // no need for block level renderers
38427 link(href, title, text2) {
38430 image(href, title, text2) {
38437 var _Slugger = class {
38443 return value.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
38446 * Finds the next safe (unique) slug to use
38448 getNextSafeSlug(originalSlug, isDryRun) {
38449 let slug = originalSlug;
38450 let occurenceAccumulator = 0;
38451 if (this.seen.hasOwnProperty(slug)) {
38452 occurenceAccumulator = this.seen[originalSlug];
38454 occurenceAccumulator++;
38455 slug = originalSlug + "-" + occurenceAccumulator;
38456 } while (this.seen.hasOwnProperty(slug));
38459 this.seen[originalSlug] = occurenceAccumulator;
38460 this.seen[slug] = 0;
38465 * Convert string to unique id
38467 slug(value, options2 = {}) {
38468 const slug = this.serialize(value);
38469 return this.getNextSafeSlug(slug, options2.dryrun);
38472 var _Parser = class __Parser {
38477 constructor(options2) {
38478 this.options = options2 || _defaults;
38479 this.options.renderer = this.options.renderer || new _Renderer();
38480 this.renderer = this.options.renderer;
38481 this.renderer.options = this.options;
38482 this.textRenderer = new _TextRenderer();
38483 this.slugger = new _Slugger();
38486 * Static Parse Method
38488 static parse(tokens, options2) {
38489 const parser3 = new __Parser(options2);
38490 return parser3.parse(tokens);
38493 * Static Parse Inline Method
38495 static parseInline(tokens, options2) {
38496 const parser3 = new __Parser(options2);
38497 return parser3.parseInline(tokens);
38502 parse(tokens, top = true) {
38503 let out = "", i3, j3, k2, l2, l3, row, cell, header, body, token, ordered, start2, loose, itemBody, item, checked, task, checkbox, ret;
38504 const l4 = tokens.length;
38505 for (i3 = 0; i3 < l4; i3++) {
38506 token = tokens[i3];
38507 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
38508 ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
38509 if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) {
38514 switch (token.type) {
38519 out += this.renderer.hr();
38523 out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape3(this.parseInline(token.tokens, this.textRenderer)), this.slugger);
38527 out += this.renderer.code(token.text, token.lang, !!token.escaped);
38533 l2 = token.header.length;
38534 for (j3 = 0; j3 < l2; j3++) {
38535 cell += this.renderer.tablecell(this.parseInline(token.header[j3].tokens), { header: true, align: token.align[j3] });
38537 header += this.renderer.tablerow(cell);
38539 l2 = token.rows.length;
38540 for (j3 = 0; j3 < l2; j3++) {
38541 row = token.rows[j3];
38544 for (k2 = 0; k2 < l3; k2++) {
38545 cell += this.renderer.tablecell(this.parseInline(row[k2].tokens), { header: false, align: token.align[k2] });
38547 body += this.renderer.tablerow(cell);
38549 out += this.renderer.table(header, body);
38552 case "blockquote": {
38553 body = this.parse(token.tokens);
38554 out += this.renderer.blockquote(body);
38558 ordered = token.ordered;
38559 start2 = token.start;
38560 loose = token.loose;
38561 l2 = token.items.length;
38563 for (j3 = 0; j3 < l2; j3++) {
38564 item = token.items[j3];
38565 checked = item.checked;
38569 checkbox = this.renderer.checkbox(!!checked);
38571 if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
38572 item.tokens[0].text = checkbox + " " + item.tokens[0].text;
38573 if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
38574 item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
38577 item.tokens.unshift({
38583 itemBody += checkbox;
38586 itemBody += this.parse(item.tokens, loose);
38587 body += this.renderer.listitem(itemBody, task, !!checked);
38589 out += this.renderer.list(body, ordered, start2);
38593 out += this.renderer.html(token.text, token.block);
38596 case "paragraph": {
38597 out += this.renderer.paragraph(this.parseInline(token.tokens));
38601 body = token.tokens ? this.parseInline(token.tokens) : token.text;
38602 while (i3 + 1 < l4 && tokens[i3 + 1].type === "text") {
38603 token = tokens[++i3];
38604 body += "\n" + (token.tokens ? this.parseInline(token.tokens) : token.text);
38606 out += top ? this.renderer.paragraph(body) : body;
38610 const errMsg = 'Token with "' + token.type + '" type was not found.';
38611 if (this.options.silent) {
38612 console.error(errMsg);
38615 throw new Error(errMsg);
38623 * Parse Inline Tokens
38625 parseInline(tokens, renderer) {
38626 renderer = renderer || this.renderer;
38627 let out = "", i3, token, ret;
38628 const l2 = tokens.length;
38629 for (i3 = 0; i3 < l2; i3++) {
38630 token = tokens[i3];
38631 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
38632 ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
38633 if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) {
38638 switch (token.type) {
38640 out += renderer.text(token.text);
38644 out += renderer.html(token.text);
38648 out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
38652 out += renderer.image(token.href, token.title, token.text);
38656 out += renderer.strong(this.parseInline(token.tokens, renderer));
38660 out += renderer.em(this.parseInline(token.tokens, renderer));
38664 out += renderer.codespan(token.text);
38668 out += renderer.br();
38672 out += renderer.del(this.parseInline(token.tokens, renderer));
38676 out += renderer.text(token.text);
38680 const errMsg = 'Token with "' + token.type + '" type was not found.';
38681 if (this.options.silent) {
38682 console.error(errMsg);
38685 throw new Error(errMsg);
38693 var _Hooks = class {
38695 constructor(options2) {
38696 this.options = options2 || _defaults;
38698 static passThroughHooks = /* @__PURE__ */ new Set([
38703 * Process markdown before marked
38705 preprocess(markdown) {
38709 * Process HTML after marked is finished
38711 postprocess(html2) {
38715 var Marked = class {
38716 defaults = _getDefaults();
38717 options = this.setOptions;
38718 parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);
38719 parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
38721 parser = _Parser.parse;
38722 Renderer = _Renderer;
38723 TextRenderer = _TextRenderer;
38725 lexer = _Lexer.lex;
38726 Tokenizer = _Tokenizer;
38727 Slugger = _Slugger;
38729 constructor(...args) {
38733 * Run callback for every token
38735 walkTokens(tokens, callback) {
38737 for (const token of tokens) {
38738 values = values.concat(callback.call(this, token));
38739 switch (token.type) {
38741 for (const cell of token.header) {
38742 values = values.concat(this.walkTokens(cell.tokens, callback));
38744 for (const row of token.rows) {
38745 for (const cell of row) {
38746 values = values.concat(this.walkTokens(cell.tokens, callback));
38752 values = values.concat(this.walkTokens(token.items, callback));
38756 if (this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[token.type]) {
38757 this.defaults.extensions.childTokens[token.type].forEach((childTokens) => {
38758 values = values.concat(this.walkTokens(token[childTokens], callback));
38760 } else if (token.tokens) {
38761 values = values.concat(this.walkTokens(token.tokens, callback));
38769 const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
38770 args.forEach((pack) => {
38771 const opts = { ...pack };
38772 opts.async = this.defaults.async || opts.async || false;
38773 if (pack.extensions) {
38774 pack.extensions.forEach((ext) => {
38776 throw new Error("extension name required");
38778 if ("renderer" in ext) {
38779 const prevRenderer = extensions.renderers[ext.name];
38780 if (prevRenderer) {
38781 extensions.renderers[ext.name] = function(...args2) {
38782 let ret = ext.renderer.apply(this, args2);
38783 if (ret === false) {
38784 ret = prevRenderer.apply(this, args2);
38789 extensions.renderers[ext.name] = ext.renderer;
38792 if ("tokenizer" in ext) {
38793 if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
38794 throw new Error("extension level must be 'block' or 'inline'");
38796 if (extensions[ext.level]) {
38797 extensions[ext.level].unshift(ext.tokenizer);
38799 extensions[ext.level] = [ext.tokenizer];
38802 if (ext.level === "block") {
38803 if (extensions.startBlock) {
38804 extensions.startBlock.push(ext.start);
38806 extensions.startBlock = [ext.start];
38808 } else if (ext.level === "inline") {
38809 if (extensions.startInline) {
38810 extensions.startInline.push(ext.start);
38812 extensions.startInline = [ext.start];
38817 if ("childTokens" in ext && ext.childTokens) {
38818 extensions.childTokens[ext.name] = ext.childTokens;
38821 opts.extensions = extensions;
38823 if (pack.renderer) {
38824 const renderer = this.defaults.renderer || new _Renderer(this.defaults);
38825 for (const prop in pack.renderer) {
38826 const rendererFunc = pack.renderer[prop];
38827 const rendererKey = prop;
38828 const prevRenderer = renderer[rendererKey];
38829 renderer[rendererKey] = (...args2) => {
38830 let ret = rendererFunc.apply(renderer, args2);
38831 if (ret === false) {
38832 ret = prevRenderer.apply(renderer, args2);
38837 opts.renderer = renderer;
38839 if (pack.tokenizer) {
38840 const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
38841 for (const prop in pack.tokenizer) {
38842 const tokenizerFunc = pack.tokenizer[prop];
38843 const tokenizerKey = prop;
38844 const prevTokenizer = tokenizer[tokenizerKey];
38845 tokenizer[tokenizerKey] = (...args2) => {
38846 let ret = tokenizerFunc.apply(tokenizer, args2);
38847 if (ret === false) {
38848 ret = prevTokenizer.apply(tokenizer, args2);
38853 opts.tokenizer = tokenizer;
38856 const hooks = this.defaults.hooks || new _Hooks();
38857 for (const prop in pack.hooks) {
38858 const hooksFunc = pack.hooks[prop];
38859 const hooksKey = prop;
38860 const prevHook = hooks[hooksKey];
38861 if (_Hooks.passThroughHooks.has(prop)) {
38862 hooks[hooksKey] = (arg) => {
38863 if (this.defaults.async) {
38864 return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
38865 return prevHook.call(hooks, ret2);
38868 const ret = hooksFunc.call(hooks, arg);
38869 return prevHook.call(hooks, ret);
38872 hooks[hooksKey] = (...args2) => {
38873 let ret = hooksFunc.apply(hooks, args2);
38874 if (ret === false) {
38875 ret = prevHook.apply(hooks, args2);
38881 opts.hooks = hooks;
38883 if (pack.walkTokens) {
38884 const walkTokens2 = this.defaults.walkTokens;
38885 opts.walkTokens = function(token) {
38887 values.push(pack.walkTokens.call(this, token));
38889 values = values.concat(walkTokens2.call(this, token));
38894 this.defaults = { ...this.defaults, ...opts };
38899 this.defaults = { ...this.defaults, ...opt };
38902 #parseMarkdown(lexer2, parser3) {
38903 return (src, optOrCallback, callback) => {
38904 if (typeof optOrCallback === "function") {
38905 callback = optOrCallback;
38906 optOrCallback = null;
38908 const origOpt = { ...optOrCallback };
38909 const opt = { ...this.defaults, ...origOpt };
38910 const throwError = this.#onError(!!opt.silent, !!opt.async, callback);
38911 if (typeof src === "undefined" || src === null) {
38912 return throwError(new Error("marked(): input parameter is undefined or null"));
38914 if (typeof src !== "string") {
38915 return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
38917 checkDeprecations(opt, callback);
38919 opt.hooks.options = opt;
38922 const highlight = opt.highlight;
38926 src = opt.hooks.preprocess(src);
38928 tokens = lexer2(src, opt);
38930 return throwError(e3);
38932 const done = (err) => {
38936 if (opt.walkTokens) {
38937 this.walkTokens(tokens, opt.walkTokens);
38939 out = parser3(tokens, opt);
38941 out = opt.hooks.postprocess(out);
38947 opt.highlight = highlight;
38948 return err ? throwError(err) : callback(null, out);
38950 if (!highlight || highlight.length < 3) {
38953 delete opt.highlight;
38954 if (!tokens.length)
38957 this.walkTokens(tokens, (token) => {
38958 if (token.type === "code") {
38961 highlight(token.text, token.lang, (err, code) => {
38965 if (code != null && code !== token.text) {
38967 token.escaped = true;
38970 if (pending === 0) {
38977 if (pending === 0) {
38983 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);
38987 src = opt.hooks.preprocess(src);
38989 const tokens = lexer2(src, opt);
38990 if (opt.walkTokens) {
38991 this.walkTokens(tokens, opt.walkTokens);
38993 let html2 = parser3(tokens, opt);
38995 html2 = opt.hooks.postprocess(html2);
38999 return throwError(e3);
39003 #onError(silent, async, callback) {
39005 e3.message += "\nPlease report this to https://github.com/markedjs/marked.";
39007 const msg = "<p>An error occurred:</p><pre>" + escape4(e3.message + "", true) + "</pre>";
39009 return Promise.resolve(msg);
39012 callback(null, msg);
39018 return Promise.reject(e3);
39028 var markedInstance = new Marked();
39029 function marked(src, opt, callback) {
39030 return markedInstance.parse(src, opt, callback);
39032 marked.options = marked.setOptions = function(options2) {
39033 markedInstance.setOptions(options2);
39034 marked.defaults = markedInstance.defaults;
39035 changeDefaults(marked.defaults);
39038 marked.getDefaults = _getDefaults;
39039 marked.defaults = _defaults;
39040 marked.use = function(...args) {
39041 markedInstance.use(...args);
39042 marked.defaults = markedInstance.defaults;
39043 changeDefaults(marked.defaults);
39046 marked.walkTokens = function(tokens, callback) {
39047 return markedInstance.walkTokens(tokens, callback);
39049 marked.parseInline = markedInstance.parseInline;
39050 marked.Parser = _Parser;
39051 marked.parser = _Parser.parse;
39052 marked.Renderer = _Renderer;
39053 marked.TextRenderer = _TextRenderer;
39054 marked.Lexer = _Lexer;
39055 marked.lexer = _Lexer.lex;
39056 marked.Tokenizer = _Tokenizer;
39057 marked.Slugger = _Slugger;
39058 marked.Hooks = _Hooks;
39059 marked.parse = marked;
39060 var options = marked.options;
39061 var setOptions = marked.setOptions;
39062 var use = marked.use;
39063 var walkTokens = marked.walkTokens;
39064 var parseInline = marked.parseInline;
39065 var parser2 = _Parser.parse;
39066 var lexer = _Lexer.lex;
39068 // modules/services/osmose.js
39069 var tiler3 = utilTiler();
39070 var dispatch4 = dispatch_default("loaded");
39071 var _tileZoom3 = 14;
39072 var _osmoseUrlRoot = "https://osmose.openstreetmap.fr/api/0.3";
39073 var _osmoseData = { icons: {}, items: [] };
39075 function abortRequest3(controller) {
39077 controller.abort();
39080 function abortUnwantedRequests3(cache, tiles) {
39081 Object.keys(cache.inflightTile).forEach((k2) => {
39082 let wanted = tiles.find((tile) => k2 === tile.id);
39084 abortRequest3(cache.inflightTile[k2]);
39085 delete cache.inflightTile[k2];
39089 function encodeIssueRtree3(d2) {
39090 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
39092 function updateRtree3(item, replace) {
39093 _cache3.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
39095 _cache3.rtree.insert(item);
39098 function preventCoincident2(loc) {
39099 let coincident = false;
39101 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
39102 loc = geoVecAdd(loc, delta);
39103 let bbox2 = geoExtent(loc).bbox();
39104 coincident = _cache3.rtree.search(bbox2).length;
39105 } while (coincident);
39108 var osmose_default = {
39111 _mainFileFetcher.get("qa_data").then((d2) => {
39112 _osmoseData = d2.osmose;
39113 _osmoseData.items = Object.keys(d2.osmose.icons).map((s2) => s2.split("-")[0]).reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []);
39118 this.event = utilRebind(this, dispatch4, "on");
39124 Object.values(_cache3.inflightTile).forEach(abortRequest3);
39125 _strings = _cache3.strings;
39126 _colors = _cache3.colors;
39134 rtree: new import_rbush3.default(),
39139 loadIssues(projection2) {
39141 // Tiles return a maximum # of issues
39142 // So we want to filter our request for only types iD supports
39143 item: _osmoseData.items
39145 let tiles = tiler3.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
39146 abortUnwantedRequests3(_cache3, tiles);
39147 tiles.forEach((tile) => {
39148 if (_cache3.loadedTile[tile.id] || _cache3.inflightTile[tile.id])
39150 let [x2, y2, z2] = tile.xyz;
39151 let url = `${_osmoseUrlRoot}/issues/${z2}/${x2}/${y2}.geojson?` + utilQsString(params);
39152 let controller = new AbortController();
39153 _cache3.inflightTile[tile.id] = controller;
39154 json_default(url, { signal: controller.signal }).then((data) => {
39155 delete _cache3.inflightTile[tile.id];
39156 _cache3.loadedTile[tile.id] = true;
39157 if (data.features) {
39158 data.features.forEach((issue) => {
39159 const { item, class: cl, uuid: id2 } = issue.properties;
39160 const itemType = `${item}-${cl}`;
39161 if (itemType in _osmoseData.icons) {
39162 let loc = issue.geometry.coordinates;
39163 loc = preventCoincident2(loc);
39164 let d2 = new QAItem(loc, this, itemType, id2, { item });
39165 if (item === 8300 || item === 8360) {
39168 _cache3.data[d2.id] = d2;
39169 _cache3.rtree.insert(encodeIssueRtree3(d2));
39173 dispatch4.call("loaded");
39175 delete _cache3.inflightTile[tile.id];
39176 _cache3.loadedTile[tile.id] = true;
39180 loadIssueDetail(issue) {
39181 if (issue.elems !== void 0) {
39182 return Promise.resolve(issue);
39184 const url = `${_osmoseUrlRoot}/issue/${issue.id}?langs=${_mainLocalizer.localeCode()}`;
39185 const cacheDetails = (data) => {
39186 issue.elems = data.elems.map((e3) => e3.type.substring(0, 1) + e3.id);
39187 issue.detail = data.subtitle ? marked(data.subtitle.auto) : "";
39188 this.replaceItem(issue);
39190 return json_default(url).then(cacheDetails).then(() => issue);
39192 loadStrings(locale2 = _mainLocalizer.localeCode()) {
39193 const items = Object.keys(_osmoseData.icons);
39194 if (locale2 in _cache3.strings && Object.keys(_cache3.strings[locale2]).length === items.length) {
39195 return Promise.resolve(_cache3.strings[locale2]);
39197 if (!(locale2 in _cache3.strings)) {
39198 _cache3.strings[locale2] = {};
39200 const allRequests = items.map((itemType) => {
39201 if (itemType in _cache3.strings[locale2])
39203 const cacheData = (data) => {
39204 const [cat = { items: [] }] = data.categories;
39205 const [item2 = { class: [] }] = cat.items;
39206 const [cl2 = null] = item2.class;
39208 console.log(`Osmose strings request (${itemType}) had unexpected data`);
39211 const { item: itemInt, color: color2 } = item2;
39212 if (/^#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/.test(color2)) {
39213 _cache3.colors[itemInt] = color2;
39215 const { title, detail, fix, trap } = cl2;
39216 let issueStrings = {};
39218 issueStrings.title = title.auto;
39220 issueStrings.detail = marked(detail.auto);
39222 issueStrings.trap = marked(trap.auto);
39224 issueStrings.fix = marked(fix.auto);
39225 _cache3.strings[locale2][itemType] = issueStrings;
39227 const [item, cl] = itemType.split("-");
39228 const url = `${_osmoseUrlRoot}/items/${item}/class/${cl}?langs=${locale2}`;
39229 return json_default(url).then(cacheData);
39230 }).filter(Boolean);
39231 return Promise.all(allRequests).then(() => _cache3.strings[locale2]);
39233 getStrings(itemType, locale2 = _mainLocalizer.localeCode()) {
39234 return locale2 in _cache3.strings ? _cache3.strings[locale2][itemType] : {};
39236 getColor(itemType) {
39237 return itemType in _cache3.colors ? _cache3.colors[itemType] : "#FFFFFF";
39239 postUpdate(issue, callback) {
39240 if (_cache3.inflightPost[issue.id]) {
39241 return callback({ message: "Issue update already inflight", status: -2 }, issue);
39243 const url = `${_osmoseUrlRoot}/issue/${issue.id}/${issue.newStatus}`;
39244 const controller = new AbortController();
39245 const after = () => {
39246 delete _cache3.inflightPost[issue.id];
39247 this.removeItem(issue);
39248 if (issue.newStatus === "done") {
39249 if (!(issue.item in _cache3.closed)) {
39250 _cache3.closed[issue.item] = 0;
39252 _cache3.closed[issue.item] += 1;
39255 callback(null, issue);
39257 _cache3.inflightPost[issue.id] = controller;
39258 fetch(url, { signal: controller.signal }).then(after).catch((err) => {
39259 delete _cache3.inflightPost[issue.id];
39261 callback(err.message);
39264 // Get all cached QAItems covering the viewport
39265 getItems(projection2) {
39266 const viewport = projection2.clipExtent();
39267 const min3 = [viewport[0][0], viewport[1][1]];
39268 const max3 = [viewport[1][0], viewport[0][1]];
39269 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
39270 return _cache3.rtree.search(bbox2).map((d2) => d2.data);
39272 // Get a QAItem from cache
39273 // NOTE: Don't change method name until UI v3 is merged
39275 return _cache3.data[id2];
39277 // get the name of the icon to display for this item
39278 getIcon(itemType) {
39279 return _osmoseData.icons[itemType];
39281 // Replace a single QAItem in the cache
39282 replaceItem(item) {
39283 if (!(item instanceof QAItem) || !item.id)
39285 _cache3.data[item.id] = item;
39286 updateRtree3(encodeIssueRtree3(item), true);
39289 // Remove a single QAItem from the cache
39291 if (!(item instanceof QAItem) || !item.id)
39293 delete _cache3.data[item.id];
39294 updateRtree3(encodeIssueRtree3(item), false);
39296 // Used to populate `closed:osmose:*` changeset tags
39297 getClosedCounts() {
39298 return _cache3.closed;
39301 return `https://osmose.openstreetmap.fr/en/error/${item.id}`;
39305 // modules/services/mapillary.js
39306 var import_pbf = __toESM(require_pbf());
39307 var import_rbush4 = __toESM(require_rbush_min());
39308 var import_vector_tile = __toESM(require_vector_tile());
39309 var accessToken = "MLY|4100327730013843|5bb78b81720791946a9a7b956c57b7cf";
39310 var apiUrl = "https://graph.mapillary.com/";
39311 var baseTileUrl = "https://tiles.mapillary.com/maps/vtp";
39312 var mapFeatureTileUrl = `${baseTileUrl}/mly_map_feature_point/2/{z}/{x}/{y}?access_token=${accessToken}`;
39313 var tileUrl = `${baseTileUrl}/mly1_public/2/{z}/{x}/{y}?access_token=${accessToken}`;
39314 var trafficSignTileUrl = `${baseTileUrl}/mly_map_feature_traffic_sign/2/{z}/{x}/{y}?access_token=${accessToken}`;
39315 var viewercss = "mapillary-js/mapillary.css";
39316 var viewerjs = "mapillary-js/mapillary.js";
39318 var dispatch5 = dispatch_default("change", "loadedImages", "loadedSigns", "loadedMapFeatures", "bearingChanged", "imageChanged");
39319 var _loadViewerPromise;
39320 var _mlyActiveImage;
39322 var _mlyFallback = false;
39323 var _mlyHighlightedDetection;
39324 var _mlyShowFeatureDetections = false;
39325 var _mlyShowSignDetections = false;
39327 var _mlyViewerFilter = ["all"];
39328 function loadTiles(which, url, maxZoom2, projection2) {
39329 const tiler9 = utilTiler().zoomExtent([minZoom, maxZoom2]).skipNullIsland(true);
39330 const tiles = tiler9.getTiles(projection2);
39331 tiles.forEach(function(tile) {
39332 loadTile(which, url, tile);
39335 function loadTile(which, url, tile) {
39336 const cache = _mlyCache.requests;
39337 const tileId = `${tile.id}-${which}`;
39338 if (cache.loaded[tileId] || cache.inflight[tileId])
39340 const controller = new AbortController();
39341 cache.inflight[tileId] = controller;
39342 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
39343 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
39344 if (!response.ok) {
39345 throw new Error(response.status + " " + response.statusText);
39347 cache.loaded[tileId] = true;
39348 delete cache.inflight[tileId];
39349 return response.arrayBuffer();
39350 }).then(function(data) {
39352 throw new Error("No Data");
39354 loadTileDataToCache(data, tile, which);
39355 if (which === "images") {
39356 dispatch5.call("loadedImages");
39357 } else if (which === "signs") {
39358 dispatch5.call("loadedSigns");
39359 } else if (which === "points") {
39360 dispatch5.call("loadedMapFeatures");
39362 }).catch(function() {
39363 cache.loaded[tileId] = true;
39364 delete cache.inflight[tileId];
39367 function loadTileDataToCache(data, tile, which) {
39368 const vectorTile = new import_vector_tile.VectorTile(new import_pbf.default(data));
39369 let features, cache, layer, i3, feature3, loc, d2;
39370 if (vectorTile.layers.hasOwnProperty("image")) {
39372 cache = _mlyCache.images;
39373 layer = vectorTile.layers.image;
39374 for (i3 = 0; i3 < layer.length; i3++) {
39375 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39376 loc = feature3.geometry.coordinates;
39379 captured_at: feature3.properties.captured_at,
39380 ca: feature3.properties.compass_angle,
39381 id: feature3.properties.id,
39382 is_pano: feature3.properties.is_pano,
39383 sequence_id: feature3.properties.sequence_id
39385 cache.forImageId[d2.id] = d2;
39395 cache.rtree.load(features);
39398 if (vectorTile.layers.hasOwnProperty("sequence")) {
39400 cache = _mlyCache.sequences;
39401 layer = vectorTile.layers.sequence;
39402 for (i3 = 0; i3 < layer.length; i3++) {
39403 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39404 if (cache.lineString[feature3.properties.id]) {
39405 cache.lineString[feature3.properties.id].push(feature3);
39407 cache.lineString[feature3.properties.id] = [feature3];
39411 if (vectorTile.layers.hasOwnProperty("point")) {
39413 cache = _mlyCache[which];
39414 layer = vectorTile.layers.point;
39415 for (i3 = 0; i3 < layer.length; i3++) {
39416 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39417 loc = feature3.geometry.coordinates;
39420 id: feature3.properties.id,
39421 first_seen_at: feature3.properties.first_seen_at,
39422 last_seen_at: feature3.properties.last_seen_at,
39423 value: feature3.properties.value
39434 cache.rtree.load(features);
39437 if (vectorTile.layers.hasOwnProperty("traffic_sign")) {
39439 cache = _mlyCache[which];
39440 layer = vectorTile.layers.traffic_sign;
39441 for (i3 = 0; i3 < layer.length; i3++) {
39442 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39443 loc = feature3.geometry.coordinates;
39446 id: feature3.properties.id,
39447 first_seen_at: feature3.properties.first_seen_at,
39448 last_seen_at: feature3.properties.last_seen_at,
39449 value: feature3.properties.value
39460 cache.rtree.load(features);
39464 function loadData(url) {
39465 return fetch(url).then(function(response) {
39466 if (!response.ok) {
39467 throw new Error(response.status + " " + response.statusText);
39469 return response.json();
39470 }).then(function(result) {
39474 return result.data || [];
39477 function partitionViewport(projection2) {
39478 const z2 = geoScaleToZoom(projection2.scale());
39479 const z22 = Math.ceil(z2 * 2) / 2 + 2.5;
39480 const tiler9 = utilTiler().zoomExtent([z22, z22]);
39481 return tiler9.getTiles(projection2).map(function(tile) {
39482 return tile.extent;
39485 function searchLimited(limit, projection2, rtree) {
39486 limit = limit || 5;
39487 return partitionViewport(projection2).reduce(function(result, extent) {
39488 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
39491 return found.length ? result.concat(found) : result;
39494 var mapillary_default = {
39495 // Initialize Mapillary
39500 this.event = utilRebind(this, dispatch5, "on");
39502 // Reset cache and state
39503 reset: function() {
39505 Object.values(_mlyCache.requests.inflight).forEach(function(request3) {
39510 images: { rtree: new import_rbush4.default(), forImageId: {} },
39511 image_detections: { forImageId: {} },
39512 signs: { rtree: new import_rbush4.default() },
39513 points: { rtree: new import_rbush4.default() },
39514 sequences: { rtree: new import_rbush4.default(), lineString: {} },
39515 requests: { loaded: {}, inflight: {} }
39517 _mlyActiveImage = null;
39519 // Get visible images
39520 images: function(projection2) {
39522 return searchLimited(limit, projection2, _mlyCache.images.rtree);
39524 // Get visible traffic signs
39525 signs: function(projection2) {
39527 return searchLimited(limit, projection2, _mlyCache.signs.rtree);
39529 // Get visible map (point) features
39530 mapFeatures: function(projection2) {
39532 return searchLimited(limit, projection2, _mlyCache.points.rtree);
39534 // Get cached image by id
39535 cachedImage: function(imageId) {
39536 return _mlyCache.images.forImageId[imageId];
39538 // Get visible sequences
39539 sequences: function(projection2) {
39540 const viewport = projection2.clipExtent();
39541 const min3 = [viewport[0][0], viewport[1][1]];
39542 const max3 = [viewport[1][0], viewport[0][1]];
39543 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
39544 const sequenceIds = {};
39545 let lineStrings = [];
39546 _mlyCache.images.rtree.search(bbox2).forEach(function(d2) {
39547 if (d2.data.sequence_id) {
39548 sequenceIds[d2.data.sequence_id] = true;
39551 Object.keys(sequenceIds).forEach(function(sequenceId) {
39552 if (_mlyCache.sequences.lineString[sequenceId]) {
39553 lineStrings = lineStrings.concat(_mlyCache.sequences.lineString[sequenceId]);
39556 return lineStrings;
39558 // Load images in the visible area
39559 loadImages: function(projection2) {
39560 loadTiles("images", tileUrl, 14, projection2);
39562 // Load traffic signs in the visible area
39563 loadSigns: function(projection2) {
39564 loadTiles("signs", trafficSignTileUrl, 14, projection2);
39566 // Load map (point) features in the visible area
39567 loadMapFeatures: function(projection2) {
39568 loadTiles("points", mapFeatureTileUrl, 14, projection2);
39570 // Return a promise that resolves when the image viewer (Mapillary JS) library has finished loading
39571 ensureViewerLoaded: function(context) {
39572 if (_loadViewerPromise)
39573 return _loadViewerPromise;
39574 const wrap2 = context.container().select(".photoviewer").selectAll(".mly-wrapper").data([0]);
39575 wrap2.enter().append("div").attr("id", "ideditor-mly").attr("class", "photo-wrapper mly-wrapper").classed("hide", true);
39577 _loadViewerPromise = new Promise((resolve, reject) => {
39578 let loadedCount = 0;
39579 function loaded() {
39581 if (loadedCount === 2)
39584 const head = select_default2("head");
39585 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() {
39588 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() {
39591 }).catch(function() {
39592 _loadViewerPromise = null;
39593 }).then(function() {
39594 that.initViewer(context);
39596 return _loadViewerPromise;
39598 // Load traffic sign image sprites
39599 loadSignResources: function(context) {
39600 context.ui().svgDefs.addSprites(
39601 ["mapillary-sprite"],
39603 /* don't override colors */
39607 // Load map (point) feature image sprites
39608 loadObjectResources: function(context) {
39609 context.ui().svgDefs.addSprites(
39610 ["mapillary-object-sprite"],
39612 /* don't override colors */
39616 // Remove previous detections in image viewer
39617 resetTags: function() {
39618 if (_mlyViewer && !_mlyFallback) {
39619 _mlyViewer.getComponent("tag").removeAll();
39622 // Show map feature detections in image viewer
39623 showFeatureDetections: function(value) {
39624 _mlyShowFeatureDetections = value;
39625 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
39629 // Show traffic sign detections in image viewer
39630 showSignDetections: function(value) {
39631 _mlyShowSignDetections = value;
39632 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
39636 // Apply filter to image viewer
39637 filterViewer: function(context) {
39638 const showsPano = context.photos().showsPanoramic();
39639 const showsFlat = context.photos().showsFlat();
39640 const fromDate = context.photos().fromDate();
39641 const toDate = context.photos().toDate();
39642 const filter2 = ["all"];
39644 filter2.push(["!=", "cameraType", "spherical"]);
39645 if (!showsFlat && showsPano)
39646 filter2.push(["==", "pano", true]);
39648 filter2.push([">=", "capturedAt", new Date(fromDate).getTime()]);
39651 filter2.push([">=", "capturedAt", new Date(toDate).getTime()]);
39654 _mlyViewer.setFilter(filter2);
39656 _mlyViewerFilter = filter2;
39659 // Make the image viewer visible
39660 showViewer: function(context) {
39661 const wrap2 = context.container().select(".photoviewer").classed("hide", false);
39662 const isHidden = wrap2.selectAll(".photo-wrapper.mly-wrapper.hide").size();
39663 if (isHidden && _mlyViewer) {
39664 wrap2.selectAll(".photo-wrapper:not(.mly-wrapper)").classed("hide", true);
39665 wrap2.selectAll(".photo-wrapper.mly-wrapper").classed("hide", false);
39666 _mlyViewer.resize();
39670 // Hide the image viewer and resets map markers
39671 hideViewer: function(context) {
39672 _mlyActiveImage = null;
39673 if (!_mlyFallback && _mlyViewer) {
39674 _mlyViewer.getComponent("sequence").stop();
39676 const viewer = context.container().select(".photoviewer");
39677 if (!viewer.empty())
39678 viewer.datum(null);
39679 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
39680 this.updateUrlImage(null);
39681 dispatch5.call("imageChanged");
39682 dispatch5.call("loadedMapFeatures");
39683 dispatch5.call("loadedSigns");
39684 return this.setStyles(context, null);
39686 // Update the URL with current image id
39687 updateUrlImage: function(imageId) {
39688 if (!window.mocha) {
39689 const hash = utilStringQs(window.location.hash);
39691 hash.photo = "mapillary/" + imageId;
39695 window.location.replace("#" + utilQsString(hash, true));
39698 // Highlight the detection in the viewer that is related to the clicked map feature
39699 highlightDetection: function(detection) {
39701 _mlyHighlightedDetection = detection.id;
39705 // Initialize image viewer (Mapillar JS)
39706 initViewer: function(context) {
39708 if (!window.mapillary)
39717 container: "ideditor-mly"
39719 if (!mapillary.isSupported() && mapillary.isFallbackSupported()) {
39720 _mlyFallback = true;
39735 _mlyViewer = new mapillary.Viewer(opts);
39736 _mlyViewer.on("image", imageChanged);
39737 _mlyViewer.on("bearing", bearingChanged);
39738 if (_mlyViewerFilter) {
39739 _mlyViewer.setFilter(_mlyViewerFilter);
39741 context.ui().photoviewer.on("resize.mapillary", function() {
39743 _mlyViewer.resize();
39745 function imageChanged(node) {
39747 const image = node.image;
39748 that.setActiveImage(image);
39749 that.setStyles(context, null);
39750 const loc = [image.originalLngLat.lng, image.originalLngLat.lat];
39751 context.map().centerEase(loc);
39752 that.updateUrlImage(image.id);
39753 if (_mlyShowFeatureDetections || _mlyShowSignDetections) {
39754 that.updateDetections(image.id, `${apiUrl}/${image.id}/detections?access_token=${accessToken}&fields=id,image,geometry,value`);
39756 dispatch5.call("imageChanged");
39758 function bearingChanged(e3) {
39759 dispatch5.call("bearingChanged", void 0, e3);
39762 // Move to an image
39763 selectImage: function(context, imageId) {
39764 if (_mlyViewer && imageId) {
39765 _mlyViewer.moveTo(imageId).catch(function(e3) {
39766 console.error("mly3", e3);
39771 // Return the currently displayed image
39772 getActiveImage: function() {
39773 return _mlyActiveImage;
39775 // Return a list of detection objects for the given id
39776 getDetections: function(id2) {
39777 return loadData(`${apiUrl}/${id2}/detections?access_token=${accessToken}&fields=id,value,image`);
39779 // Set the currently visible image
39780 setActiveImage: function(image) {
39782 _mlyActiveImage = {
39783 ca: image.originalCompassAngle,
39785 loc: [image.originalLngLat.lng, image.originalLngLat.lat],
39786 is_pano: image.cameraType === "spherical",
39787 sequence_id: image.sequenceId
39790 _mlyActiveImage = null;
39793 // Update the currently highlighted sequence and selected bubble.
39794 setStyles: function(context, hovered) {
39795 const hoveredImageId = hovered && hovered.id;
39796 const hoveredSequenceId = hovered && hovered.sequence_id;
39797 const selectedSequenceId = _mlyActiveImage && _mlyActiveImage.sequence_id;
39798 context.container().selectAll(".layer-mapillary .viewfield-group").classed("highlighted", function(d2) {
39799 return d2.sequence_id === selectedSequenceId || d2.id === hoveredImageId;
39800 }).classed("hovered", function(d2) {
39801 return d2.id === hoveredImageId;
39803 context.container().selectAll(".layer-mapillary .sequence").classed("highlighted", function(d2) {
39804 return d2.properties.id === hoveredSequenceId;
39805 }).classed("currentView", function(d2) {
39806 return d2.properties.id === selectedSequenceId;
39810 // Get detections for the current image and shows them in the image viewer
39811 updateDetections: function(imageId, url) {
39812 if (!_mlyViewer || _mlyFallback)
39816 const cache = _mlyCache.image_detections;
39817 if (cache.forImageId[imageId]) {
39818 showDetections(_mlyCache.image_detections.forImageId[imageId]);
39820 loadData(url).then((detections) => {
39821 detections.forEach(function(detection) {
39822 if (!cache.forImageId[imageId]) {
39823 cache.forImageId[imageId] = [];
39825 cache.forImageId[imageId].push({
39826 geometry: detection.geometry,
39829 value: detection.value
39832 showDetections(_mlyCache.image_detections.forImageId[imageId] || []);
39835 function showDetections(detections) {
39836 const tagComponent = _mlyViewer.getComponent("tag");
39837 detections.forEach(function(data) {
39838 const tag = makeTag(data);
39840 tagComponent.add([tag]);
39844 function makeTag(data) {
39845 const valueParts = data.value.split("--");
39846 if (!valueParts.length)
39850 let color2 = 16777215;
39851 if (_mlyHighlightedDetection === data.id) {
39853 text2 = valueParts[1];
39854 if (text2 === "flat" || text2 === "discrete" || text2 === "sign") {
39855 text2 = valueParts[2];
39857 text2 = text2.replace(/-/g, " ");
39858 text2 = text2.charAt(0).toUpperCase() + text2.slice(1);
39859 _mlyHighlightedDetection = null;
39861 var decodedGeometry = window.atob(data.geometry);
39862 var uintArray = new Uint8Array(decodedGeometry.length);
39863 for (var i3 = 0; i3 < decodedGeometry.length; i3++) {
39864 uintArray[i3] = decodedGeometry.charCodeAt(i3);
39866 const tile = new import_vector_tile.VectorTile(new import_pbf.default(uintArray.buffer));
39867 const layer = tile.layers["mpy-or"];
39868 const geometries = layer.feature(0).loadGeometry();
39869 const polygon2 = geometries.map((ring) => ring.map((point2) => [point2.x / layer.extent, point2.y / layer.extent]));
39870 tag = new mapillary.OutlineTag(
39872 new mapillary.PolygonGeometry(polygon2[0]),
39885 // Return the current cache
39886 cache: function() {
39891 // modules/core/validation/models.js
39892 function validationIssue(attrs) {
39893 this.type = attrs.type;
39894 this.subtype = attrs.subtype;
39895 this.severity = attrs.severity;
39896 this.message = attrs.message;
39897 this.reference = attrs.reference;
39898 this.entityIds = attrs.entityIds;
39899 this.loc = attrs.loc;
39900 this.data = attrs.data;
39901 this.dynamicFixes = attrs.dynamicFixes;
39902 this.hash = attrs.hash;
39903 this.id = generateID.apply(this);
39904 this.key = generateKey.apply(this);
39905 this.autoFix = null;
39906 function generateID() {
39907 var parts = [this.type];
39909 parts.push(this.hash);
39911 if (this.subtype) {
39912 parts.push(this.subtype);
39914 if (this.entityIds) {
39915 var entityKeys = this.entityIds.slice().sort();
39916 parts.push.apply(parts, entityKeys);
39918 return parts.join(":");
39920 function generateKey() {
39921 return this.id + ":" + Date.now().toString();
39923 this.extent = function(resolver) {
39925 return geoExtent(this.loc);
39927 if (this.entityIds && this.entityIds.length) {
39928 return this.entityIds.reduce(function(extent, entityId) {
39929 return extent.extend(resolver.entity(entityId).extent(resolver));
39934 this.fixes = function(context) {
39935 var fixes = this.dynamicFixes ? this.dynamicFixes(context) : [];
39937 if (issue.severity === "warning") {
39938 fixes.push(new validationIssueFix({
39939 title: _t.append("issues.fix.ignore_issue.title"),
39940 icon: "iD-icon-close",
39941 onClick: function() {
39942 context.validator().ignoreIssue(this.issue.id);
39946 fixes.forEach(function(fix) {
39947 fix.id = fix.title.stringId;
39949 if (fix.autoArgs) {
39950 issue.autoFix = fix;
39956 function validationIssueFix(attrs) {
39957 this.title = attrs.title;
39958 this.onClick = attrs.onClick;
39959 this.disabledReason = attrs.disabledReason;
39960 this.icon = attrs.icon;
39961 this.entityIds = attrs.entityIds || [];
39962 this.autoArgs = attrs.autoArgs;
39966 // modules/services/maprules.js
39967 var buildRuleChecks = function() {
39969 equals: function(equals) {
39970 return function(tags) {
39971 return Object.keys(equals).every(function(k2) {
39972 return equals[k2] === tags[k2];
39976 notEquals: function(notEquals) {
39977 return function(tags) {
39978 return Object.keys(notEquals).some(function(k2) {
39979 return notEquals[k2] !== tags[k2];
39983 absence: function(absence) {
39984 return function(tags) {
39985 return Object.keys(tags).indexOf(absence) === -1;
39988 presence: function(presence) {
39989 return function(tags) {
39990 return Object.keys(tags).indexOf(presence) > -1;
39993 greaterThan: function(greaterThan) {
39994 var key = Object.keys(greaterThan)[0];
39995 var value = greaterThan[key];
39996 return function(tags) {
39997 return tags[key] > value;
40000 greaterThanEqual: function(greaterThanEqual) {
40001 var key = Object.keys(greaterThanEqual)[0];
40002 var value = greaterThanEqual[key];
40003 return function(tags) {
40004 return tags[key] >= value;
40007 lessThan: function(lessThan) {
40008 var key = Object.keys(lessThan)[0];
40009 var value = lessThan[key];
40010 return function(tags) {
40011 return tags[key] < value;
40014 lessThanEqual: function(lessThanEqual) {
40015 var key = Object.keys(lessThanEqual)[0];
40016 var value = lessThanEqual[key];
40017 return function(tags) {
40018 return tags[key] <= value;
40021 positiveRegex: function(positiveRegex) {
40022 var tagKey = Object.keys(positiveRegex)[0];
40023 var expression = positiveRegex[tagKey].join("|");
40024 var regex = new RegExp(expression);
40025 return function(tags) {
40026 return regex.test(tags[tagKey]);
40029 negativeRegex: function(negativeRegex) {
40030 var tagKey = Object.keys(negativeRegex)[0];
40031 var expression = negativeRegex[tagKey].join("|");
40032 var regex = new RegExp(expression);
40033 return function(tags) {
40034 return !regex.test(tags[tagKey]);
40039 var buildLineKeys = function() {
40054 var maprules_default = {
40056 this._ruleChecks = buildRuleChecks();
40057 this._validationRules = [];
40058 this._areaKeys = osmAreaKeys;
40059 this._lineKeys = buildLineKeys();
40061 // list of rules only relevant to tag checks...
40062 filterRuleChecks: function(selector) {
40063 var _ruleChecks = this._ruleChecks;
40064 return Object.keys(selector).reduce(function(rules, key) {
40065 if (["geometry", "error", "warning"].indexOf(key) === -1) {
40066 rules.push(_ruleChecks[key](selector[key]));
40071 // builds tagMap from mapcss-parse selector object...
40072 buildTagMap: function(selector) {
40073 var getRegexValues = function(regexes) {
40074 return regexes.map(function(regex) {
40075 return regex.replace(/\$|\^/g, "");
40078 var tagMap = Object.keys(selector).reduce(function(expectedTags, key) {
40080 var isRegex = /regex/gi.test(key);
40081 var isEqual4 = /equals/gi.test(key);
40082 if (isRegex || isEqual4) {
40083 Object.keys(selector[key]).forEach(function(selectorKey) {
40084 values = isEqual4 ? [selector[key][selectorKey]] : getRegexValues(selector[key][selectorKey]);
40085 if (expectedTags.hasOwnProperty(selectorKey)) {
40086 values = values.concat(expectedTags[selectorKey]);
40088 expectedTags[selectorKey] = values;
40090 } else if (/(greater|less)Than(Equal)?|presence/g.test(key)) {
40091 var tagKey = /presence/.test(key) ? selector[key] : Object.keys(selector[key])[0];
40092 values = [selector[key][tagKey]];
40093 if (expectedTags.hasOwnProperty(tagKey)) {
40094 values = values.concat(expectedTags[tagKey]);
40096 expectedTags[tagKey] = values;
40098 return expectedTags;
40102 // inspired by osmWay#isArea()
40103 inferGeometry: function(tagMap) {
40104 var _lineKeys = this._lineKeys;
40105 var _areaKeys = this._areaKeys;
40106 var keyValueDoesNotImplyArea = function(key2) {
40107 return utilArrayIntersection(tagMap[key2], Object.keys(_areaKeys[key2])).length > 0;
40109 var keyValueImpliesLine = function(key2) {
40110 return utilArrayIntersection(tagMap[key2], Object.keys(_lineKeys[key2])).length > 0;
40112 if (tagMap.hasOwnProperty("area")) {
40113 if (tagMap.area.indexOf("yes") > -1) {
40116 if (tagMap.area.indexOf("no") > -1) {
40120 for (var key in tagMap) {
40121 if (key in _areaKeys && !keyValueDoesNotImplyArea(key)) {
40124 if (key in _lineKeys && keyValueImpliesLine(key)) {
40130 // adds from mapcss-parse selector check...
40131 addRule: function(selector) {
40133 // checks relevant to mapcss-selector
40134 checks: this.filterRuleChecks(selector),
40135 // true if all conditions for a tag error are true..
40136 matches: function(entity) {
40137 return this.checks.every(function(check) {
40138 return check(entity.tags);
40141 // borrowed from Way#isArea()
40142 inferredGeometry: this.inferGeometry(this.buildTagMap(selector), this._areaKeys),
40143 geometryMatches: function(entity, graph) {
40144 if (entity.type === "node" || entity.type === "relation") {
40145 return selector.geometry === entity.type;
40146 } else if (entity.type === "way") {
40147 return this.inferredGeometry === entity.geometry(graph);
40150 // when geometries match and tag matches are present, return a warning...
40151 findIssues: function(entity, graph, issues) {
40152 if (this.geometryMatches(entity, graph) && this.matches(entity)) {
40153 var severity = Object.keys(selector).indexOf("error") > -1 ? "error" : "warning";
40154 var message = selector[severity];
40155 issues.push(new validationIssue({
40158 message: function() {
40161 entityIds: [entity.id]
40166 this._validationRules.push(rule);
40168 clearRules: function() {
40169 this._validationRules = [];
40171 // returns validationRules...
40172 validationRules: function() {
40173 return this._validationRules;
40175 // returns ruleChecks
40176 ruleChecks: function() {
40177 return this._ruleChecks;
40181 // modules/services/nominatim.js
40182 var import_rbush7 = __toESM(require_rbush_min());
40184 // modules/core/difference.js
40185 var import_fast_deep_equal3 = __toESM(require_fast_deep_equal());
40186 function coreDifference(base, head) {
40188 var _didChange = {};
40190 function checkEntityID(id2) {
40191 var h2 = head.entities[id2];
40192 var b2 = base.entities[id2];
40198 _changes[id2] = { base: b2, head: h2 };
40199 _didChange.deletion = true;
40203 _changes[id2] = { base: b2, head: h2 };
40204 _didChange.addition = true;
40208 if (h2.members && b2.members && !(0, import_fast_deep_equal3.default)(h2.members, b2.members)) {
40209 _changes[id2] = { base: b2, head: h2 };
40210 _didChange.geometry = true;
40211 _didChange.properties = true;
40214 if (h2.loc && b2.loc && !geoVecEqual(h2.loc, b2.loc)) {
40215 _changes[id2] = { base: b2, head: h2 };
40216 _didChange.geometry = true;
40218 if (h2.nodes && b2.nodes && !(0, import_fast_deep_equal3.default)(h2.nodes, b2.nodes)) {
40219 _changes[id2] = { base: b2, head: h2 };
40220 _didChange.geometry = true;
40222 if (h2.tags && b2.tags && !(0, import_fast_deep_equal3.default)(h2.tags, b2.tags)) {
40223 _changes[id2] = { base: b2, head: h2 };
40224 _didChange.properties = true;
40229 var ids = utilArrayUniq(Object.keys(head.entities).concat(Object.keys(base.entities)));
40230 for (var i3 = 0; i3 < ids.length; i3++) {
40231 checkEntityID(ids[i3]);
40235 _diff.length = function length() {
40236 return Object.keys(_changes).length;
40238 _diff.changes = function changes() {
40241 _diff.didChange = _didChange;
40242 _diff.extantIDs = function extantIDs(includeRelMembers) {
40243 var result = /* @__PURE__ */ new Set();
40244 Object.keys(_changes).forEach(function(id2) {
40245 if (_changes[id2].head) {
40248 var h2 = _changes[id2].head;
40249 var b2 = _changes[id2].base;
40250 var entity = h2 || b2;
40251 if (includeRelMembers && entity.type === "relation") {
40252 var mh = h2 ? h2.members.map(function(m2) {
40255 var mb = b2 ? b2.members.map(function(m2) {
40258 utilArrayUnion(mh, mb).forEach(function(memberID) {
40259 if (head.hasEntity(memberID)) {
40260 result.add(memberID);
40265 return Array.from(result);
40267 _diff.modified = function modified() {
40269 Object.values(_changes).forEach(function(change) {
40270 if (change.base && change.head) {
40271 result.push(change.head);
40276 _diff.created = function created() {
40278 Object.values(_changes).forEach(function(change) {
40279 if (!change.base && change.head) {
40280 result.push(change.head);
40285 _diff.deleted = function deleted() {
40287 Object.values(_changes).forEach(function(change) {
40288 if (change.base && !change.head) {
40289 result.push(change.base);
40294 _diff.summary = function summary() {
40296 var keys2 = Object.keys(_changes);
40297 for (var i3 = 0; i3 < keys2.length; i3++) {
40298 var change = _changes[keys2[i3]];
40299 if (change.head && change.head.geometry(head) !== "vertex") {
40300 addEntity(change.head, head, change.base ? "modified" : "created");
40301 } else if (change.base && change.base.geometry(base) !== "vertex") {
40302 addEntity(change.base, base, "deleted");
40303 } else if (change.base && change.head) {
40304 var moved = !(0, import_fast_deep_equal3.default)(change.base.loc, change.head.loc);
40305 var retagged = !(0, import_fast_deep_equal3.default)(change.base.tags, change.head.tags);
40307 addParents(change.head);
40309 if (retagged || moved && change.head.hasInterestingTags()) {
40310 addEntity(change.head, head, "modified");
40312 } else if (change.head && change.head.hasInterestingTags()) {
40313 addEntity(change.head, head, "created");
40314 } else if (change.base && change.base.hasInterestingTags()) {
40315 addEntity(change.base, base, "deleted");
40318 return Object.values(relevant);
40319 function addEntity(entity, graph, changeType) {
40320 relevant[entity.id] = {
40326 function addParents(entity) {
40327 var parents = head.parentWays(entity);
40328 for (var j3 = parents.length - 1; j3 >= 0; j3--) {
40329 var parent = parents[j3];
40330 if (!(parent.id in relevant)) {
40331 addEntity(parent, head, "modified");
40336 _diff.complete = function complete(extent) {
40339 for (id2 in _changes) {
40340 change = _changes[id2];
40341 var h2 = change.head;
40342 var b2 = change.base;
40343 var entity = h2 || b2;
40345 if (extent && (!h2 || !h2.intersects(extent, head)) && (!b2 || !b2.intersects(extent, base))) {
40349 if (entity.type === "way") {
40350 var nh = h2 ? h2.nodes : [];
40351 var nb = b2 ? b2.nodes : [];
40353 diff = utilArrayDifference(nh, nb);
40354 for (i3 = 0; i3 < diff.length; i3++) {
40355 result[diff[i3]] = head.hasEntity(diff[i3]);
40357 diff = utilArrayDifference(nb, nh);
40358 for (i3 = 0; i3 < diff.length; i3++) {
40359 result[diff[i3]] = head.hasEntity(diff[i3]);
40362 if (entity.type === "relation" && entity.isMultipolygon()) {
40363 var mh = h2 ? h2.members.map(function(m2) {
40366 var mb = b2 ? b2.members.map(function(m2) {
40369 var ids = utilArrayUnion(mh, mb);
40370 for (i3 = 0; i3 < ids.length; i3++) {
40371 var member = head.hasEntity(ids[i3]);
40374 if (extent && !member.intersects(extent, head))
40376 result[ids[i3]] = member;
40379 addParents(head.parentWays(entity), result);
40380 addParents(head.parentRelations(entity), result);
40383 function addParents(parents, result2) {
40384 for (var i4 = 0; i4 < parents.length; i4++) {
40385 var parent = parents[i4];
40386 if (parent.id in result2)
40388 result2[parent.id] = parent;
40389 addParents(head.parentRelations(parent), result2);
40396 // modules/core/tree.js
40397 var import_rbush5 = __toESM(require_rbush_min());
40398 function coreTree(head) {
40399 var _rtree = new import_rbush5.default();
40401 var _segmentsRTree = new import_rbush5.default();
40402 var _segmentsBBoxes = {};
40403 var _segmentsByWayId = {};
40405 function entityBBox(entity) {
40406 var bbox2 = entity.extent(head).bbox();
40407 bbox2.id = entity.id;
40408 _bboxes[entity.id] = bbox2;
40411 function segmentBBox(segment) {
40412 var extent = segment.extent(head);
40415 var bbox2 = extent.bbox();
40416 bbox2.segment = segment;
40417 _segmentsBBoxes[segment.id] = bbox2;
40420 function removeEntity(entity) {
40421 _rtree.remove(_bboxes[entity.id]);
40422 delete _bboxes[entity.id];
40423 if (_segmentsByWayId[entity.id]) {
40424 _segmentsByWayId[entity.id].forEach(function(segment) {
40425 _segmentsRTree.remove(_segmentsBBoxes[segment.id]);
40426 delete _segmentsBBoxes[segment.id];
40428 delete _segmentsByWayId[entity.id];
40431 function loadEntities(entities) {
40432 _rtree.load(entities.map(entityBBox));
40434 entities.forEach(function(entity) {
40435 if (entity.segments) {
40436 var entitySegments = entity.segments(head);
40437 _segmentsByWayId[entity.id] = entitySegments;
40438 segments = segments.concat(entitySegments);
40441 if (segments.length)
40442 _segmentsRTree.load(segments.map(segmentBBox).filter(Boolean));
40444 function updateParents(entity, insertions, memo) {
40445 head.parentWays(entity).forEach(function(way) {
40446 if (_bboxes[way.id]) {
40448 insertions[way.id] = way;
40450 updateParents(way, insertions, memo);
40452 head.parentRelations(entity).forEach(function(relation) {
40453 if (memo[entity.id])
40455 memo[entity.id] = true;
40456 if (_bboxes[relation.id]) {
40457 removeEntity(relation);
40458 insertions[relation.id] = relation;
40460 updateParents(relation, insertions, memo);
40463 tree.rebase = function(entities, force) {
40464 var insertions = {};
40465 for (var i3 = 0; i3 < entities.length; i3++) {
40466 var entity = entities[i3];
40467 if (!entity.visible)
40469 if (head.entities.hasOwnProperty(entity.id) || _bboxes[entity.id]) {
40472 } else if (_bboxes[entity.id]) {
40473 removeEntity(entity);
40476 insertions[entity.id] = entity;
40477 updateParents(entity, insertions, {});
40479 loadEntities(Object.values(insertions));
40482 function updateToGraph(graph) {
40483 if (graph === head)
40485 var diff = coreDifference(head, graph);
40487 var changed = diff.didChange;
40488 if (!changed.addition && !changed.deletion && !changed.geometry)
40490 var insertions = {};
40491 if (changed.deletion) {
40492 diff.deleted().forEach(function(entity) {
40493 removeEntity(entity);
40496 if (changed.geometry) {
40497 diff.modified().forEach(function(entity) {
40498 removeEntity(entity);
40499 insertions[entity.id] = entity;
40500 updateParents(entity, insertions, {});
40503 if (changed.addition) {
40504 diff.created().forEach(function(entity) {
40505 insertions[entity.id] = entity;
40508 loadEntities(Object.values(insertions));
40510 tree.intersects = function(extent, graph) {
40511 updateToGraph(graph);
40512 return _rtree.search(extent.bbox()).map(function(bbox2) {
40513 return graph.entity(bbox2.id);
40516 tree.waySegments = function(extent, graph) {
40517 updateToGraph(graph);
40518 return _segmentsRTree.search(extent.bbox()).map(function(bbox2) {
40519 return bbox2.segment;
40525 // modules/svg/icon.js
40526 function svgIcon(name, svgklass, useklass) {
40527 return function drawIcon(selection2) {
40528 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);
40532 // modules/ui/modal.js
40533 function uiModal(selection2, blocking) {
40534 let keybinding = utilKeybinding("modal");
40535 let previous = selection2.select("div.modal");
40536 let animate = previous.empty();
40537 previous.transition().duration(200).style("opacity", 0).remove();
40538 let shaded = selection2.append("div").attr("class", "shaded").style("opacity", 0);
40539 shaded.close = () => {
40540 shaded.transition().duration(200).style("opacity", 0).remove();
40541 modal.transition().duration(200).style("top", "0px");
40542 select_default2(document).call(keybinding.unbind);
40544 let modal = shaded.append("div").attr("class", "modal fillL");
40545 modal.append("input").attr("class", "keytrap keytrap-first").on("focus.keytrap", moveFocusToLast);
40547 shaded.on("click.remove-modal", (d3_event) => {
40548 if (d3_event.target === this) {
40552 modal.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", shaded.close).call(svgIcon("#iD-icon-close"));
40553 keybinding.on("\u232B", shaded.close).on("\u238B", shaded.close);
40554 select_default2(document).call(keybinding);
40556 modal.append("div").attr("class", "content");
40557 modal.append("input").attr("class", "keytrap keytrap-last").on("focus.keytrap", moveFocusToFirst);
40559 shaded.transition().style("opacity", 1);
40561 shaded.style("opacity", 1);
40564 function moveFocusToFirst() {
40565 let node = modal.select("a, button, input:not(.keytrap), select, textarea").node();
40569 select_default2(this).node().blur();
40572 function moveFocusToLast() {
40573 let nodes = modal.selectAll("a, button, input:not(.keytrap), select, textarea").nodes();
40574 if (nodes.length) {
40575 nodes[nodes.length - 1].focus();
40577 select_default2(this).node().blur();
40582 // modules/ui/loading.js
40583 function uiLoading(context) {
40584 let _modalSelection = select_default2(null);
40586 let _blocking = false;
40587 let loading = (selection2) => {
40588 _modalSelection = uiModal(selection2, _blocking);
40589 let loadertext = _modalSelection.select(".content").classed("loading-modal", true).append("div").attr("class", "modal-section fillL");
40590 loadertext.append("img").attr("class", "loader").attr("src", context.imagePath("loader-white.gif"));
40591 loadertext.append("h3").html(_message);
40592 _modalSelection.select("button.close").attr("class", "hide");
40595 loading.message = function(val) {
40596 if (!arguments.length)
40601 loading.blocking = function(val) {
40602 if (!arguments.length)
40607 loading.close = () => {
40608 _modalSelection.remove();
40610 loading.isShown = () => {
40611 return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
40616 // modules/core/history.js
40617 function coreHistory(context) {
40618 var dispatch14 = dispatch_default("reset", "change", "merge", "restore", "undone", "redone", "storage_error");
40619 var lock = utilSessionMutex("lock");
40620 var _hasUnresolvedRestorableChanges = lock.lock() && !!corePreferences(getKey("saved_history"));
40621 var duration = 150;
40622 var _imageryUsed = [];
40623 var _photoOverlaysUsed = [];
40624 var _checkpoints = {};
40629 function _act(actions, t2) {
40630 actions = Array.prototype.slice.call(actions);
40632 if (typeof actions[actions.length - 1] !== "function") {
40633 annotation = actions.pop();
40635 var graph = _stack[_index].graph;
40636 for (var i3 = 0; i3 < actions.length; i3++) {
40637 graph = actions[i3](graph, t2);
40642 imageryUsed: _imageryUsed,
40643 photoOverlaysUsed: _photoOverlaysUsed,
40644 transform: context.projection.transform(),
40645 selectedIDs: context.selectedIDs()
40648 function _perform(args, t2) {
40649 var previous = _stack[_index].graph;
40650 _stack = _stack.slice(0, _index + 1);
40651 var actionResult = _act(args, t2);
40652 _stack.push(actionResult);
40654 return change(previous);
40656 function _replace(args, t2) {
40657 var previous = _stack[_index].graph;
40658 var actionResult = _act(args, t2);
40659 _stack[_index] = actionResult;
40660 return change(previous);
40662 function _overwrite(args, t2) {
40663 var previous = _stack[_index].graph;
40668 _stack = _stack.slice(0, _index + 1);
40669 var actionResult = _act(args, t2);
40670 _stack.push(actionResult);
40672 return change(previous);
40674 function change(previous) {
40675 var difference = coreDifference(previous, history.graph());
40676 if (!_pausedGraph) {
40677 dispatch14.call("change", this, difference);
40681 function getKey(n3) {
40682 return "iD_" + window.location.origin + "_" + n3;
40685 graph: function() {
40686 return _stack[_index].graph;
40692 return _stack[0].graph;
40694 merge: function(entities) {
40695 var stack = _stack.map(function(state) {
40696 return state.graph;
40698 _stack[0].graph.rebase(entities, stack, false);
40699 _tree.rebase(entities, false);
40700 dispatch14.call("merge", this, entities);
40702 perform: function() {
40703 select_default2(document).interrupt("history.perform");
40704 var transitionable = false;
40705 var action0 = arguments[0];
40706 if (arguments.length === 1 || arguments.length === 2 && typeof arguments[1] !== "function") {
40707 transitionable = !!action0.transitionable;
40709 if (transitionable) {
40710 var origArguments = arguments;
40711 select_default2(document).transition("history.perform").duration(duration).ease(linear2).tween("history.tween", function() {
40712 return function(t2) {
40714 _overwrite([action0], t2);
40716 }).on("start", function() {
40717 _perform([action0], 0);
40718 }).on("end interrupt", function() {
40719 _overwrite(origArguments, 1);
40722 return _perform(arguments);
40725 replace: function() {
40726 select_default2(document).interrupt("history.perform");
40727 return _replace(arguments, 1);
40729 // Same as calling pop and then perform
40730 overwrite: function() {
40731 select_default2(document).interrupt("history.perform");
40732 return _overwrite(arguments, 1);
40734 pop: function(n3) {
40735 select_default2(document).interrupt("history.perform");
40736 var previous = _stack[_index].graph;
40737 if (isNaN(+n3) || +n3 < 0) {
40740 while (n3-- > 0 && _index > 0) {
40744 return change(previous);
40746 // Back to the previous annotated state or _index = 0.
40748 select_default2(document).interrupt("history.perform");
40749 var previousStack = _stack[_index];
40750 var previous = previousStack.graph;
40751 while (_index > 0) {
40753 if (_stack[_index].annotation)
40756 dispatch14.call("undone", this, _stack[_index], previousStack);
40757 return change(previous);
40759 // Forward to the next annotated state.
40761 select_default2(document).interrupt("history.perform");
40762 var previousStack = _stack[_index];
40763 var previous = previousStack.graph;
40764 var tryIndex = _index;
40765 while (tryIndex < _stack.length - 1) {
40767 if (_stack[tryIndex].annotation) {
40769 dispatch14.call("redone", this, _stack[_index], previousStack);
40773 return change(previous);
40775 pauseChangeDispatch: function() {
40776 if (!_pausedGraph) {
40777 _pausedGraph = _stack[_index].graph;
40780 resumeChangeDispatch: function() {
40781 if (_pausedGraph) {
40782 var previous = _pausedGraph;
40783 _pausedGraph = null;
40784 return change(previous);
40787 undoAnnotation: function() {
40790 if (_stack[i3].annotation)
40791 return _stack[i3].annotation;
40795 redoAnnotation: function() {
40796 var i3 = _index + 1;
40797 while (i3 <= _stack.length - 1) {
40798 if (_stack[i3].annotation)
40799 return _stack[i3].annotation;
40803 // Returns the entities from the active graph with bounding boxes
40804 // overlapping the given `extent`.
40805 intersects: function(extent) {
40806 return _tree.intersects(extent, _stack[_index].graph);
40808 difference: function() {
40809 var base = _stack[0].graph;
40810 var head = _stack[_index].graph;
40811 return coreDifference(base, head);
40813 changes: function(action) {
40814 var base = _stack[0].graph;
40815 var head = _stack[_index].graph;
40817 head = action(head);
40819 var difference = coreDifference(base, head);
40821 modified: difference.modified(),
40822 created: difference.created(),
40823 deleted: difference.deleted()
40826 hasChanges: function() {
40827 return this.difference().length() > 0;
40829 imageryUsed: function(sources) {
40831 _imageryUsed = sources;
40834 var s2 = /* @__PURE__ */ new Set();
40835 _stack.slice(1, _index + 1).forEach(function(state) {
40836 state.imageryUsed.forEach(function(source) {
40837 if (source !== "Custom") {
40842 return Array.from(s2);
40845 photoOverlaysUsed: function(sources) {
40847 _photoOverlaysUsed = sources;
40850 var s2 = /* @__PURE__ */ new Set();
40851 _stack.slice(1, _index + 1).forEach(function(state) {
40852 if (state.photoOverlaysUsed && Array.isArray(state.photoOverlaysUsed)) {
40853 state.photoOverlaysUsed.forEach(function(photoOverlay) {
40854 s2.add(photoOverlay);
40858 return Array.from(s2);
40861 // save the current history state
40862 checkpoint: function(key) {
40863 _checkpoints[key] = {
40869 // restore history state to a given checkpoint or reset completely
40870 reset: function(key) {
40871 if (key !== void 0 && _checkpoints.hasOwnProperty(key)) {
40872 _stack = _checkpoints[key].stack;
40873 _index = _checkpoints[key].index;
40875 _stack = [{ graph: coreGraph() }];
40877 _tree = coreTree(_stack[0].graph);
40880 dispatch14.call("reset");
40881 dispatch14.call("change");
40884 // `toIntroGraph()` is used to export the intro graph used by the walkthrough.
40887 // 1. Start the walkthrough.
40888 // 2. Get to a "free editing" tutorial step
40889 // 3. Make your edits to the walkthrough map
40890 // 4. In your browser dev console run:
40891 // `id.history().toIntroGraph()`
40892 // 5. This outputs stringified JSON to the browser console
40893 // 6. Copy it to `data/intro_graph.json` and prettify it in your code editor
40894 toIntroGraph: function() {
40895 var nextID = { n: 0, r: 0, w: 0 };
40897 var graph = this.graph();
40898 var baseEntities = {};
40899 Object.values(graph.base().entities).forEach(function(entity) {
40900 var copy2 = copyIntroEntity(entity);
40901 baseEntities[copy2.id] = copy2;
40903 Object.keys(graph.entities).forEach(function(id2) {
40904 var entity = graph.entities[id2];
40906 var copy2 = copyIntroEntity(entity);
40907 baseEntities[copy2.id] = copy2;
40909 delete baseEntities[id2];
40912 Object.values(baseEntities).forEach(function(entity) {
40913 if (Array.isArray(entity.nodes)) {
40914 entity.nodes = entity.nodes.map(function(node) {
40915 return permIDs[node] || node;
40918 if (Array.isArray(entity.members)) {
40919 entity.members = entity.members.map(function(member) {
40920 member.id = permIDs[member.id] || member.id;
40925 return JSON.stringify({ dataIntroGraph: baseEntities });
40926 function copyIntroEntity(source) {
40927 var copy2 = utilObjectOmit(source, ["type", "user", "v", "version", "visible"]);
40928 if (copy2.tags && !Object.keys(copy2.tags)) {
40931 if (Array.isArray(copy2.loc)) {
40932 copy2.loc[0] = +copy2.loc[0].toFixed(6);
40933 copy2.loc[1] = +copy2.loc[1].toFixed(6);
40935 var match = source.id.match(/([nrw])-\d*/);
40936 if (match !== null) {
40937 var nrw = match[1];
40940 permID = nrw + ++nextID[nrw];
40941 } while (baseEntities.hasOwnProperty(permID));
40942 copy2.id = permIDs[source.id] = permID;
40947 toJSON: function() {
40948 if (!this.hasChanges())
40950 var allEntities = {};
40951 var baseEntities = {};
40952 var base = _stack[0];
40953 var s2 = _stack.map(function(i3) {
40956 Object.keys(i3.graph.entities).forEach(function(id2) {
40957 var entity = i3.graph.entities[id2];
40959 var key = osmEntity.key(entity);
40960 allEntities[key] = entity;
40961 modified.push(key);
40965 if (id2 in base.graph.entities) {
40966 baseEntities[id2] = base.graph.entities[id2];
40968 if (entity && entity.nodes) {
40969 entity.nodes.forEach(function(nodeID) {
40970 if (nodeID in base.graph.entities) {
40971 baseEntities[nodeID] = base.graph.entities[nodeID];
40975 var baseParents = base.graph._parentWays[id2];
40977 baseParents.forEach(function(parentID) {
40978 if (parentID in base.graph.entities) {
40979 baseEntities[parentID] = base.graph.entities[parentID];
40985 if (modified.length)
40986 x2.modified = modified;
40987 if (deleted.length)
40988 x2.deleted = deleted;
40989 if (i3.imageryUsed)
40990 x2.imageryUsed = i3.imageryUsed;
40991 if (i3.photoOverlaysUsed)
40992 x2.photoOverlaysUsed = i3.photoOverlaysUsed;
40994 x2.annotation = i3.annotation;
40996 x2.transform = i3.transform;
40997 if (i3.selectedIDs)
40998 x2.selectedIDs = i3.selectedIDs;
41001 return JSON.stringify({
41003 entities: Object.values(allEntities),
41004 baseEntities: Object.values(baseEntities),
41006 nextIDs: osmEntity.id.next,
41008 // note the time the changes were saved
41009 timestamp: (/* @__PURE__ */ new Date()).getTime()
41012 fromJSON: function(json, loadChildNodes) {
41013 var h2 = JSON.parse(json);
41014 var loadComplete = true;
41015 osmEntity.id.next = h2.nextIDs;
41017 if (h2.version === 2 || h2.version === 3) {
41018 var allEntities = {};
41019 h2.entities.forEach(function(entity) {
41020 allEntities[osmEntity.key(entity)] = osmEntity(entity);
41022 if (h2.version === 3) {
41023 var baseEntities = h2.baseEntities.map(function(d2) {
41024 return osmEntity(d2);
41026 var stack = _stack.map(function(state) {
41027 return state.graph;
41029 _stack[0].graph.rebase(baseEntities, stack, true);
41030 _tree.rebase(baseEntities, true);
41031 if (loadChildNodes) {
41032 var osm = context.connection();
41033 var baseWays = baseEntities.filter(function(e3) {
41034 return e3.type === "way";
41036 var nodeIDs = baseWays.reduce(function(acc, way) {
41037 return utilArrayUnion(acc, way.nodes);
41039 var missing = nodeIDs.filter(function(n3) {
41040 return !_stack[0].graph.hasEntity(n3);
41042 if (missing.length && osm) {
41043 loadComplete = false;
41044 context.map().redrawEnable(false);
41045 var loading = uiLoading(context).blocking(true);
41046 context.container().call(loading);
41047 var childNodesLoaded = function(err, result) {
41049 var visibleGroups = utilArrayGroupBy(result.data, "visible");
41050 var visibles = visibleGroups.true || [];
41051 var invisibles = visibleGroups.false || [];
41052 if (visibles.length) {
41053 var visibleIDs = visibles.map(function(entity) {
41056 var stack2 = _stack.map(function(state) {
41057 return state.graph;
41059 missing = utilArrayDifference(missing, visibleIDs);
41060 _stack[0].graph.rebase(visibles, stack2, true);
41061 _tree.rebase(visibles, true);
41063 invisibles.forEach(function(entity) {
41064 osm.loadEntityVersion(entity.id, +entity.version - 1, childNodesLoaded);
41067 if (err || !missing.length) {
41069 context.map().redrawEnable(true);
41070 dispatch14.call("change");
41071 dispatch14.call("restore", this);
41074 osm.loadMultiple(missing, childNodesLoaded);
41078 _stack = h2.stack.map(function(d2) {
41079 var entities = {}, entity;
41081 d2.modified.forEach(function(key) {
41082 entity = allEntities[key];
41083 entities[entity.id] = entity;
41087 d2.deleted.forEach(function(id2) {
41088 entities[id2] = void 0;
41092 graph: coreGraph(_stack[0].graph).load(entities),
41093 annotation: d2.annotation,
41094 imageryUsed: d2.imageryUsed,
41095 photoOverlaysUsed: d2.photoOverlaysUsed,
41096 transform: d2.transform,
41097 selectedIDs: d2.selectedIDs
41101 _stack = h2.stack.map(function(d2) {
41103 for (var i3 in d2.entities) {
41104 var entity = d2.entities[i3];
41105 entities[i3] = entity === "undefined" ? void 0 : osmEntity(entity);
41107 d2.graph = coreGraph(_stack[0].graph).load(entities);
41111 var transform2 = _stack[_index].transform;
41113 context.map().transformEase(transform2, 0);
41115 if (loadComplete) {
41116 dispatch14.call("change");
41117 dispatch14.call("restore", this);
41122 return lock.lock();
41124 unlock: function() {
41128 if (lock.locked() && // don't overwrite existing, unresolved changes
41129 !_hasUnresolvedRestorableChanges) {
41130 const success = corePreferences(getKey("saved_history"), history.toJSON() || null);
41132 dispatch14.call("storage_error");
41136 // delete the history version saved in localStorage
41137 clearSaved: function() {
41138 context.debouncedSave.cancel();
41139 if (lock.locked()) {
41140 _hasUnresolvedRestorableChanges = false;
41141 corePreferences(getKey("saved_history"), null);
41142 corePreferences("comment", null);
41143 corePreferences("hashtags", null);
41144 corePreferences("source", null);
41148 savedHistoryJSON: function() {
41149 return corePreferences(getKey("saved_history"));
41151 hasRestorableChanges: function() {
41152 return _hasUnresolvedRestorableChanges;
41154 // load history from a version stored in localStorage
41155 restore: function() {
41156 if (lock.locked()) {
41157 _hasUnresolvedRestorableChanges = false;
41158 var json = this.savedHistoryJSON();
41160 history.fromJSON(json, true);
41166 return utilRebind(history, dispatch14, "on");
41169 // modules/validations/index.js
41170 var validations_exports = {};
41171 __export(validations_exports, {
41172 validationAlmostJunction: () => validationAlmostJunction,
41173 validationCloseNodes: () => validationCloseNodes,
41174 validationCrossingWays: () => validationCrossingWays,
41175 validationDisconnectedWay: () => validationDisconnectedWay,
41176 validationFormatting: () => validationFormatting,
41177 validationHelpRequest: () => validationHelpRequest,
41178 validationImpossibleOneway: () => validationImpossibleOneway,
41179 validationIncompatibleSource: () => validationIncompatibleSource,
41180 validationMaprules: () => validationMaprules,
41181 validationMismatchedGeometry: () => validationMismatchedGeometry,
41182 validationMissingRole: () => validationMissingRole,
41183 validationMissingTag: () => validationMissingTag,
41184 validationOutdatedTags: () => validationOutdatedTags,
41185 validationPrivateData: () => validationPrivateData,
41186 validationSuspiciousName: () => validationSuspiciousName,
41187 validationUnsquareWay: () => validationUnsquareWay
41190 // modules/validations/almost_junction.js
41191 function validationAlmostJunction(context) {
41192 const type2 = "almost_junction";
41193 const EXTEND_TH_METERS = 5;
41194 const WELD_TH_METERS = 0.75;
41195 const CLOSE_NODE_TH = EXTEND_TH_METERS - WELD_TH_METERS;
41196 const SIG_ANGLE_TH = Math.atan(WELD_TH_METERS / EXTEND_TH_METERS);
41197 function isHighway(entity) {
41198 return entity.type === "way" && osmRoutableHighwayTagValues[entity.tags.highway];
41200 function isTaggedAsNotContinuing(node) {
41201 return node.tags.noexit === "yes" || node.tags.amenity === "parking_entrance" || node.tags.entrance && node.tags.entrance !== "no";
41203 const validation = function checkAlmostJunction(entity, graph) {
41204 if (!isHighway(entity))
41206 if (entity.isDegenerate())
41208 const tree = context.history().tree();
41209 const extendableNodeInfos = findConnectableEndNodesByExtension(entity);
41211 extendableNodeInfos.forEach((extendableNodeInfo) => {
41212 issues.push(new validationIssue({
41214 subtype: "highway-highway",
41215 severity: "warning",
41216 message: function(context2) {
41217 const entity1 = context2.hasEntity(this.entityIds[0]);
41218 if (this.entityIds[0] === this.entityIds[2]) {
41219 return entity1 ? _t.append("issues.almost_junction.self.message", {
41220 feature: utilDisplayLabel(entity1, context2.graph())
41223 const entity2 = context2.hasEntity(this.entityIds[2]);
41224 return entity1 && entity2 ? _t.append("issues.almost_junction.message", {
41225 feature: utilDisplayLabel(entity1, context2.graph()),
41226 feature2: utilDisplayLabel(entity2, context2.graph())
41230 reference: showReference,
41233 extendableNodeInfo.node.id,
41234 extendableNodeInfo.wid
41236 loc: extendableNodeInfo.node.loc,
41237 hash: JSON.stringify(extendableNodeInfo.node.loc),
41239 midId: extendableNodeInfo.mid.id,
41240 edge: extendableNodeInfo.edge,
41241 cross_loc: extendableNodeInfo.cross_loc
41243 dynamicFixes: makeFixes
41247 function makeFixes(context2) {
41248 let fixes = [new validationIssueFix({
41249 icon: "iD-icon-abutment",
41250 title: _t.append("issues.fix.connect_features.title"),
41251 onClick: function(context3) {
41252 const annotation = _t("issues.fix.connect_almost_junction.annotation");
41253 const [, endNodeId, crossWayId] = this.issue.entityIds;
41254 const midNode = context3.entity(this.issue.data.midId);
41255 const endNode = context3.entity(endNodeId);
41256 const crossWay = context3.entity(crossWayId);
41257 const nearEndNodes = findNearbyEndNodes(endNode, crossWay);
41258 if (nearEndNodes.length > 0) {
41259 const collinear = findSmallJoinAngle(midNode, endNode, nearEndNodes);
41262 actionMergeNodes([collinear.id, endNode.id], collinear.loc),
41268 const targetEdge = this.issue.data.edge;
41269 const crossLoc = this.issue.data.cross_loc;
41270 const edgeNodes = [context3.entity(targetEdge[0]), context3.entity(targetEdge[1])];
41271 const closestNodeInfo = geoSphericalClosestNode(edgeNodes, crossLoc);
41272 if (closestNodeInfo.distance < WELD_TH_METERS) {
41274 actionMergeNodes([closestNodeInfo.node.id, endNode.id], closestNodeInfo.node.loc),
41279 actionAddMidpoint({ loc: crossLoc, edge: targetEdge }, endNode),
41285 const node = context2.hasEntity(this.entityIds[1]);
41286 if (node && !node.hasInterestingTags()) {
41287 fixes.push(new validationIssueFix({
41288 icon: "maki-barrier",
41289 title: _t.append("issues.fix.tag_as_disconnected.title"),
41290 onClick: function(context3) {
41291 const nodeID = this.issue.entityIds[1];
41292 const tags = Object.assign({}, context3.entity(nodeID).tags);
41293 tags.noexit = "yes";
41295 actionChangeTags(nodeID, tags),
41296 _t("issues.fix.tag_as_disconnected.annotation")
41303 function showReference(selection2) {
41304 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.almost_junction.highway-highway.reference"));
41306 function isExtendableCandidate(node, way) {
41307 const osm = services.osm;
41308 if (osm && !osm.isDataLoaded(node.loc)) {
41311 if (isTaggedAsNotContinuing(node) || graph.parentWays(node).length !== 1) {
41314 let occurrences = 0;
41315 for (const index in way.nodes) {
41316 if (way.nodes[index] === node.id) {
41318 if (occurrences > 1) {
41325 function findConnectableEndNodesByExtension(way) {
41327 if (way.isClosed())
41330 const indices = [0, way.nodes.length - 1];
41331 indices.forEach((nodeIndex) => {
41332 const nodeID = way.nodes[nodeIndex];
41333 const node = graph.entity(nodeID);
41334 if (!isExtendableCandidate(node, way))
41336 const connectionInfo = canConnectByExtend(way, nodeIndex);
41337 if (!connectionInfo)
41339 testNodes = graph.childNodes(way).slice();
41340 testNodes[nodeIndex] = testNodes[nodeIndex].move(connectionInfo.cross_loc);
41341 if (geoHasSelfIntersections(testNodes, nodeID))
41343 results.push(connectionInfo);
41347 function findNearbyEndNodes(node, way) {
41350 way.nodes[way.nodes.length - 1]
41351 ].map((d2) => graph.entity(d2)).filter((d2) => {
41352 return d2.id !== node.id && geoSphericalDistance(node.loc, d2.loc) <= CLOSE_NODE_TH;
41355 function findSmallJoinAngle(midNode, tipNode, endNodes) {
41357 let minAngle = Infinity;
41358 endNodes.forEach((endNode) => {
41359 const a1 = geoAngle(midNode, tipNode, context.projection) + Math.PI;
41360 const a2 = geoAngle(midNode, endNode, context.projection) + Math.PI;
41361 const diff = Math.max(a1, a2) - Math.min(a1, a2);
41362 if (diff < minAngle) {
41367 if (minAngle <= SIG_ANGLE_TH)
41371 function hasTag(tags, key) {
41372 return tags[key] !== void 0 && tags[key] !== "no";
41374 function canConnectWays(way, way2) {
41375 if (way.id === way2.id)
41377 if ((hasTag(way.tags, "bridge") || hasTag(way2.tags, "bridge")) && !(hasTag(way.tags, "bridge") && hasTag(way2.tags, "bridge")))
41379 if ((hasTag(way.tags, "tunnel") || hasTag(way2.tags, "tunnel")) && !(hasTag(way.tags, "tunnel") && hasTag(way2.tags, "tunnel")))
41381 const layer1 = way.tags.layer || "0", layer2 = way2.tags.layer || "0";
41382 if (layer1 !== layer2)
41384 const level1 = way.tags.level || "0", level2 = way2.tags.level || "0";
41385 if (level1 !== level2)
41389 function canConnectByExtend(way, endNodeIdx) {
41390 const tipNid = way.nodes[endNodeIdx];
41391 const midNid = endNodeIdx === 0 ? way.nodes[1] : way.nodes[way.nodes.length - 2];
41392 const tipNode = graph.entity(tipNid);
41393 const midNode = graph.entity(midNid);
41394 const lon = tipNode.loc[0];
41395 const lat = tipNode.loc[1];
41396 const lon_range = geoMetersToLon(EXTEND_TH_METERS, lat) / 2;
41397 const lat_range = geoMetersToLat(EXTEND_TH_METERS) / 2;
41398 const queryExtent = geoExtent([
41399 [lon - lon_range, lat - lat_range],
41400 [lon + lon_range, lat + lat_range]
41402 const edgeLen = geoSphericalDistance(midNode.loc, tipNode.loc);
41403 const t2 = EXTEND_TH_METERS / edgeLen + 1;
41404 const extTipLoc = geoVecInterp(midNode.loc, tipNode.loc, t2);
41405 const segmentInfos = tree.waySegments(queryExtent, graph);
41406 for (let i3 = 0; i3 < segmentInfos.length; i3++) {
41407 let segmentInfo = segmentInfos[i3];
41408 let way2 = graph.entity(segmentInfo.wayId);
41409 if (!isHighway(way2))
41411 if (!canConnectWays(way, way2))
41413 let nAid = segmentInfo.nodes[0], nBid = segmentInfo.nodes[1];
41414 if (nAid === tipNid || nBid === tipNid)
41416 let nA = graph.entity(nAid), nB = graph.entity(nBid);
41417 let crossLoc = geoLineIntersection([tipNode.loc, extTipLoc], [nA.loc, nB.loc]);
41423 edge: [nA.id, nB.id],
41424 cross_loc: crossLoc
41431 validation.type = type2;
41435 // modules/validations/close_nodes.js
41436 function validationCloseNodes(context) {
41437 var type2 = "close_nodes";
41438 var pointThresholdMeters = 0.2;
41439 var validation = function(entity, graph) {
41440 if (entity.type === "node") {
41441 return getIssuesForNode(entity);
41442 } else if (entity.type === "way") {
41443 return getIssuesForWay(entity);
41446 function getIssuesForNode(node) {
41447 var parentWays = graph.parentWays(node);
41448 if (parentWays.length) {
41449 return getIssuesForVertex(node, parentWays);
41451 return getIssuesForDetachedPoint(node);
41454 function wayTypeFor(way) {
41455 if (way.tags.boundary && way.tags.boundary !== "no")
41457 if (way.tags.indoor && way.tags.indoor !== "no")
41459 if (way.tags.building && way.tags.building !== "no" || way.tags["building:part"] && way.tags["building:part"] !== "no")
41461 if (osmPathHighwayTagValues[way.tags.highway])
41463 var parentRelations = graph.parentRelations(way);
41464 for (var i3 in parentRelations) {
41465 var relation = parentRelations[i3];
41466 if (relation.tags.type === "boundary")
41468 if (relation.isMultipolygon()) {
41469 if (relation.tags.indoor && relation.tags.indoor !== "no")
41471 if (relation.tags.building && relation.tags.building !== "no" || relation.tags["building:part"] && relation.tags["building:part"] !== "no")
41477 function shouldCheckWay(way) {
41478 if (way.nodes.length <= 2 || way.isClosed() && way.nodes.length <= 4)
41480 var bbox2 = way.extent(graph).bbox();
41481 var hypotenuseMeters = geoSphericalDistance([bbox2.minX, bbox2.minY], [bbox2.maxX, bbox2.maxY]);
41482 if (hypotenuseMeters < 1.5)
41486 function getIssuesForWay(way) {
41487 if (!shouldCheckWay(way))
41489 var issues = [], nodes = graph.childNodes(way);
41490 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
41491 var node1 = nodes[i3];
41492 var node2 = nodes[i3 + 1];
41493 var issue = getWayIssueIfAny(node1, node2, way);
41495 issues.push(issue);
41499 function getIssuesForVertex(node, parentWays) {
41501 function checkForCloseness(node1, node2, way) {
41502 var issue = getWayIssueIfAny(node1, node2, way);
41504 issues.push(issue);
41506 for (var i3 = 0; i3 < parentWays.length; i3++) {
41507 var parentWay = parentWays[i3];
41508 if (!shouldCheckWay(parentWay))
41510 var lastIndex = parentWay.nodes.length - 1;
41511 for (var j3 = 0; j3 < parentWay.nodes.length; j3++) {
41513 if (parentWay.nodes[j3 - 1] === node.id) {
41514 checkForCloseness(node, graph.entity(parentWay.nodes[j3]), parentWay);
41517 if (j3 !== lastIndex) {
41518 if (parentWay.nodes[j3 + 1] === node.id) {
41519 checkForCloseness(graph.entity(parentWay.nodes[j3]), node, parentWay);
41526 function thresholdMetersForWay(way) {
41527 if (!shouldCheckWay(way))
41529 var wayType = wayTypeFor(way);
41530 if (wayType === "boundary")
41532 if (wayType === "indoor")
41534 if (wayType === "building")
41536 if (wayType === "path")
41540 function getIssuesForDetachedPoint(node) {
41542 var lon = node.loc[0];
41543 var lat = node.loc[1];
41544 var lon_range = geoMetersToLon(pointThresholdMeters, lat) / 2;
41545 var lat_range = geoMetersToLat(pointThresholdMeters) / 2;
41546 var queryExtent = geoExtent([
41547 [lon - lon_range, lat - lat_range],
41548 [lon + lon_range, lat + lat_range]
41550 var intersected = context.history().tree().intersects(queryExtent, graph);
41551 for (var j3 = 0; j3 < intersected.length; j3++) {
41552 var nearby = intersected[j3];
41553 if (nearby.id === node.id)
41555 if (nearby.type !== "node" || nearby.geometry(graph) !== "point")
41557 if (nearby.loc === node.loc || geoSphericalDistance(node.loc, nearby.loc) < pointThresholdMeters) {
41558 if ("memorial:type" in node.tags && "memorial:type" in nearby.tags && node.tags["memorial:type"] === "stolperstein" && nearby.tags["memorial:type"] === "stolperstein")
41560 if ("memorial" in node.tags && "memorial" in nearby.tags && node.tags.memorial === "stolperstein" && nearby.tags.memorial === "stolperstein")
41562 var zAxisKeys = { layer: true, level: true, "addr:housenumber": true, "addr:unit": true };
41563 var zAxisDifferentiates = false;
41564 for (var key in zAxisKeys) {
41565 var nodeValue = node.tags[key] || "0";
41566 var nearbyValue = nearby.tags[key] || "0";
41567 if (nodeValue !== nearbyValue) {
41568 zAxisDifferentiates = true;
41572 if (zAxisDifferentiates)
41574 issues.push(new validationIssue({
41576 subtype: "detached",
41577 severity: "warning",
41578 message: function(context2) {
41579 var entity2 = context2.hasEntity(this.entityIds[0]), entity22 = context2.hasEntity(this.entityIds[1]);
41580 return entity2 && entity22 ? _t.append("issues.close_nodes.detached.message", {
41581 feature: utilDisplayLabel(entity2, context2.graph()),
41582 feature2: utilDisplayLabel(entity22, context2.graph())
41585 reference: showReference,
41586 entityIds: [node.id, nearby.id],
41587 dynamicFixes: function() {
41589 new validationIssueFix({
41590 icon: "iD-operation-disconnect",
41591 title: _t.append("issues.fix.move_points_apart.title")
41593 new validationIssueFix({
41594 icon: "iD-icon-layers",
41595 title: _t.append("issues.fix.use_different_layers_or_levels.title")
41603 function showReference(selection2) {
41604 var referenceText = _t("issues.close_nodes.detached.reference");
41605 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
41608 function getWayIssueIfAny(node1, node2, way) {
41609 if (node1.id === node2.id || node1.hasInterestingTags() && node2.hasInterestingTags()) {
41612 if (node1.loc !== node2.loc) {
41613 var parentWays1 = graph.parentWays(node1);
41614 var parentWays2 = new Set(graph.parentWays(node2));
41615 var sharedWays = parentWays1.filter(function(parentWay) {
41616 return parentWays2.has(parentWay);
41618 var thresholds = sharedWays.map(function(parentWay) {
41619 return thresholdMetersForWay(parentWay);
41621 var threshold = Math.min(...thresholds);
41622 var distance = geoSphericalDistance(node1.loc, node2.loc);
41623 if (distance > threshold)
41626 return new validationIssue({
41628 subtype: "vertices",
41629 severity: "warning",
41630 message: function(context2) {
41631 var entity2 = context2.hasEntity(this.entityIds[0]);
41632 return entity2 ? _t.append("issues.close_nodes.message", { way: utilDisplayLabel(entity2, context2.graph()) }) : "";
41634 reference: showReference,
41635 entityIds: [way.id, node1.id, node2.id],
41637 dynamicFixes: function() {
41639 new validationIssueFix({
41640 icon: "iD-icon-plus",
41641 title: _t.append("issues.fix.merge_points.title"),
41642 onClick: function(context2) {
41643 var entityIds = this.issue.entityIds;
41644 var action = actionMergeNodes([entityIds[1], entityIds[2]]);
41645 context2.perform(action, _t("issues.fix.merge_close_vertices.annotation"));
41648 new validationIssueFix({
41649 icon: "iD-operation-disconnect",
41650 title: _t.append("issues.fix.move_points_apart.title")
41655 function showReference(selection2) {
41656 var referenceText = _t("issues.close_nodes.reference");
41657 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
41661 validation.type = type2;
41665 // modules/validations/crossing_ways.js
41666 var import_lodash3 = __toESM(require_lodash());
41667 function validationCrossingWays(context) {
41668 var type2 = "crossing_ways";
41669 function getFeatureWithFeatureTypeTagsForWay(way, graph) {
41670 if (getFeatureType(way, graph) === null) {
41671 var parentRels = graph.parentRelations(way);
41672 for (var i3 = 0; i3 < parentRels.length; i3++) {
41673 var rel = parentRels[i3];
41674 if (getFeatureType(rel, graph) !== null) {
41681 function hasTag(tags, key) {
41682 return tags[key] !== void 0 && tags[key] !== "no";
41684 function taggedAsIndoor(tags) {
41685 return hasTag(tags, "indoor") || hasTag(tags, "level") || tags.highway === "corridor";
41687 function allowsBridge(featureType) {
41688 return featureType === "highway" || featureType === "railway" || featureType === "waterway";
41690 function allowsTunnel(featureType) {
41691 return featureType === "highway" || featureType === "railway" || featureType === "waterway";
41693 var ignoredBuildings = {
41699 function getFeatureType(entity, graph) {
41700 var geometry = entity.geometry(graph);
41701 if (geometry !== "line" && geometry !== "area")
41703 var tags = entity.tags;
41704 if (hasTag(tags, "building") && !ignoredBuildings[tags.building])
41706 if (hasTag(tags, "highway") && osmRoutableHighwayTagValues[tags.highway])
41708 if (geometry !== "line")
41710 if (hasTag(tags, "railway") && osmRailwayTrackTagValues[tags.railway])
41712 if (hasTag(tags, "waterway") && osmFlowingWaterwayTagValues[tags.waterway])
41716 function isLegitCrossing(tags1, featureType1, tags2, featureType2) {
41717 var level1 = tags1.level || "0";
41718 var level2 = tags2.level || "0";
41719 if (taggedAsIndoor(tags1) && taggedAsIndoor(tags2) && level1 !== level2) {
41722 var layer1 = tags1.layer || "0";
41723 var layer2 = tags2.layer || "0";
41724 if (allowsBridge(featureType1) && allowsBridge(featureType2)) {
41725 if (hasTag(tags1, "bridge") && !hasTag(tags2, "bridge"))
41727 if (!hasTag(tags1, "bridge") && hasTag(tags2, "bridge"))
41729 if (hasTag(tags1, "bridge") && hasTag(tags2, "bridge") && layer1 !== layer2)
41731 } else if (allowsBridge(featureType1) && hasTag(tags1, "bridge"))
41733 else if (allowsBridge(featureType2) && hasTag(tags2, "bridge"))
41735 if (allowsTunnel(featureType1) && allowsTunnel(featureType2)) {
41736 if (hasTag(tags1, "tunnel") && !hasTag(tags2, "tunnel"))
41738 if (!hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel"))
41740 if (hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel") && layer1 !== layer2)
41742 } else if (allowsTunnel(featureType1) && hasTag(tags1, "tunnel"))
41744 else if (allowsTunnel(featureType2) && hasTag(tags2, "tunnel"))
41746 if (featureType1 === "waterway" && featureType2 === "highway" && tags2.man_made === "pier")
41748 if (featureType2 === "waterway" && featureType1 === "highway" && tags1.man_made === "pier")
41750 if (featureType1 === "building" || featureType2 === "building" || taggedAsIndoor(tags1) || taggedAsIndoor(tags2)) {
41751 if (layer1 !== layer2)
41756 var highwaysDisallowingFords = {
41758 motorway_link: true,
41762 primary_link: true,
41764 secondary_link: true
41766 function tagsForConnectionNodeIfAllowed(entity1, entity2, graph, lessLikelyTags) {
41767 var featureType1 = getFeatureType(entity1, graph);
41768 var featureType2 = getFeatureType(entity2, graph);
41769 var geometry1 = entity1.geometry(graph);
41770 var geometry2 = entity2.geometry(graph);
41771 var bothLines = geometry1 === "line" && geometry2 === "line";
41772 if (featureType1 === featureType2) {
41773 if (featureType1 === "highway") {
41774 var entity1IsPath = osmPathHighwayTagValues[entity1.tags.highway];
41775 var entity2IsPath = osmPathHighwayTagValues[entity2.tags.highway];
41776 if ((entity1IsPath || entity2IsPath) && entity1IsPath !== entity2IsPath) {
41777 var roadFeature = entity1IsPath ? entity2 : entity1;
41778 var pathFeature = entity1IsPath ? entity1 : entity2;
41779 if (roadFeature.tags.highway === "track") {
41782 if (!lessLikelyTags && roadFeature.tags.highway === "service" && pathFeature.tags.highway === "footway" && pathFeature.tags.footway === "sidewalk") {
41785 if (["marked", "unmarked", "traffic_signals", "uncontrolled"].indexOf(pathFeature.tags.crossing) !== -1) {
41786 return bothLines ? { highway: "crossing", crossing: pathFeature.tags.crossing } : {};
41788 return bothLines ? { highway: "crossing" } : {};
41792 if (featureType1 === "waterway")
41794 if (featureType1 === "railway")
41797 var featureTypes = [featureType1, featureType2];
41798 if (featureTypes.indexOf("highway") !== -1) {
41799 if (featureTypes.indexOf("railway") !== -1) {
41802 var isTram = entity1.tags.railway === "tram" || entity2.tags.railway === "tram";
41803 if (osmPathHighwayTagValues[entity1.tags.highway] || osmPathHighwayTagValues[entity2.tags.highway]) {
41805 return { railway: "tram_crossing" };
41806 return { railway: "crossing" };
41809 return { railway: "tram_level_crossing" };
41810 return { railway: "level_crossing" };
41813 if (featureTypes.indexOf("waterway") !== -1) {
41814 if (hasTag(entity1.tags, "tunnel") && hasTag(entity2.tags, "tunnel"))
41816 if (hasTag(entity1.tags, "bridge") && hasTag(entity2.tags, "bridge"))
41818 if (highwaysDisallowingFords[entity1.tags.highway] || highwaysDisallowingFords[entity2.tags.highway]) {
41821 return bothLines ? { ford: "yes" } : {};
41827 function findCrossingsByWay(way1, graph, tree) {
41828 var edgeCrossInfos = [];
41829 if (way1.type !== "way")
41830 return edgeCrossInfos;
41831 var taggedFeature1 = getFeatureWithFeatureTypeTagsForWay(way1, graph);
41832 var way1FeatureType = getFeatureType(taggedFeature1, graph);
41833 if (way1FeatureType === null)
41834 return edgeCrossInfos;
41835 var checkedSingleCrossingWays = {};
41838 var n1, n22, nA, nB, nAId, nBId;
41839 var segment1, segment2;
41841 var segmentInfos, segment2Info, way2, taggedFeature2, way2FeatureType;
41842 var way1Nodes = graph.childNodes(way1);
41843 var comparedWays = {};
41844 for (i3 = 0; i3 < way1Nodes.length - 1; i3++) {
41845 n1 = way1Nodes[i3];
41846 n22 = way1Nodes[i3 + 1];
41847 extent = geoExtent([
41849 Math.min(n1.loc[0], n22.loc[0]),
41850 Math.min(n1.loc[1], n22.loc[1])
41853 Math.max(n1.loc[0], n22.loc[0]),
41854 Math.max(n1.loc[1], n22.loc[1])
41857 segmentInfos = tree.waySegments(extent, graph);
41858 for (j3 = 0; j3 < segmentInfos.length; j3++) {
41859 segment2Info = segmentInfos[j3];
41860 if (segment2Info.wayId === way1.id)
41862 if (checkedSingleCrossingWays[segment2Info.wayId])
41864 comparedWays[segment2Info.wayId] = true;
41865 way2 = graph.hasEntity(segment2Info.wayId);
41868 taggedFeature2 = getFeatureWithFeatureTypeTagsForWay(way2, graph);
41869 way2FeatureType = getFeatureType(taggedFeature2, graph);
41870 if (way2FeatureType === null || isLegitCrossing(taggedFeature1.tags, way1FeatureType, taggedFeature2.tags, way2FeatureType)) {
41873 oneOnly = way1FeatureType === "building" || way2FeatureType === "building";
41874 nAId = segment2Info.nodes[0];
41875 nBId = segment2Info.nodes[1];
41876 if (nAId === n1.id || nAId === n22.id || nBId === n1.id || nBId === n22.id) {
41879 nA = graph.hasEntity(nAId);
41882 nB = graph.hasEntity(nBId);
41885 segment1 = [n1.loc, n22.loc];
41886 segment2 = [nA.loc, nB.loc];
41887 var point2 = geoLineIntersection(segment1, segment2);
41889 edgeCrossInfos.push({
41893 featureType: way1FeatureType,
41894 edge: [n1.id, n22.id]
41898 featureType: way2FeatureType,
41899 edge: [nA.id, nB.id]
41905 checkedSingleCrossingWays[way2.id] = true;
41911 return edgeCrossInfos;
41913 function waysToCheck(entity, graph) {
41914 var featureType = getFeatureType(entity, graph);
41917 if (entity.type === "way") {
41919 } else if (entity.type === "relation") {
41920 return entity.members.reduce(function(array2, member) {
41921 if (member.type === "way" && // only look at geometry ways
41922 (!member.role || member.role === "outer" || member.role === "inner")) {
41923 var entity2 = graph.hasEntity(member.id);
41924 if (entity2 && array2.indexOf(entity2) === -1) {
41925 array2.push(entity2);
41933 var validation = function checkCrossingWays(entity, graph) {
41934 var tree = context.history().tree();
41935 var ways = waysToCheck(entity, graph);
41937 var wayIndex, crossingIndex, crossings;
41938 for (wayIndex in ways) {
41939 crossings = findCrossingsByWay(ways[wayIndex], graph, tree);
41940 for (crossingIndex in crossings) {
41941 issues.push(createIssue(crossings[crossingIndex], graph));
41946 function createIssue(crossing, graph) {
41947 crossing.wayInfos.sort(function(way1Info, way2Info) {
41948 var type1 = way1Info.featureType;
41949 var type22 = way2Info.featureType;
41950 if (type1 === type22) {
41951 return utilDisplayLabel(way1Info.way, graph) > utilDisplayLabel(way2Info.way, graph);
41952 } else if (type1 === "waterway") {
41954 } else if (type22 === "waterway") {
41957 return type1 < type22;
41959 var entities = crossing.wayInfos.map(function(wayInfo) {
41960 return getFeatureWithFeatureTypeTagsForWay(wayInfo.way, graph);
41962 var edges = [crossing.wayInfos[0].edge, crossing.wayInfos[1].edge];
41963 var featureTypes = [crossing.wayInfos[0].featureType, crossing.wayInfos[1].featureType];
41964 var connectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph);
41965 var featureType1 = crossing.wayInfos[0].featureType;
41966 var featureType2 = crossing.wayInfos[1].featureType;
41967 var isCrossingIndoors = taggedAsIndoor(entities[0].tags) && taggedAsIndoor(entities[1].tags);
41968 var isCrossingTunnels = allowsTunnel(featureType1) && hasTag(entities[0].tags, "tunnel") && allowsTunnel(featureType2) && hasTag(entities[1].tags, "tunnel");
41969 var isCrossingBridges = allowsBridge(featureType1) && hasTag(entities[0].tags, "bridge") && allowsBridge(featureType2) && hasTag(entities[1].tags, "bridge");
41970 var subtype = [featureType1, featureType2].sort().join("-");
41971 var crossingTypeID = subtype;
41972 if (isCrossingIndoors) {
41973 crossingTypeID = "indoor-indoor";
41974 } else if (isCrossingTunnels) {
41975 crossingTypeID = "tunnel-tunnel";
41976 } else if (isCrossingBridges) {
41977 crossingTypeID = "bridge-bridge";
41979 if (connectionTags && (isCrossingIndoors || isCrossingTunnels || isCrossingBridges)) {
41980 crossingTypeID += "_connectable";
41982 var uniqueID = crossing.crossPoint[0].toFixed(4) + "," + crossing.crossPoint[1].toFixed(4);
41983 return new validationIssue({
41986 severity: "warning",
41987 message: function(context2) {
41988 var graph2 = context2.graph();
41989 var entity1 = graph2.hasEntity(this.entityIds[0]), entity2 = graph2.hasEntity(this.entityIds[1]);
41990 return entity1 && entity2 ? _t.append("issues.crossing_ways.message", {
41991 feature: utilDisplayLabel(entity1, graph2),
41992 feature2: utilDisplayLabel(entity2, graph2)
41995 reference: showReference,
41996 entityIds: entities.map(function(entity) {
42005 loc: crossing.crossPoint,
42006 dynamicFixes: function(context2) {
42007 var mode = context2.mode();
42008 if (!mode || mode.id !== "select" || mode.selectedIDs().length !== 1)
42010 var selectedIndex = this.entityIds[0] === mode.selectedIDs()[0] ? 0 : 1;
42011 var selectedFeatureType = this.data.featureTypes[selectedIndex];
42012 var otherFeatureType = this.data.featureTypes[selectedIndex === 0 ? 1 : 0];
42014 if (connectionTags) {
42015 fixes.push(makeConnectWaysFix(this.data.connectionTags));
42016 let lessLikelyConnectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph, true);
42017 if (lessLikelyConnectionTags && !(0, import_lodash3.isEqual)(connectionTags, lessLikelyConnectionTags)) {
42018 fixes.push(makeConnectWaysFix(lessLikelyConnectionTags));
42021 if (isCrossingIndoors) {
42022 fixes.push(new validationIssueFix({
42023 icon: "iD-icon-layers",
42024 title: _t.append("issues.fix.use_different_levels.title")
42026 } else if (isCrossingTunnels || isCrossingBridges || featureType1 === "building" || featureType2 === "building") {
42027 fixes.push(makeChangeLayerFix("higher"));
42028 fixes.push(makeChangeLayerFix("lower"));
42029 } else if (context2.graph().geometry(this.entityIds[0]) === "line" && context2.graph().geometry(this.entityIds[1]) === "line") {
42030 if (allowsBridge(selectedFeatureType) && selectedFeatureType !== "waterway") {
42031 fixes.push(makeAddBridgeOrTunnelFix("add_a_bridge", "temaki-bridge", "bridge"));
42033 var skipTunnelFix = otherFeatureType === "waterway" && selectedFeatureType !== "waterway";
42034 if (allowsTunnel(selectedFeatureType) && !skipTunnelFix) {
42035 fixes.push(makeAddBridgeOrTunnelFix("add_a_tunnel", "temaki-tunnel", "tunnel"));
42038 fixes.push(new validationIssueFix({
42039 icon: "iD-operation-move",
42040 title: _t.append("issues.fix.reposition_features.title")
42045 function showReference(selection2) {
42046 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.crossing_ways." + crossingTypeID + ".reference"));
42049 function makeAddBridgeOrTunnelFix(fixTitleID, iconName, bridgeOrTunnel) {
42050 return new validationIssueFix({
42052 title: _t.append("issues.fix." + fixTitleID + ".title"),
42053 onClick: function(context2) {
42054 var mode = context2.mode();
42055 if (!mode || mode.id !== "select")
42057 var selectedIDs = mode.selectedIDs();
42058 if (selectedIDs.length !== 1)
42060 var selectedWayID = selectedIDs[0];
42061 if (!context2.hasEntity(selectedWayID))
42063 var resultWayIDs = [selectedWayID];
42064 var edge, crossedEdge, crossedWayID;
42065 if (this.issue.entityIds[0] === selectedWayID) {
42066 edge = this.issue.data.edges[0];
42067 crossedEdge = this.issue.data.edges[1];
42068 crossedWayID = this.issue.entityIds[1];
42070 edge = this.issue.data.edges[1];
42071 crossedEdge = this.issue.data.edges[0];
42072 crossedWayID = this.issue.entityIds[0];
42074 var crossingLoc = this.issue.loc;
42075 var projection2 = context2.projection;
42076 var action = function actionAddStructure(graph) {
42077 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
42078 var crossedWay = graph.hasEntity(crossedWayID);
42079 var structLengthMeters = crossedWay && isFinite(crossedWay.tags.width) && Number(crossedWay.tags.width);
42080 if (!structLengthMeters) {
42081 structLengthMeters = crossedWay && crossedWay.impliedLineWidthMeters();
42083 if (structLengthMeters) {
42084 if (getFeatureType(crossedWay, graph) === "railway") {
42085 structLengthMeters *= 2;
42088 structLengthMeters = 8;
42090 var a1 = geoAngle(edgeNodes[0], edgeNodes[1], projection2) + Math.PI;
42091 var a2 = geoAngle(graph.entity(crossedEdge[0]), graph.entity(crossedEdge[1]), projection2) + Math.PI;
42092 var crossingAngle = Math.max(a1, a2) - Math.min(a1, a2);
42093 if (crossingAngle > Math.PI)
42094 crossingAngle -= Math.PI;
42095 structLengthMeters = structLengthMeters / 2 / Math.sin(crossingAngle) * 2;
42096 structLengthMeters += 4;
42097 structLengthMeters = Math.min(Math.max(structLengthMeters, 4), 50);
42098 function geomToProj(geoPoint) {
42100 geoLonToMeters(geoPoint[0], geoPoint[1]),
42101 geoLatToMeters(geoPoint[1])
42104 function projToGeom(projPoint) {
42105 var lat = geoMetersToLat(projPoint[1]);
42107 geoMetersToLon(projPoint[0], lat),
42111 var projEdgeNode1 = geomToProj(edgeNodes[0].loc);
42112 var projEdgeNode2 = geomToProj(edgeNodes[1].loc);
42113 var projectedAngle = geoVecAngle(projEdgeNode1, projEdgeNode2);
42114 var projectedCrossingLoc = geomToProj(crossingLoc);
42115 var linearToSphericalMetersRatio = geoVecLength(projEdgeNode1, projEdgeNode2) / geoSphericalDistance(edgeNodes[0].loc, edgeNodes[1].loc);
42116 function locSphericalDistanceFromCrossingLoc(angle2, distanceMeters) {
42117 var lengthSphericalMeters = distanceMeters * linearToSphericalMetersRatio;
42118 return projToGeom([
42119 projectedCrossingLoc[0] + Math.cos(angle2) * lengthSphericalMeters,
42120 projectedCrossingLoc[1] + Math.sin(angle2) * lengthSphericalMeters
42123 var endpointLocGetter1 = function(lengthMeters) {
42124 return locSphericalDistanceFromCrossingLoc(projectedAngle, lengthMeters);
42126 var endpointLocGetter2 = function(lengthMeters) {
42127 return locSphericalDistanceFromCrossingLoc(projectedAngle + Math.PI, lengthMeters);
42129 var minEdgeLengthMeters = 0.55;
42130 function determineEndpoint(edge2, endNode, locGetter) {
42132 var idealLengthMeters = structLengthMeters / 2;
42133 var crossingToEdgeEndDistance = geoSphericalDistance(crossingLoc, endNode.loc);
42134 if (crossingToEdgeEndDistance - idealLengthMeters > minEdgeLengthMeters) {
42135 var idealNodeLoc = locGetter(idealLengthMeters);
42136 newNode = osmNode();
42137 graph = actionAddMidpoint({ loc: idealNodeLoc, edge: edge2 }, newNode)(graph);
42140 endNode.parentIntersectionWays(graph).forEach(function(way) {
42141 way.nodes.forEach(function(nodeID) {
42142 if (nodeID === endNode.id) {
42143 if (endNode.id === way.first() && endNode.id !== way.last() || endNode.id === way.last() && endNode.id !== way.first()) {
42151 if (edgeCount >= 3) {
42152 var insetLength = crossingToEdgeEndDistance - minEdgeLengthMeters;
42153 if (insetLength > minEdgeLengthMeters) {
42154 var insetNodeLoc = locGetter(insetLength);
42155 newNode = osmNode();
42156 graph = actionAddMidpoint({ loc: insetNodeLoc, edge: edge2 }, newNode)(graph);
42162 var splitAction = actionSplit([newNode.id]).limitWays(resultWayIDs);
42163 graph = splitAction(graph);
42164 if (splitAction.getCreatedWayIDs().length) {
42165 resultWayIDs.push(splitAction.getCreatedWayIDs()[0]);
42169 var structEndNode1 = determineEndpoint(edge, edgeNodes[1], endpointLocGetter1);
42170 var structEndNode2 = determineEndpoint([edgeNodes[0].id, structEndNode1.id], edgeNodes[0], endpointLocGetter2);
42171 var structureWay = resultWayIDs.map(function(id2) {
42172 return graph.entity(id2);
42173 }).find(function(way) {
42174 return way.nodes.indexOf(structEndNode1.id) !== -1 && way.nodes.indexOf(structEndNode2.id) !== -1;
42176 var tags = Object.assign({}, structureWay.tags);
42177 if (bridgeOrTunnel === "bridge") {
42178 tags.bridge = "yes";
42181 var tunnelValue = "yes";
42182 if (getFeatureType(structureWay, graph) === "waterway") {
42183 tunnelValue = "culvert";
42185 tags.tunnel = tunnelValue;
42188 graph = actionChangeTags(structureWay.id, tags)(graph);
42191 context2.perform(action, _t("issues.fix." + fixTitleID + ".annotation"));
42192 context2.enter(modeSelect(context2, resultWayIDs));
42196 function makeConnectWaysFix(connectionTags) {
42197 var fixTitleID = "connect_features";
42198 var fixIcon = "iD-icon-crossing";
42199 if (connectionTags.highway === "crossing") {
42200 fixTitleID = "connect_using_crossing";
42201 fixIcon = "temaki-pedestrian";
42203 if (connectionTags.ford) {
42204 fixTitleID = "connect_using_ford";
42205 fixIcon = "roentgen-ford";
42207 const fix = new validationIssueFix({
42209 title: _t.append("issues.fix." + fixTitleID + ".title"),
42210 onClick: function(context2) {
42211 var loc = this.issue.loc;
42212 var edges = this.issue.data.edges;
42214 function actionConnectCrossingWays(graph) {
42215 var node = osmNode({ loc, tags: connectionTags });
42216 graph = graph.replace(node);
42217 var nodesToMerge = [node.id];
42218 var mergeThresholdInMeters = 0.75;
42219 edges.forEach(function(edge) {
42220 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
42221 var nearby = geoSphericalClosestNode(edgeNodes, loc);
42222 if ((!nearby.node.hasInterestingTags() || nearby.node.isCrossing()) && nearby.distance < mergeThresholdInMeters) {
42223 nodesToMerge.push(nearby.node.id);
42225 graph = actionAddMidpoint({ loc, edge }, node)(graph);
42228 if (nodesToMerge.length > 1) {
42229 graph = actionMergeNodes(nodesToMerge, loc)(graph);
42233 _t("issues.fix.connect_crossing_features.annotation")
42237 fix._connectionTags = connectionTags;
42240 function makeChangeLayerFix(higherOrLower) {
42241 return new validationIssueFix({
42242 icon: "iD-icon-" + (higherOrLower === "higher" ? "up" : "down"),
42243 title: _t.append("issues.fix.tag_this_as_" + higherOrLower + ".title"),
42244 onClick: function(context2) {
42245 var mode = context2.mode();
42246 if (!mode || mode.id !== "select")
42248 var selectedIDs = mode.selectedIDs();
42249 if (selectedIDs.length !== 1)
42251 var selectedID = selectedIDs[0];
42252 if (!this.issue.entityIds.some(function(entityId) {
42253 return entityId === selectedID;
42256 var entity = context2.hasEntity(selectedID);
42259 var tags = Object.assign({}, entity.tags);
42260 var layer = tags.layer && Number(tags.layer);
42261 if (layer && !isNaN(layer)) {
42262 if (higherOrLower === "higher") {
42268 if (higherOrLower === "higher") {
42274 tags.layer = layer.toString();
42276 actionChangeTags(entity.id, tags),
42277 _t("operations.change_tags.annotation")
42282 validation.type = type2;
42286 // modules/behavior/draw_way.js
42287 function behaviorDrawWay(context, wayID, mode, startGraph) {
42288 const keybinding = utilKeybinding("drawWay");
42289 var dispatch14 = dispatch_default("rejectedSelfIntersection");
42290 var behavior = behaviorDraw(context);
42296 var _pointerHasMoved = false;
42298 var _didResolveTempEdit = false;
42299 function createDrawNode(loc) {
42300 _drawNode = osmNode({ loc });
42301 context.pauseChangeDispatch();
42302 context.replace(function actionAddDrawNode(graph) {
42303 var way = graph.entity(wayID);
42304 return graph.replace(_drawNode).replace(way.addNode(_drawNode.id, _nodeIndex));
42306 context.resumeChangeDispatch();
42307 setActiveElements();
42309 function removeDrawNode() {
42310 context.pauseChangeDispatch();
42312 function actionDeleteDrawNode(graph) {
42313 var way = graph.entity(wayID);
42314 return graph.replace(way.removeNode(_drawNode.id)).remove(_drawNode);
42318 _drawNode = void 0;
42319 context.resumeChangeDispatch();
42321 function keydown(d3_event) {
42322 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
42323 if (context.surface().classed("nope")) {
42324 context.surface().classed("nope-suppressed", true);
42326 context.surface().classed("nope", false).classed("nope-disabled", true);
42329 function keyup(d3_event) {
42330 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
42331 if (context.surface().classed("nope-suppressed")) {
42332 context.surface().classed("nope", true);
42334 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
42337 function allowsVertex(d2) {
42338 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
42340 function move(d3_event, datum2) {
42341 var loc = context.map().mouseCoordinates();
42343 createDrawNode(loc);
42344 context.surface().classed("nope-disabled", d3_event.altKey);
42345 var targetLoc = datum2 && datum2.properties && datum2.properties.entity && allowsVertex(datum2.properties.entity) && datum2.properties.entity.loc;
42346 var targetNodes = datum2 && datum2.properties && datum2.properties.nodes;
42349 } else if (targetNodes) {
42350 var choice = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, _drawNode.id);
42355 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
42356 _drawNode = context.entity(_drawNode.id);
42359 /* includeDrawNode */
42362 function checkGeometry(includeDrawNode) {
42363 var nopeDisabled = context.surface().classed("nope-disabled");
42364 var isInvalid = isInvalidGeometry(includeDrawNode);
42365 if (nopeDisabled) {
42366 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
42368 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
42371 function isInvalidGeometry(includeDrawNode) {
42372 var testNode = _drawNode;
42373 var parentWay = context.graph().entity(wayID);
42374 var nodes = context.graph().childNodes(parentWay).slice();
42375 if (includeDrawNode) {
42376 if (parentWay.isClosed()) {
42380 if (parentWay.isClosed()) {
42381 if (nodes.length < 3)
42384 nodes.splice(-2, 1);
42385 testNode = nodes[nodes.length - 2];
42390 return testNode && geoHasSelfIntersections(nodes, testNode.id);
42392 function undone() {
42393 _didResolveTempEdit = true;
42394 context.pauseChangeDispatch();
42396 if (context.graph() === startGraph) {
42397 nextMode = modeSelect(context, [wayID]);
42402 context.perform(actionNoop());
42404 context.resumeChangeDispatch();
42405 context.enter(nextMode);
42407 function setActiveElements() {
42410 context.surface().selectAll("." + _drawNode.id).classed("active", true);
42412 function resetToStartGraph() {
42413 while (context.graph() !== startGraph) {
42417 var drawWay = function(surface) {
42418 _drawNode = void 0;
42419 _didResolveTempEdit = false;
42420 _origWay = context.entity(wayID);
42421 if (typeof _nodeIndex === "number") {
42422 _headNodeID = _origWay.nodes[_nodeIndex];
42423 } else if (_origWay.isClosed()) {
42424 _headNodeID = _origWay.nodes[_origWay.nodes.length - 2];
42426 _headNodeID = _origWay.nodes[_origWay.nodes.length - 1];
42428 _wayGeometry = _origWay.geometry(context.graph());
42430 (_origWay.nodes.length === (_origWay.isClosed() ? 2 : 1) ? "operations.start.annotation." : "operations.continue.annotation.") + _wayGeometry
42432 _pointerHasMoved = false;
42433 context.pauseChangeDispatch();
42434 context.perform(actionNoop(), _annotation);
42435 context.resumeChangeDispatch();
42436 behavior.hover().initialNodeID(_headNodeID);
42437 behavior.on("move", function() {
42438 _pointerHasMoved = true;
42439 move.apply(this, arguments);
42440 }).on("down", function() {
42441 move.apply(this, arguments);
42442 }).on("downcancel", function() {
42445 }).on("click", drawWay.add).on("clickWay", drawWay.addWay).on("clickNode", drawWay.addNode).on("undo", context.undo).on("cancel", drawWay.cancel).on("finish", drawWay.finish);
42446 select_default2(window).on("keydown.drawWay", keydown).on("keyup.drawWay", keyup);
42447 context.map().dblclickZoomEnable(false).on("drawn.draw", setActiveElements);
42448 setActiveElements();
42449 surface.call(behavior);
42450 context.history().on("undone.draw", undone);
42452 drawWay.off = function(surface) {
42453 if (!_didResolveTempEdit) {
42454 context.pauseChangeDispatch();
42455 resetToStartGraph();
42456 context.resumeChangeDispatch();
42458 _drawNode = void 0;
42459 _nodeIndex = void 0;
42460 context.map().on("drawn.draw", null);
42461 surface.call(behavior.off).selectAll(".active").classed("active", false);
42462 surface.classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false);
42463 select_default2(window).on("keydown.drawWay", null).on("keyup.drawWay", null);
42464 context.history().on("undone.draw", null);
42466 function attemptAdd(d2, loc, doAdd) {
42468 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
42469 _drawNode = context.entity(_drawNode.id);
42471 createDrawNode(loc);
42475 /* includeDrawNode */
42477 if (d2 && d2.properties && d2.properties.nope || context.surface().classed("nope")) {
42478 if (!_pointerHasMoved) {
42481 dispatch14.call("rejectedSelfIntersection", this);
42484 context.pauseChangeDispatch();
42486 _didResolveTempEdit = true;
42487 context.resumeChangeDispatch();
42488 context.enter(mode);
42490 drawWay.add = function(loc, d2) {
42491 attemptAdd(d2, loc, function() {
42494 drawWay.addWay = function(loc, edge, d2) {
42495 attemptAdd(d2, loc, function() {
42497 actionAddMidpoint({ loc, edge }, _drawNode),
42502 drawWay.addNode = function(node, d2) {
42503 if (node.id === _headNodeID || // or the first node when drawing an area
42504 _origWay.isClosed() && node.id === _origWay.first()) {
42508 attemptAdd(d2, node.loc, function() {
42510 function actionReplaceDrawNode(graph) {
42511 graph = graph.replace(graph.entity(wayID).removeNode(_drawNode.id)).remove(_drawNode);
42512 return graph.replace(graph.entity(wayID).addNode(node.id, _nodeIndex));
42518 function getFeatureType(ways) {
42519 if (ways.every((way) => way.isClosed()))
42521 if (ways.every((way) => !way.isClosed()))
42525 function followMode() {
42526 if (_didResolveTempEdit)
42529 const isDrawingArea = _origWay.nodes[0] === _origWay.nodes.slice(-1)[0];
42530 const [secondLastNodeId, lastNodeId] = _origWay.nodes.slice(isDrawingArea ? -3 : -2);
42531 const historyGraph = context.history().graph();
42532 if (!lastNodeId || !secondLastNodeId || !historyGraph.hasEntity(lastNodeId) || !historyGraph.hasEntity(secondLastNodeId)) {
42533 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.needs_more_initial_nodes"))();
42536 const lastNodesParents = historyGraph.parentWays(historyGraph.entity(lastNodeId)).filter((w2) => w2.id !== wayID);
42537 const secondLastNodesParents = historyGraph.parentWays(historyGraph.entity(secondLastNodeId)).filter((w2) => w2.id !== wayID);
42538 const featureType = getFeatureType(lastNodesParents);
42539 if (lastNodesParents.length !== 1 || secondLastNodesParents.length === 0) {
42540 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_multiple_ways.${featureType}`))();
42543 if (!secondLastNodesParents.some((n3) => n3.id === lastNodesParents[0].id)) {
42544 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_different_ways.${featureType}`))();
42547 const way = lastNodesParents[0];
42548 const indexOfLast = way.nodes.indexOf(lastNodeId);
42549 const indexOfSecondLast = way.nodes.indexOf(secondLastNodeId);
42550 const isDescendingPastZero = indexOfLast === way.nodes.length - 2 && indexOfSecondLast === 0;
42551 let nextNodeIndex = indexOfLast + (indexOfLast > indexOfSecondLast && !isDescendingPastZero ? 1 : -1);
42552 if (nextNodeIndex === -1)
42553 nextNodeIndex = indexOfSecondLast === 1 ? way.nodes.length - 2 : 1;
42554 const nextNode = historyGraph.entity(way.nodes[nextNodeIndex]);
42555 drawWay.addNode(nextNode, {
42556 geometry: { type: "Point", coordinates: nextNode.loc },
42558 properties: { target: true, entity: nextNode }
42561 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.unknown"))();
42564 keybinding.on(_t("operations.follow.key"), followMode);
42565 select_default2(document).call(keybinding);
42566 drawWay.finish = function() {
42569 /* includeDrawNode */
42571 if (context.surface().classed("nope")) {
42572 dispatch14.call("rejectedSelfIntersection", this);
42575 context.pauseChangeDispatch();
42577 _didResolveTempEdit = true;
42578 context.resumeChangeDispatch();
42579 var way = context.hasEntity(wayID);
42580 if (!way || way.isDegenerate()) {
42584 window.setTimeout(function() {
42585 context.map().dblclickZoomEnable(true);
42587 var isNewFeature = !mode.isContinuing;
42588 context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
42590 drawWay.cancel = function() {
42591 context.pauseChangeDispatch();
42592 resetToStartGraph();
42593 context.resumeChangeDispatch();
42594 window.setTimeout(function() {
42595 context.map().dblclickZoomEnable(true);
42597 context.surface().classed("nope", false).classed("nope-disabled", false).classed("nope-suppressed", false);
42598 context.enter(modeBrowse(context));
42600 drawWay.nodeIndex = function(val) {
42601 if (!arguments.length)
42606 drawWay.activeID = function() {
42607 if (!arguments.length)
42608 return _drawNode && _drawNode.id;
42611 return utilRebind(drawWay, dispatch14, "on");
42614 // modules/modes/draw_line.js
42615 function modeDrawLine(context, wayID, startGraph, button, affix, continuing) {
42620 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawLine", function() {
42621 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.lines"))();
42623 mode.wayID = wayID;
42624 mode.isContinuing = continuing;
42625 mode.enter = function() {
42626 behavior.nodeIndex(affix === "prefix" ? 0 : void 0);
42627 context.install(behavior);
42629 mode.exit = function() {
42630 context.uninstall(behavior);
42632 mode.selectedIDs = function() {
42635 mode.activeID = function() {
42636 return behavior && behavior.activeID() || [];
42641 // modules/validations/disconnected_way.js
42642 function validationDisconnectedWay() {
42643 var type2 = "disconnected_way";
42644 function isTaggedAsHighway(entity) {
42645 return osmRoutableHighwayTagValues[entity.tags.highway];
42647 var validation = function checkDisconnectedWay(entity, graph) {
42648 var routingIslandWays = routingIslandForEntity(entity);
42649 if (!routingIslandWays)
42651 return [new validationIssue({
42653 subtype: "highway",
42654 severity: "warning",
42655 message: function(context) {
42656 var entity2 = this.entityIds.length && context.hasEntity(this.entityIds[0]);
42657 var label = entity2 && utilDisplayLabel(entity2, context.graph());
42658 return _t.append("issues.disconnected_way.routable.message", { count: this.entityIds.length, highway: label });
42660 reference: showReference,
42661 entityIds: Array.from(routingIslandWays).map(function(way) {
42664 dynamicFixes: makeFixes
42666 function makeFixes(context) {
42668 var singleEntity = this.entityIds.length === 1 && context.hasEntity(this.entityIds[0]);
42669 if (singleEntity) {
42670 if (singleEntity.type === "way" && !singleEntity.isClosed()) {
42671 var textDirection = _mainLocalizer.textDirection();
42672 var startFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.first(), "start");
42674 fixes.push(startFix);
42675 var endFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.last(), "end");
42677 fixes.push(endFix);
42679 if (!fixes.length) {
42680 fixes.push(new validationIssueFix({
42681 title: _t.append("issues.fix.connect_feature.title")
42684 fixes.push(new validationIssueFix({
42685 icon: "iD-operation-delete",
42686 title: _t.append("issues.fix.delete_feature.title"),
42687 entityIds: [singleEntity.id],
42688 onClick: function(context2) {
42689 var id2 = this.issue.entityIds[0];
42690 var operation = operationDelete(context2, [id2]);
42691 if (!operation.disabled()) {
42697 fixes.push(new validationIssueFix({
42698 title: _t.append("issues.fix.connect_features.title")
42703 function showReference(selection2) {
42704 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.disconnected_way.routable.reference"));
42706 function routingIslandForEntity(entity2) {
42707 var routingIsland = /* @__PURE__ */ new Set();
42708 var waysToCheck = [];
42709 function queueParentWays(node) {
42710 graph.parentWays(node).forEach(function(parentWay) {
42711 if (!routingIsland.has(parentWay) && // only check each feature once
42712 isRoutableWay(parentWay, false)) {
42713 routingIsland.add(parentWay);
42714 waysToCheck.push(parentWay);
42718 if (entity2.type === "way" && isRoutableWay(entity2, true)) {
42719 routingIsland.add(entity2);
42720 waysToCheck.push(entity2);
42721 } else if (entity2.type === "node" && isRoutableNode(entity2)) {
42722 routingIsland.add(entity2);
42723 queueParentWays(entity2);
42727 while (waysToCheck.length) {
42728 var wayToCheck = waysToCheck.pop();
42729 var childNodes = graph.childNodes(wayToCheck);
42730 for (var i3 in childNodes) {
42731 var vertex = childNodes[i3];
42732 if (isConnectedVertex(vertex)) {
42735 if (isRoutableNode(vertex)) {
42736 routingIsland.add(vertex);
42738 queueParentWays(vertex);
42741 return routingIsland;
42743 function isConnectedVertex(vertex) {
42744 var osm = services.osm;
42745 if (osm && !osm.isDataLoaded(vertex.loc))
42747 if (vertex.tags.entrance && vertex.tags.entrance !== "no")
42749 if (vertex.tags.amenity === "parking_entrance")
42753 function isRoutableNode(node) {
42754 if (node.tags.highway === "elevator")
42758 function isRoutableWay(way, ignoreInnerWays) {
42759 if (isTaggedAsHighway(way) || way.tags.route === "ferry")
42761 return graph.parentRelations(way).some(function(parentRelation) {
42762 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry")
42764 if (parentRelation.isMultipolygon() && isTaggedAsHighway(parentRelation) && (!ignoreInnerWays || parentRelation.memberById(way.id).role !== "inner"))
42769 function makeContinueDrawingFixIfAllowed(textDirection, vertexID, whichEnd) {
42770 var vertex = graph.hasEntity(vertexID);
42771 if (!vertex || vertex.tags.noexit === "yes")
42773 var useLeftContinue = whichEnd === "start" && textDirection === "ltr" || whichEnd === "end" && textDirection === "rtl";
42774 return new validationIssueFix({
42775 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
42776 title: _t.append("issues.fix.continue_from_" + whichEnd + ".title"),
42777 entityIds: [vertexID],
42778 onClick: function(context) {
42779 var wayId = this.issue.entityIds[0];
42780 var way = context.hasEntity(wayId);
42781 var vertexId = this.entityIds[0];
42782 var vertex2 = context.hasEntity(vertexId);
42783 if (!way || !vertex2)
42785 var map2 = context.map();
42786 if (!context.editable() || !map2.trimmedExtent().contains(vertex2.loc)) {
42787 map2.zoomToEase(vertex2);
42790 modeDrawLine(context, wayId, context.graph(), "line", way.affix(vertexId), true)
42796 validation.type = type2;
42800 // modules/validations/invalid_format.js
42801 function validationFormatting() {
42802 var type2 = "invalid_format";
42803 var validation = function(entity) {
42805 function isValidEmail(email) {
42806 var valid_email = /^[^\(\)\\,":;<>@\[\]]+@[^\(\)\\,":;<>@\[\]\.]+(?:\.[a-z0-9-]+)*$/i;
42807 return !email || valid_email.test(email);
42809 function showReferenceEmail(selection2) {
42810 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.invalid_format.email.reference"));
42812 if (entity.tags.email) {
42813 var emails = entity.tags.email.split(";").map(function(s2) {
42815 }).filter(function(x2) {
42816 return !isValidEmail(x2);
42818 if (emails.length) {
42819 issues.push(new validationIssue({
42822 severity: "warning",
42823 message: function(context) {
42824 var entity2 = context.hasEntity(this.entityIds[0]);
42825 return entity2 ? _t.append(
42826 "issues.invalid_format.email.message" + this.data,
42827 { feature: utilDisplayLabel(entity2, context.graph()), email: emails.join(", ") }
42830 reference: showReferenceEmail,
42831 entityIds: [entity.id],
42832 hash: emails.join(),
42833 data: emails.length > 1 ? "_multi" : ""
42839 validation.type = type2;
42843 // modules/validations/help_request.js
42844 function validationHelpRequest(context) {
42845 var type2 = "help_request";
42846 var validation = function checkFixmeTag(entity) {
42847 if (!entity.tags.fixme)
42849 if (entity.version === void 0)
42851 if (entity.v !== void 0) {
42852 var baseEntity = context.history().base().hasEntity(entity.id);
42853 if (!baseEntity || !baseEntity.tags.fixme)
42856 return [new validationIssue({
42858 subtype: "fixme_tag",
42859 severity: "warning",
42860 message: function(context2) {
42861 var entity2 = context2.hasEntity(this.entityIds[0]);
42862 return entity2 ? _t.append("issues.fixme_tag.message", {
42863 feature: utilDisplayLabel(
42871 dynamicFixes: function() {
42873 new validationIssueFix({
42874 title: _t.append("issues.fix.address_the_concern.title")
42878 reference: showReference,
42879 entityIds: [entity.id]
42881 function showReference(selection2) {
42882 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.fixme_tag.reference"));
42885 validation.type = type2;
42889 // modules/validations/impossible_oneway.js
42890 function validationImpossibleOneway() {
42891 var type2 = "impossible_oneway";
42892 var validation = function checkImpossibleOneway(entity, graph) {
42893 if (entity.type !== "way" || entity.geometry(graph) !== "line")
42895 if (entity.isClosed())
42897 if (!typeForWay(entity))
42899 if (!isOneway(entity))
42901 var firstIssues = issuesForNode(entity, entity.first());
42902 var lastIssues = issuesForNode(entity, entity.last());
42903 return firstIssues.concat(lastIssues);
42904 function typeForWay(way) {
42905 if (way.geometry(graph) !== "line")
42907 if (osmRoutableHighwayTagValues[way.tags.highway])
42909 if (osmFlowingWaterwayTagValues[way.tags.waterway])
42913 function isOneway(way) {
42914 if (way.tags.oneway === "yes")
42916 if (way.tags.oneway)
42918 for (var key in way.tags) {
42919 if (osmOneWayTags[key] && osmOneWayTags[key][way.tags[key]]) {
42925 function nodeOccursMoreThanOnce(way, nodeID) {
42926 var occurrences = 0;
42927 for (var index in way.nodes) {
42928 if (way.nodes[index] === nodeID) {
42930 if (occurrences > 1)
42936 function isConnectedViaOtherTypes(way, node) {
42937 var wayType = typeForWay(way);
42938 if (wayType === "highway") {
42939 if (node.tags.entrance && node.tags.entrance !== "no")
42941 if (node.tags.amenity === "parking_entrance")
42943 } else if (wayType === "waterway") {
42944 if (node.id === way.first()) {
42945 if (node.tags.natural === "spring")
42948 if (node.tags.manhole === "drain")
42952 return graph.parentWays(node).some(function(parentWay) {
42953 if (parentWay.id === way.id)
42955 if (wayType === "highway") {
42956 if (parentWay.geometry(graph) === "area" && osmRoutableHighwayTagValues[parentWay.tags.highway])
42958 if (parentWay.tags.route === "ferry")
42960 return graph.parentRelations(parentWay).some(function(parentRelation) {
42961 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry")
42963 return parentRelation.isMultipolygon() && osmRoutableHighwayTagValues[parentRelation.tags.highway];
42965 } else if (wayType === "waterway") {
42966 if (parentWay.tags.natural === "water" || parentWay.tags.natural === "coastline")
42972 function issuesForNode(way, nodeID) {
42973 var isFirst = nodeID === way.first();
42974 var wayType = typeForWay(way);
42975 if (nodeOccursMoreThanOnce(way, nodeID))
42977 var osm = services.osm;
42980 var node = graph.hasEntity(nodeID);
42981 if (!node || !osm.isDataLoaded(node.loc))
42983 if (isConnectedViaOtherTypes(way, node))
42985 var attachedWaysOfSameType = graph.parentWays(node).filter(function(parentWay) {
42986 if (parentWay.id === way.id)
42988 return typeForWay(parentWay) === wayType;
42990 if (wayType === "waterway" && attachedWaysOfSameType.length === 0)
42992 var attachedOneways = attachedWaysOfSameType.filter(function(attachedWay) {
42993 return isOneway(attachedWay);
42995 if (attachedOneways.length < attachedWaysOfSameType.length)
42997 if (attachedOneways.length) {
42998 var connectedEndpointsOkay = attachedOneways.some(function(attachedOneway) {
42999 if ((isFirst ? attachedOneway.first() : attachedOneway.last()) !== nodeID)
43001 if (nodeOccursMoreThanOnce(attachedOneway, nodeID))
43005 if (connectedEndpointsOkay)
43008 var placement = isFirst ? "start" : "end", messageID = wayType + ".", referenceID = wayType + ".";
43009 if (wayType === "waterway") {
43010 messageID += "connected." + placement;
43011 referenceID += "connected";
43013 messageID += placement;
43014 referenceID += placement;
43016 return [new validationIssue({
43019 severity: "warning",
43020 message: function(context) {
43021 var entity2 = context.hasEntity(this.entityIds[0]);
43022 return entity2 ? _t.append("issues.impossible_oneway." + messageID + ".message", {
43023 feature: utilDisplayLabel(entity2, context.graph())
43026 reference: getReference(referenceID),
43027 entityIds: [way.id, node.id],
43028 dynamicFixes: function() {
43030 if (attachedOneways.length) {
43031 fixes.push(new validationIssueFix({
43032 icon: "iD-operation-reverse",
43033 title: _t.append("issues.fix.reverse_feature.title"),
43034 entityIds: [way.id],
43035 onClick: function(context) {
43036 var id2 = this.issue.entityIds[0];
43037 context.perform(actionReverse(id2), _t("operations.reverse.annotation.line", { n: 1 }));
43041 if (node.tags.noexit !== "yes") {
43042 var textDirection = _mainLocalizer.textDirection();
43043 var useLeftContinue = isFirst && textDirection === "ltr" || !isFirst && textDirection === "rtl";
43044 fixes.push(new validationIssueFix({
43045 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
43046 title: _t.append("issues.fix.continue_from_" + (isFirst ? "start" : "end") + ".title"),
43047 onClick: function(context) {
43048 var entityID = this.issue.entityIds[0];
43049 var vertexID = this.issue.entityIds[1];
43050 var way2 = context.entity(entityID);
43051 var vertex = context.entity(vertexID);
43052 continueDrawing(way2, vertex, context);
43060 function getReference(referenceID2) {
43061 return function showReference(selection2) {
43062 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.impossible_oneway." + referenceID2 + ".reference"));
43067 function continueDrawing(way, vertex, context) {
43068 var map2 = context.map();
43069 if (!context.editable() || !map2.trimmedExtent().contains(vertex.loc)) {
43070 map2.zoomToEase(vertex);
43073 modeDrawLine(context, way.id, context.graph(), "line", way.affix(vertex.id), true)
43076 validation.type = type2;
43080 // modules/validations/incompatible_source.js
43081 function validationIncompatibleSource() {
43082 const type2 = "incompatible_source";
43083 const incompatibleRules = [
43086 regex: /(^amap$|^amap\.com|autonavi|mapabc|高德)/i
43090 regex: /(baidu|mapbar|百度)/i
43095 exceptRegex: /((books|drive)\.google|google\s?(books|drive|plus))|(esri\/Google_Africa_Buildings)/i
43098 const validation = function checkIncompatibleSource(entity) {
43099 const entitySources = entity.tags && entity.tags.source && entity.tags.source.split(";");
43100 if (!entitySources)
43102 const entityID = entity.id;
43103 return entitySources.map((source) => {
43104 const matchRule = incompatibleRules.find((rule) => {
43105 if (!rule.regex.test(source))
43107 if (rule.exceptRegex && rule.exceptRegex.test(source))
43113 return new validationIssue({
43115 severity: "warning",
43116 message: (context) => {
43117 const entity2 = context.hasEntity(entityID);
43118 return entity2 ? _t.append("issues.incompatible_source.feature.message", {
43119 feature: utilDisplayLabel(
43128 reference: getReference(matchRule.id),
43129 entityIds: [entityID],
43131 dynamicFixes: () => {
43133 new validationIssueFix({ title: _t.append("issues.fix.remove_proprietary_data.title") })
43137 }).filter(Boolean);
43138 function getReference(id2) {
43139 return function showReference(selection2) {
43140 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append(`issues.incompatible_source.reference.${id2}`));
43144 validation.type = type2;
43148 // modules/validations/maprules.js
43149 function validationMaprules() {
43150 var type2 = "maprules";
43151 var validation = function checkMaprules(entity, graph) {
43152 if (!services.maprules)
43154 var rules = services.maprules.validationRules();
43156 for (var i3 = 0; i3 < rules.length; i3++) {
43157 var rule = rules[i3];
43158 rule.findIssues(entity, graph, issues);
43162 validation.type = type2;
43166 // modules/validations/mismatched_geometry.js
43167 var import_fast_deep_equal4 = __toESM(require_fast_deep_equal());
43168 function validationMismatchedGeometry() {
43169 var type2 = "mismatched_geometry";
43170 function tagSuggestingLineIsArea(entity) {
43171 if (entity.type !== "way" || entity.isClosed())
43173 var tagSuggestingArea = entity.tagSuggestingArea();
43174 if (!tagSuggestingArea) {
43177 var asLine = _mainPresetIndex.matchTags(tagSuggestingArea, "line");
43178 var asArea = _mainPresetIndex.matchTags(tagSuggestingArea, "area");
43179 if (asLine && asArea && (0, import_fast_deep_equal4.default)(asLine.tags, asArea.tags)) {
43182 return tagSuggestingArea;
43184 function makeConnectEndpointsFixOnClick(way, graph) {
43185 if (way.nodes.length < 3)
43187 var nodes = graph.childNodes(way), testNodes;
43188 var firstToLastDistanceMeters = geoSphericalDistance(nodes[0].loc, nodes[nodes.length - 1].loc);
43189 if (firstToLastDistanceMeters < 0.75) {
43190 testNodes = nodes.slice();
43192 testNodes.push(testNodes[0]);
43193 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
43194 return function(context) {
43195 var way2 = context.entity(this.issue.entityIds[0]);
43197 actionMergeNodes([way2.nodes[0], way2.nodes[way2.nodes.length - 1]], nodes[0].loc),
43198 _t("issues.fix.connect_endpoints.annotation")
43203 testNodes = nodes.slice();
43204 testNodes.push(testNodes[0]);
43205 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
43206 return function(context) {
43207 var wayId = this.issue.entityIds[0];
43208 var way2 = context.entity(wayId);
43209 var nodeId = way2.nodes[0];
43210 var index = way2.nodes.length;
43212 actionAddVertex(wayId, nodeId, index),
43213 _t("issues.fix.connect_endpoints.annotation")
43218 function lineTaggedAsAreaIssue(entity) {
43219 var tagSuggestingArea = tagSuggestingLineIsArea(entity);
43220 if (!tagSuggestingArea)
43222 var validAsLine = false;
43223 var presetAsLine = _mainPresetIndex.matchTags(entity.tags, "line");
43224 if (presetAsLine) {
43225 validAsLine = true;
43226 var key = Object.keys(tagSuggestingArea)[0];
43227 if (presetAsLine.tags[key] && presetAsLine.tags[key] === "*") {
43228 validAsLine = false;
43230 if (Object.keys(presetAsLine.tags).length === 0) {
43231 validAsLine = false;
43234 return new validationIssue({
43236 subtype: "area_as_line",
43237 severity: "warning",
43238 message: function(context) {
43239 var entity2 = context.hasEntity(this.entityIds[0]);
43240 return entity2 ? _t.append("issues.tag_suggests_area.message", {
43241 feature: utilDisplayLabel(
43247 tag: utilTagText({ tags: tagSuggestingArea })
43250 reference: showReference,
43251 entityIds: [entity.id],
43252 hash: JSON.stringify(tagSuggestingArea),
43253 dynamicFixes: function(context) {
43255 var entity2 = context.entity(this.entityIds[0]);
43256 var connectEndsOnClick = makeConnectEndpointsFixOnClick(entity2, context.graph());
43257 if (!validAsLine) {
43258 fixes.push(new validationIssueFix({
43259 title: _t.append("issues.fix.connect_endpoints.title"),
43260 onClick: connectEndsOnClick
43263 fixes.push(new validationIssueFix({
43264 icon: "iD-operation-delete",
43265 title: _t.append("issues.fix.remove_tag.title"),
43266 onClick: function(context2) {
43267 var entityId = this.issue.entityIds[0];
43268 var entity3 = context2.entity(entityId);
43269 var tags = Object.assign({}, entity3.tags);
43270 for (var key2 in tagSuggestingArea) {
43274 actionChangeTags(entityId, tags),
43275 _t("issues.fix.remove_tag.annotation")
43282 function showReference(selection2) {
43283 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.tag_suggests_area.reference"));
43286 function vertexPointIssue(entity, graph) {
43287 if (entity.type !== "node")
43289 if (Object.keys(entity.tags).length === 0)
43291 if (entity.isOnAddressLine(graph))
43293 var geometry = entity.geometry(graph);
43294 var allowedGeometries = osmNodeGeometriesForTags(entity.tags);
43295 if (geometry === "point" && !allowedGeometries.point && allowedGeometries.vertex) {
43296 return new validationIssue({
43298 subtype: "vertex_as_point",
43299 severity: "warning",
43300 message: function(context) {
43301 var entity2 = context.hasEntity(this.entityIds[0]);
43302 return entity2 ? _t.append("issues.vertex_as_point.message", {
43303 feature: utilDisplayLabel(
43311 reference: function showReference(selection2) {
43312 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.vertex_as_point.reference"));
43314 entityIds: [entity.id]
43316 } else if (geometry === "vertex" && !allowedGeometries.vertex && allowedGeometries.point) {
43317 return new validationIssue({
43319 subtype: "point_as_vertex",
43320 severity: "warning",
43321 message: function(context) {
43322 var entity2 = context.hasEntity(this.entityIds[0]);
43323 return entity2 ? _t.append("issues.point_as_vertex.message", {
43324 feature: utilDisplayLabel(
43332 reference: function showReference(selection2) {
43333 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.point_as_vertex.reference"));
43335 entityIds: [entity.id],
43336 dynamicFixes: extractPointDynamicFixes
43341 function otherMismatchIssue(entity, graph) {
43342 if (!entity.hasInterestingTags())
43344 if (entity.type !== "node" && entity.type !== "way")
43346 if (entity.type === "node" && entity.isOnAddressLine(graph))
43348 var sourceGeom = entity.geometry(graph);
43349 var targetGeoms = entity.type === "way" ? ["point", "vertex"] : ["line", "area"];
43350 if (sourceGeom === "area")
43351 targetGeoms.unshift("line");
43352 var asSource = _mainPresetIndex.match(entity, graph);
43353 var targetGeom = targetGeoms.find((nodeGeom) => {
43354 var asTarget = _mainPresetIndex.matchTags(entity.tags, nodeGeom);
43355 if (!asSource || !asTarget || asSource === asTarget || // sometimes there are two presets with the same tags for different geometries
43356 (0, import_fast_deep_equal4.default)(asSource.tags, asTarget.tags))
43358 if (asTarget.isFallback())
43360 var primaryKey = Object.keys(asTarget.tags)[0];
43361 if (primaryKey === "building")
43363 if (asTarget.tags[primaryKey] === "*")
43365 return asSource.isFallback() || asSource.tags[primaryKey] === "*";
43369 var subtype = targetGeom + "_as_" + sourceGeom;
43370 if (targetGeom === "vertex")
43371 targetGeom = "point";
43372 if (sourceGeom === "vertex")
43373 sourceGeom = "point";
43374 var referenceId = targetGeom + "_as_" + sourceGeom;
43376 if (targetGeom === "point") {
43377 dynamicFixes = extractPointDynamicFixes;
43378 } else if (sourceGeom === "area" && targetGeom === "line") {
43379 dynamicFixes = lineToAreaDynamicFixes;
43381 return new validationIssue({
43384 severity: "warning",
43385 message: function(context) {
43386 var entity2 = context.hasEntity(this.entityIds[0]);
43387 return entity2 ? _t.append("issues." + referenceId + ".message", {
43388 feature: utilDisplayLabel(
43396 reference: function showReference(selection2) {
43397 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.mismatched_geometry.reference"));
43399 entityIds: [entity.id],
43403 function lineToAreaDynamicFixes(context) {
43404 var convertOnClick;
43405 var entityId = this.entityIds[0];
43406 var entity = context.entity(entityId);
43407 var tags = Object.assign({}, entity.tags);
43409 if (!osmTagSuggestingArea(tags)) {
43410 convertOnClick = function(context2) {
43411 var entityId2 = this.issue.entityIds[0];
43412 var entity2 = context2.entity(entityId2);
43413 var tags2 = Object.assign({}, entity2.tags);
43418 actionChangeTags(entityId2, tags2),
43419 _t("issues.fix.convert_to_line.annotation")
43424 new validationIssueFix({
43425 icon: "iD-icon-line",
43426 title: _t.append("issues.fix.convert_to_line.title"),
43427 onClick: convertOnClick
43431 function extractPointDynamicFixes(context) {
43432 var entityId = this.entityIds[0];
43433 var extractOnClick = null;
43434 if (!context.hasHiddenConnections(entityId)) {
43435 extractOnClick = function(context2) {
43436 var entityId2 = this.issue.entityIds[0];
43437 var action = actionExtract(entityId2, context2.projection);
43440 _t("operations.extract.annotation", { n: 1 })
43442 context2.enter(modeSelect(context2, [action.getExtractedNodeID()]));
43446 new validationIssueFix({
43447 icon: "iD-operation-extract",
43448 title: _t.append("issues.fix.extract_point.title"),
43449 onClick: extractOnClick
43453 function unclosedMultipolygonPartIssues(entity, graph) {
43454 if (entity.type !== "relation" || !entity.isMultipolygon() || entity.isDegenerate() || // cannot determine issues for incompletely-downloaded relations
43455 !entity.isComplete(graph))
43457 var sequences = osmJoinWays(entity.members, graph);
43459 for (var i3 in sequences) {
43460 var sequence = sequences[i3];
43461 if (!sequence.nodes)
43463 var firstNode = sequence.nodes[0];
43464 var lastNode = sequence.nodes[sequence.nodes.length - 1];
43465 if (firstNode === lastNode)
43467 var issue = new validationIssue({
43469 subtype: "unclosed_multipolygon_part",
43470 severity: "warning",
43471 message: function(context) {
43472 var entity2 = context.hasEntity(this.entityIds[0]);
43473 return entity2 ? _t.append("issues.unclosed_multipolygon_part.message", {
43474 feature: utilDisplayLabel(
43482 reference: showReference,
43483 loc: sequence.nodes[0].loc,
43484 entityIds: [entity.id],
43485 hash: sequence.map(function(way) {
43489 issues.push(issue);
43492 function showReference(selection2) {
43493 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unclosed_multipolygon_part.reference"));
43496 var validation = function checkMismatchedGeometry(entity, graph) {
43497 var vertexPoint = vertexPointIssue(entity, graph);
43499 return [vertexPoint];
43500 var lineAsArea = lineTaggedAsAreaIssue(entity);
43502 return [lineAsArea];
43503 var mismatch = otherMismatchIssue(entity, graph);
43506 return unclosedMultipolygonPartIssues(entity, graph);
43508 validation.type = type2;
43512 // modules/validations/missing_role.js
43513 function validationMissingRole() {
43514 var type2 = "missing_role";
43515 var validation = function checkMissingRole(entity, graph) {
43517 if (entity.type === "way") {
43518 graph.parentRelations(entity).forEach(function(relation) {
43519 if (!relation.isMultipolygon())
43521 var member = relation.memberById(entity.id);
43522 if (member && isMissingRole(member)) {
43523 issues.push(makeIssue(entity, relation, member));
43526 } else if (entity.type === "relation" && entity.isMultipolygon()) {
43527 entity.indexedMembers().forEach(function(member) {
43528 var way = graph.hasEntity(member.id);
43529 if (way && isMissingRole(member)) {
43530 issues.push(makeIssue(way, entity, member));
43536 function isMissingRole(member) {
43537 return !member.role || !member.role.trim().length;
43539 function makeIssue(way, relation, member) {
43540 return new validationIssue({
43542 severity: "warning",
43543 message: function(context) {
43544 var member2 = context.hasEntity(this.entityIds[1]), relation2 = context.hasEntity(this.entityIds[0]);
43545 return member2 && relation2 ? _t.append("issues.missing_role.message", {
43546 member: utilDisplayLabel(member2, context.graph()),
43547 relation: utilDisplayLabel(relation2, context.graph())
43550 reference: showReference,
43551 entityIds: [relation.id, way.id],
43555 hash: member.index.toString(),
43556 dynamicFixes: function() {
43558 makeAddRoleFix("inner"),
43559 makeAddRoleFix("outer"),
43560 new validationIssueFix({
43561 icon: "iD-operation-delete",
43562 title: _t.append("issues.fix.remove_from_relation.title"),
43563 onClick: function(context) {
43565 actionDeleteMember(this.issue.entityIds[0], this.issue.data.member.index),
43566 _t("operations.delete_member.annotation", {
43575 function showReference(selection2) {
43576 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.missing_role.multipolygon.reference"));
43579 function makeAddRoleFix(role) {
43580 return new validationIssueFix({
43581 title: _t.append("issues.fix.set_as_" + role + ".title"),
43582 onClick: function(context) {
43583 var oldMember = this.issue.data.member;
43584 var member = { id: this.issue.entityIds[1], type: oldMember.type, role };
43586 actionChangeMember(this.issue.entityIds[0], member, oldMember.index),
43587 _t("operations.change_role.annotation", {
43594 validation.type = type2;
43598 // modules/validations/missing_tag.js
43599 function validationMissingTag(context) {
43600 var type2 = "missing_tag";
43601 function hasDescriptiveTags(entity, graph) {
43602 var onlyAttributeKeys = ["description", "name", "note", "start_date"];
43603 var entityDescriptiveKeys = Object.keys(entity.tags).filter(function(k2) {
43604 if (k2 === "area" || !osmIsInterestingTag(k2))
43606 return !onlyAttributeKeys.some(function(attributeKey) {
43607 return k2 === attributeKey || k2.indexOf(attributeKey + ":") === 0;
43610 if (entity.type === "relation" && entityDescriptiveKeys.length === 1 && entity.tags.type === "multipolygon") {
43611 return osmOldMultipolygonOuterMemberOfRelation(entity, graph);
43613 return entityDescriptiveKeys.length > 0;
43615 function isUnknownRoad(entity) {
43616 return entity.type === "way" && entity.tags.highway === "road";
43618 function isUntypedRelation(entity) {
43619 return entity.type === "relation" && !entity.tags.type;
43621 var validation = function checkMissingTag(entity, graph) {
43623 var osm = context.connection();
43624 var isUnloadedNode = entity.type === "node" && osm && !osm.isDataLoaded(entity.loc);
43625 if (!isUnloadedNode && // allow untagged nodes that are part of ways
43626 entity.geometry(graph) !== "vertex" && // allow untagged entities that are part of relations
43627 !entity.hasParentRelations(graph)) {
43628 if (Object.keys(entity.tags).length === 0) {
43630 } else if (!hasDescriptiveTags(entity, graph)) {
43631 subtype = "descriptive";
43632 } else if (isUntypedRelation(entity)) {
43633 subtype = "relation_type";
43636 if (!subtype && isUnknownRoad(entity)) {
43637 subtype = "highway_classification";
43641 var messageID = subtype === "highway_classification" ? "unknown_road" : "missing_tag." + subtype;
43642 var referenceID = subtype === "highway_classification" ? "unknown_road" : "missing_tag";
43643 var canDelete = entity.version === void 0 || entity.v !== void 0;
43644 var severity = canDelete && subtype !== "highway_classification" ? "error" : "warning";
43645 return [new validationIssue({
43649 message: function(context2) {
43650 var entity2 = context2.hasEntity(this.entityIds[0]);
43651 return entity2 ? _t.append("issues." + messageID + ".message", {
43652 feature: utilDisplayLabel(entity2, context2.graph())
43655 reference: showReference,
43656 entityIds: [entity.id],
43657 dynamicFixes: function(context2) {
43659 var selectFixType = subtype === "highway_classification" ? "select_road_type" : "select_preset";
43660 fixes.push(new validationIssueFix({
43661 icon: "iD-icon-search",
43662 title: _t.append("issues.fix." + selectFixType + ".title"),
43663 onClick: function(context3) {
43664 context3.ui().sidebar.showPresetList();
43668 var id2 = this.entityIds[0];
43669 var operation = operationDelete(context2, [id2]);
43670 var disabledReasonID = operation.disabled();
43671 if (!disabledReasonID) {
43672 deleteOnClick = function(context3) {
43673 var id3 = this.issue.entityIds[0];
43674 var operation2 = operationDelete(context3, [id3]);
43675 if (!operation2.disabled()) {
43681 new validationIssueFix({
43682 icon: "iD-operation-delete",
43683 title: _t.append("issues.fix.delete_feature.title"),
43684 disabledReason: disabledReasonID ? _t("operations.delete." + disabledReasonID + ".single") : void 0,
43685 onClick: deleteOnClick
43691 function showReference(selection2) {
43692 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues." + referenceID + ".reference"));
43695 validation.type = type2;
43699 // modules/validations/outdated_tags.js
43700 function validationOutdatedTags() {
43701 const type2 = "outdated_tags";
43702 let _waitingForDeprecated = true;
43703 let _dataDeprecated;
43704 _mainFileFetcher.get("deprecated").then((d2) => _dataDeprecated = d2).catch(() => {
43705 }).finally(() => _waitingForDeprecated = false);
43706 function oldTagIssues(entity, graph) {
43707 if (!entity.hasInterestingTags())
43709 let preset = _mainPresetIndex.match(entity, graph);
43712 const oldTags = Object.assign({}, entity.tags);
43713 let subtype = "deprecated_tags";
43714 if (preset.replacement) {
43715 const newPreset = _mainPresetIndex.item(preset.replacement);
43716 graph = actionChangePreset(
43721 /* skip field defaults */
43723 entity = graph.entity(entity.id);
43724 preset = newPreset;
43726 if (_dataDeprecated) {
43727 const deprecatedTags = entity.deprecatedTags(_dataDeprecated);
43728 if (deprecatedTags.length) {
43729 deprecatedTags.forEach((tag) => {
43730 graph = actionUpgradeTags(entity.id, tag.old, tag.replace)(graph);
43732 entity = graph.entity(entity.id);
43735 let newTags = Object.assign({}, entity.tags);
43736 if (preset.tags !== preset.addTags) {
43737 Object.keys(preset.addTags).forEach((k2) => {
43738 if (!newTags[k2]) {
43739 if (preset.addTags[k2] === "*") {
43740 newTags[k2] = "yes";
43742 newTags[k2] = preset.addTags[k2];
43747 const nsi = services.nsi;
43748 let waitingForNsi = false;
43751 waitingForNsi = nsi.status() === "loading";
43752 if (!waitingForNsi) {
43753 const loc = entity.extent(graph).center();
43754 nsiResult = nsi.upgradeTags(newTags, loc);
43756 newTags = nsiResult.newTags;
43757 subtype = "noncanonical_brand";
43762 issues.provisional = _waitingForDeprecated || waitingForNsi;
43763 const tagDiff = utilTagDiff(oldTags, newTags);
43764 if (!tagDiff.length)
43766 const isOnlyAddingTags = tagDiff.every((d2) => d2.type === "+");
43769 prefix = "noncanonical_brand.";
43770 } else if (subtype === "deprecated_tags" && isOnlyAddingTags) {
43771 subtype = "incomplete_tags";
43772 prefix = "incomplete.";
43774 let autoArgs = subtype !== "noncanonical_brand" ? [doUpgrade, _t("issues.fix.upgrade_tags.annotation")] : null;
43775 issues.push(new validationIssue({
43778 severity: "warning",
43779 message: showMessage,
43780 reference: showReference,
43781 entityIds: [entity.id],
43782 hash: utilHashcode(JSON.stringify(tagDiff)),
43783 dynamicFixes: () => {
43785 new validationIssueFix({
43787 title: _t.append("issues.fix.upgrade_tags.title"),
43788 onClick: (context) => {
43789 context.perform(doUpgrade, _t("issues.fix.upgrade_tags.annotation"));
43793 const item = nsiResult && nsiResult.matched;
43796 new validationIssueFix({
43797 title: _t.append("issues.fix.tag_as_not.title", { name: item.displayName }),
43798 onClick: (context) => {
43799 context.perform(addNotTag, _t("issues.fix.tag_as_not.annotation"));
43808 function doUpgrade(graph2) {
43809 const currEntity = graph2.hasEntity(entity.id);
43812 let newTags2 = Object.assign({}, currEntity.tags);
43813 tagDiff.forEach((diff) => {
43814 if (diff.type === "-") {
43815 delete newTags2[diff.key];
43816 } else if (diff.type === "+") {
43817 newTags2[diff.key] = diff.newVal;
43820 return actionChangeTags(currEntity.id, newTags2)(graph2);
43822 function addNotTag(graph2) {
43823 const currEntity = graph2.hasEntity(entity.id);
43826 const item = nsiResult && nsiResult.matched;
43829 let newTags2 = Object.assign({}, currEntity.tags);
43830 const wd = item.mainTag;
43831 const notwd = `not:${wd}`;
43832 const qid = item.tags[wd];
43833 newTags2[notwd] = qid;
43834 if (newTags2[wd] === qid) {
43835 const wp = item.mainTag.replace("wikidata", "wikipedia");
43836 delete newTags2[wd];
43837 delete newTags2[wp];
43839 return actionChangeTags(currEntity.id, newTags2)(graph2);
43841 function showMessage(context) {
43842 const currEntity = context.hasEntity(entity.id);
43845 let messageID = `issues.outdated_tags.${prefix}message`;
43846 if (subtype === "noncanonical_brand" && isOnlyAddingTags) {
43847 messageID += "_incomplete";
43849 return _t.append(messageID, {
43850 feature: utilDisplayLabel(
43858 function showReference(selection2) {
43859 let enter = selection2.selectAll(".issue-reference").data([0]).enter();
43860 enter.append("div").attr("class", "issue-reference").call(_t.append(`issues.outdated_tags.${prefix}reference`));
43861 enter.append("strong").call(_t.append("issues.suggested"));
43862 enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", (d2) => {
43863 let klass = d2.type === "+" ? "add" : "remove";
43864 return `tagDiff-cell tagDiff-cell-${klass}`;
43865 }).html((d2) => d2.display);
43868 function oldMultipolygonIssues(entity, graph) {
43869 let multipolygon, outerWay;
43870 if (entity.type === "relation") {
43871 outerWay = osmOldMultipolygonOuterMemberOfRelation(entity, graph);
43872 multipolygon = entity;
43873 } else if (entity.type === "way") {
43874 multipolygon = osmIsOldMultipolygonOuterMember(entity, graph);
43879 if (!multipolygon || !outerWay)
43881 return [new validationIssue({
43883 subtype: "old_multipolygon",
43884 severity: "warning",
43885 message: showMessage,
43886 reference: showReference,
43887 entityIds: [outerWay.id, multipolygon.id],
43888 dynamicFixes: () => {
43890 new validationIssueFix({
43891 autoArgs: [doUpgrade, _t("issues.fix.move_tags.annotation")],
43892 title: _t.append("issues.fix.move_tags.title"),
43893 onClick: (context) => {
43894 context.perform(doUpgrade, _t("issues.fix.move_tags.annotation"));
43900 function doUpgrade(graph2) {
43901 let currMultipolygon = graph2.hasEntity(multipolygon.id);
43902 let currOuterWay = graph2.hasEntity(outerWay.id);
43903 if (!currMultipolygon || !currOuterWay)
43905 currMultipolygon = currMultipolygon.mergeTags(currOuterWay.tags);
43906 graph2 = graph2.replace(currMultipolygon);
43907 return actionChangeTags(currOuterWay.id, {})(graph2);
43909 function showMessage(context) {
43910 let currMultipolygon = context.hasEntity(multipolygon.id);
43911 if (!currMultipolygon)
43914 "issues.old_multipolygon.message",
43915 { multipolygon: utilDisplayLabel(
43923 function showReference(selection2) {
43924 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.old_multipolygon.reference"));
43927 let validation = function checkOutdatedTags(entity, graph) {
43928 let issues = oldMultipolygonIssues(entity, graph);
43929 if (!issues.length)
43930 issues = oldTagIssues(entity, graph);
43933 validation.type = type2;
43937 // modules/validations/private_data.js
43938 function validationPrivateData() {
43939 var type2 = "private_data";
43940 var privateBuildingValues = {
43946 semidetached_house: true,
43947 static_caravan: true
43958 var personalTags = {
43959 "contact:email": true,
43960 "contact:fax": true,
43961 "contact:phone": true,
43966 var validation = function checkPrivateData(entity) {
43967 var tags = entity.tags;
43968 if (!tags.building || !privateBuildingValues[tags.building])
43971 for (var k2 in tags) {
43972 if (publicKeys[k2])
43974 if (!personalTags[k2]) {
43975 keepTags[k2] = tags[k2];
43978 var tagDiff = utilTagDiff(tags, keepTags);
43979 if (!tagDiff.length)
43981 var fixID = tagDiff.length === 1 ? "remove_tag" : "remove_tags";
43982 return [new validationIssue({
43984 severity: "warning",
43985 message: showMessage,
43986 reference: showReference,
43987 entityIds: [entity.id],
43988 dynamicFixes: function() {
43990 new validationIssueFix({
43991 icon: "iD-operation-delete",
43992 title: _t.append("issues.fix." + fixID + ".title"),
43993 onClick: function(context) {
43994 context.perform(doUpgrade, _t("issues.fix.remove_tag.annotation"));
44000 function doUpgrade(graph) {
44001 var currEntity = graph.hasEntity(entity.id);
44004 var newTags = Object.assign({}, currEntity.tags);
44005 tagDiff.forEach(function(diff) {
44006 if (diff.type === "-") {
44007 delete newTags[diff.key];
44008 } else if (diff.type === "+") {
44009 newTags[diff.key] = diff.newVal;
44012 return actionChangeTags(currEntity.id, newTags)(graph);
44014 function showMessage(context) {
44015 var currEntity = context.hasEntity(this.entityIds[0]);
44019 "issues.private_data.contact.message",
44020 { feature: utilDisplayLabel(currEntity, context.graph()) }
44023 function showReference(selection2) {
44024 var enter = selection2.selectAll(".issue-reference").data([0]).enter();
44025 enter.append("div").attr("class", "issue-reference").call(_t.append("issues.private_data.reference"));
44026 enter.append("strong").call(_t.append("issues.suggested"));
44027 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) {
44028 var klass = d2.type === "+" ? "add" : "remove";
44029 return "tagDiff-cell tagDiff-cell-" + klass;
44030 }).html(function(d2) {
44035 validation.type = type2;
44039 // modules/validations/suspicious_name.js
44040 function validationSuspiciousName() {
44041 const type2 = "suspicious_name";
44042 const keysToTestForGenericValues = [
44057 let _waitingForNsi = false;
44058 function isGenericMatchInNsi(tags) {
44059 const nsi = services.nsi;
44061 _waitingForNsi = nsi.status() === "loading";
44062 if (!_waitingForNsi) {
44063 return nsi.isGenericName(tags);
44068 function nameMatchesRawTag(lowercaseName, tags) {
44069 for (let i3 = 0; i3 < keysToTestForGenericValues.length; i3++) {
44070 let key = keysToTestForGenericValues[i3];
44071 let val = tags[key];
44073 val = val.toLowerCase();
44074 if (key === lowercaseName || val === lowercaseName || key.replace(/\_/g, " ") === lowercaseName || val.replace(/\_/g, " ") === lowercaseName) {
44081 function isGenericName(name, tags) {
44082 name = name.toLowerCase();
44083 return nameMatchesRawTag(name, tags) || isGenericMatchInNsi(tags);
44085 function makeGenericNameIssue(entityId, nameKey, genericName, langCode) {
44086 return new validationIssue({
44088 subtype: "generic_name",
44089 severity: "warning",
44090 message: function(context) {
44091 let entity = context.hasEntity(this.entityIds[0]);
44094 let preset = _mainPresetIndex.match(entity, context.graph());
44095 let langName = langCode && _mainLocalizer.languageName(langCode);
44097 "issues.generic_name.message" + (langName ? "_language" : ""),
44098 { feature: preset.name(), name: genericName, language: langName }
44101 reference: showReference,
44102 entityIds: [entityId],
44103 hash: `${nameKey}=${genericName}`,
44104 dynamicFixes: function() {
44106 new validationIssueFix({
44107 icon: "iD-operation-delete",
44108 title: _t.append("issues.fix.remove_the_name.title"),
44109 onClick: function(context) {
44110 let entityId2 = this.issue.entityIds[0];
44111 let entity = context.entity(entityId2);
44112 let tags = Object.assign({}, entity.tags);
44113 delete tags[nameKey];
44115 actionChangeTags(entityId2, tags),
44116 _t("issues.fix.remove_generic_name.annotation")
44123 function showReference(selection2) {
44124 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
44127 function makeIncorrectNameIssue(entityId, nameKey, incorrectName, langCode) {
44128 return new validationIssue({
44130 subtype: "not_name",
44131 severity: "warning",
44132 message: function(context) {
44133 const entity = context.hasEntity(this.entityIds[0]);
44136 const preset = _mainPresetIndex.match(entity, context.graph());
44137 const langName = langCode && _mainLocalizer.languageName(langCode);
44139 "issues.incorrect_name.message" + (langName ? "_language" : ""),
44140 { feature: preset.name(), name: incorrectName, language: langName }
44143 reference: showReference,
44144 entityIds: [entityId],
44145 hash: `${nameKey}=${incorrectName}`,
44146 dynamicFixes: function() {
44148 new validationIssueFix({
44149 icon: "iD-operation-delete",
44150 title: _t.append("issues.fix.remove_the_name.title"),
44151 onClick: function(context) {
44152 const entityId2 = this.issue.entityIds[0];
44153 const entity = context.entity(entityId2);
44154 let tags = Object.assign({}, entity.tags);
44155 delete tags[nameKey];
44157 actionChangeTags(entityId2, tags),
44158 _t("issues.fix.remove_mistaken_name.annotation")
44165 function showReference(selection2) {
44166 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
44169 let validation = function checkGenericName(entity) {
44170 const tags = entity.tags;
44171 const hasWikidata = !!tags.wikidata || !!tags["brand:wikidata"] || !!tags["operator:wikidata"];
44175 const notNames2 = (tags["not:name"] || "").split(";");
44176 for (let key in tags) {
44177 const m2 = key.match(/^name(?:(?::)([a-zA-Z_-]+))?$/);
44180 const langCode = m2.length >= 2 ? m2[1] : null;
44181 const value = tags[key];
44182 if (notNames2.length) {
44183 for (let i3 in notNames2) {
44184 const notName = notNames2[i3];
44185 if (notName && value === notName) {
44186 issues.push(makeIncorrectNameIssue(entity.id, key, value, langCode));
44191 if (isGenericName(value, tags)) {
44192 issues.provisional = _waitingForNsi;
44193 issues.push(makeGenericNameIssue(entity.id, key, value, langCode));
44198 validation.type = type2;
44202 // modules/validations/unsquare_way.js
44203 function validationUnsquareWay(context) {
44204 var type2 = "unsquare_way";
44205 var DEFAULT_DEG_THRESHOLD = 5;
44206 var epsilon3 = 0.05;
44207 var nodeThreshold = 10;
44208 function isBuilding(entity, graph) {
44209 if (entity.type !== "way" || entity.geometry(graph) !== "area")
44211 return entity.tags.building && entity.tags.building !== "no";
44213 var validation = function checkUnsquareWay(entity, graph) {
44214 if (!isBuilding(entity, graph))
44216 if (entity.tags.nonsquare === "yes")
44218 var isClosed = entity.isClosed();
44221 var nodes = graph.childNodes(entity).slice();
44222 if (nodes.length > nodeThreshold + 1)
44224 var osm = services.osm;
44225 if (!osm || nodes.some(function(node) {
44226 return !osm.isDataLoaded(node.loc);
44229 var hasConnectedSquarableWays = nodes.some(function(node) {
44230 return graph.parentWays(node).some(function(way) {
44231 if (way.id === entity.id)
44233 if (isBuilding(way, graph))
44235 return graph.parentRelations(way).some(function(parentRelation) {
44236 return parentRelation.isMultipolygon() && parentRelation.tags.building && parentRelation.tags.building !== "no";
44240 if (hasConnectedSquarableWays)
44242 var storedDegreeThreshold = corePreferences("validate-square-degrees");
44243 var degreeThreshold = isFinite(storedDegreeThreshold) ? Number(storedDegreeThreshold) : DEFAULT_DEG_THRESHOLD;
44244 var points = nodes.map(function(node) {
44245 return context.projection(node.loc);
44247 if (!geoOrthoCanOrthogonalize(points, isClosed, epsilon3, degreeThreshold, true))
44250 if (!entity.tags.wikidata) {
44251 var autoAction = actionOrthogonalize(entity.id, context.projection, void 0, degreeThreshold);
44252 autoAction.transitionable = false;
44253 autoArgs = [autoAction, _t("operations.orthogonalize.annotation.feature", { n: 1 })];
44255 return [new validationIssue({
44257 subtype: "building",
44258 severity: "warning",
44259 message: function(context2) {
44260 var entity2 = context2.hasEntity(this.entityIds[0]);
44261 return entity2 ? _t.append("issues.unsquare_way.message", {
44262 feature: utilDisplayLabel(entity2, context2.graph())
44265 reference: showReference,
44266 entityIds: [entity.id],
44267 hash: degreeThreshold,
44268 dynamicFixes: function() {
44270 new validationIssueFix({
44271 icon: "iD-operation-orthogonalize",
44272 title: _t.append("issues.fix.square_feature.title"),
44274 onClick: function(context2, completionHandler) {
44275 var entityId = this.issue.entityIds[0];
44277 actionOrthogonalize(entityId, context2.projection, void 0, degreeThreshold),
44278 _t("operations.orthogonalize.annotation.feature", { n: 1 })
44280 window.setTimeout(function() {
44281 completionHandler();
44286 new validationIssueFix({
44287 title: t.append('issues.fix.tag_as_unsquare.title'),
44288 onClick: function(context) {
44289 var entityId = this.issue.entityIds[0];
44290 var entity = context.entity(entityId);
44291 var tags = Object.assign({}, entity.tags); // shallow copy
44292 tags.nonsquare = 'yes';
44294 actionChangeTags(entityId, tags),
44295 t('issues.fix.tag_as_unsquare.annotation')
44303 function showReference(selection2) {
44304 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unsquare_way.buildings.reference"));
44307 validation.type = type2;
44311 // modules/core/validator.js
44312 function coreValidator(context) {
44313 let dispatch14 = dispatch_default("validated", "focusedIssue");
44314 let validator = utilRebind({}, dispatch14, "on");
44316 let _disabledRules = {};
44317 let _ignoredIssueIDs = /* @__PURE__ */ new Set();
44318 let _resolvedIssueIDs = /* @__PURE__ */ new Set();
44319 let _baseCache = validationCache("base");
44320 let _headCache = validationCache("head");
44321 let _completeDiff = {};
44322 let _headIsCurrent = false;
44323 let _deferredRIC = {};
44324 let _deferredST = /* @__PURE__ */ new Set();
44327 const _errorOverrides = parseHashParam(context.initialHashParams.validationError);
44328 const _warningOverrides = parseHashParam(context.initialHashParams.validationWarning);
44329 const _disableOverrides = parseHashParam(context.initialHashParams.validationDisable);
44330 function parseHashParam(param) {
44332 let rules = (param || "").split(",");
44333 rules.forEach((rule) => {
44334 rule = rule.trim();
44335 const parts = rule.split("/", 2);
44336 const type2 = parts[0];
44337 const subtype = parts[1] || "*";
44338 if (!type2 || !subtype)
44340 result.push({ type: makeRegExp(type2), subtype: makeRegExp(subtype) });
44343 function makeRegExp(str2) {
44344 const escaped = str2.replace(/[-\/\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
44345 return new RegExp("^" + escaped + "$");
44348 validator.init = () => {
44349 Object.values(validations_exports).forEach((validation) => {
44350 if (typeof validation !== "function")
44352 const fn = validation(context);
44353 const key = fn.type;
44356 let disabledRules = corePreferences("validate-disabledRules");
44357 if (disabledRules) {
44358 disabledRules.split(",").forEach((k2) => _disabledRules[k2] = true);
44361 function reset(resetIgnored) {
44362 _baseCache.queue = [];
44363 _headCache.queue = [];
44364 Object.keys(_deferredRIC).forEach((key) => {
44365 window.cancelIdleCallback(key);
44366 _deferredRIC[key]();
44369 _deferredST.forEach(window.clearTimeout);
44370 _deferredST.clear();
44372 _ignoredIssueIDs.clear();
44373 _resolvedIssueIDs.clear();
44374 _baseCache = validationCache("base");
44375 _headCache = validationCache("head");
44376 _completeDiff = {};
44377 _headIsCurrent = false;
44379 validator.reset = () => {
44382 validator.resetIgnoredIssues = () => {
44383 _ignoredIssueIDs.clear();
44384 dispatch14.call("validated");
44386 validator.revalidateUnsquare = () => {
44387 revalidateUnsquare(_headCache);
44388 revalidateUnsquare(_baseCache);
44389 dispatch14.call("validated");
44391 function revalidateUnsquare(cache) {
44392 const checkUnsquareWay = _rules.unsquare_way;
44393 if (!cache.graph || typeof checkUnsquareWay !== "function")
44395 cache.uncacheIssuesOfType("unsquare_way");
44396 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");
44397 buildings.forEach((entity) => {
44398 const detected = checkUnsquareWay(entity, cache.graph);
44399 if (!detected.length)
44401 cache.cacheIssues(detected);
44404 validator.getIssues = (options2) => {
44405 const opts = Object.assign({ what: "all", where: "all", includeIgnored: false, includeDisabledRules: false }, options2);
44406 const view = context.map().extent();
44407 let seen = /* @__PURE__ */ new Set();
44409 if (_headCache.graph && _headCache.graph !== _baseCache.graph) {
44410 Object.values(_headCache.issuesByIssueID).forEach((issue) => {
44411 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
44412 if (opts.what === "edited" && !userModified)
44414 if (!filter2(issue))
44416 seen.add(issue.id);
44417 results.push(issue);
44420 if (opts.what === "all") {
44421 Object.values(_baseCache.issuesByIssueID).forEach((issue) => {
44422 if (!filter2(issue))
44424 seen.add(issue.id);
44425 results.push(issue);
44429 function filter2(issue) {
44432 if (seen.has(issue.id))
44434 if (_resolvedIssueIDs.has(issue.id))
44436 if (opts.includeDisabledRules === "only" && !_disabledRules[issue.type])
44438 if (!opts.includeDisabledRules && _disabledRules[issue.type])
44440 if (opts.includeIgnored === "only" && !_ignoredIssueIDs.has(issue.id))
44442 if (!opts.includeIgnored && _ignoredIssueIDs.has(issue.id))
44444 if ((issue.entityIds || []).some((id2) => !context.hasEntity(id2)))
44446 if (opts.where === "visible") {
44447 const extent = issue.extent(context.graph());
44448 if (!view.intersects(extent))
44454 validator.getResolvedIssues = () => {
44455 return Array.from(_resolvedIssueIDs).map((issueID) => _baseCache.issuesByIssueID[issueID]).filter(Boolean);
44457 validator.focusIssue = (issue) => {
44458 const graph = context.graph();
44461 const issueExtent = issue.extent(graph);
44463 focusCenter = issueExtent.center();
44465 if (issue.entityIds && issue.entityIds.length) {
44466 selectID = issue.entityIds[0];
44467 if (selectID && selectID.charAt(0) === "r") {
44468 const ids = utilEntityAndDeepMemberIDs([selectID], graph);
44469 let nodeID = ids.find((id2) => id2.charAt(0) === "n" && graph.hasEntity(id2));
44471 const wayID = ids.find((id2) => id2.charAt(0) === "w" && graph.hasEntity(id2));
44473 nodeID = graph.entity(wayID).first();
44477 focusCenter = graph.entity(nodeID).loc;
44482 const setZoom = Math.max(context.map().zoom(), 19);
44483 context.map().unobscuredCenterZoomEase(focusCenter, setZoom);
44486 window.setTimeout(() => {
44487 context.enter(modeSelect(context, [selectID]));
44488 dispatch14.call("focusedIssue", this, issue);
44492 validator.getIssuesBySeverity = (options2) => {
44493 let groups = utilArrayGroupBy(validator.getIssues(options2), "severity");
44494 groups.error = groups.error || [];
44495 groups.warning = groups.warning || [];
44498 validator.getSharedEntityIssues = (entityIDs, options2) => {
44499 const orderedIssueTypes = [
44500 // Show some issue types in a particular order:
44503 // - missing data first
44505 "mismatched_geometry",
44506 // - identity issues
44509 // - geometry issues where fixing them might solve connectivity issues
44510 "disconnected_way",
44511 "impossible_oneway"
44512 // - finally connectivity issues
44514 const allIssues = validator.getIssues(options2);
44515 const forEntityIDs = new Set(entityIDs);
44516 return allIssues.filter((issue) => (issue.entityIds || []).some((entityID) => forEntityIDs.has(entityID))).sort((issue1, issue2) => {
44517 if (issue1.type === issue2.type) {
44518 return issue1.id < issue2.id ? -1 : 1;
44520 const index1 = orderedIssueTypes.indexOf(issue1.type);
44521 const index2 = orderedIssueTypes.indexOf(issue2.type);
44522 if (index1 !== -1 && index2 !== -1) {
44523 return index1 - index2;
44524 } else if (index1 === -1 && index2 === -1) {
44525 return issue1.type < issue2.type ? -1 : 1;
44527 return index1 !== -1 ? -1 : 1;
44531 validator.getEntityIssues = (entityID, options2) => {
44532 return validator.getSharedEntityIssues([entityID], options2);
44534 validator.getRuleKeys = () => {
44535 return Object.keys(_rules);
44537 validator.isRuleEnabled = (key) => {
44538 return !_disabledRules[key];
44540 validator.toggleRule = (key) => {
44541 if (_disabledRules[key]) {
44542 delete _disabledRules[key];
44544 _disabledRules[key] = true;
44546 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
44547 validator.validate();
44549 validator.disableRules = (keys2) => {
44550 _disabledRules = {};
44551 keys2.forEach((k2) => _disabledRules[k2] = true);
44552 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
44553 validator.validate();
44555 validator.ignoreIssue = (issueID) => {
44556 _ignoredIssueIDs.add(issueID);
44558 validator.validate = () => {
44559 const baseGraph = context.history().base();
44560 if (!_headCache.graph)
44561 _headCache.graph = baseGraph;
44562 if (!_baseCache.graph)
44563 _baseCache.graph = baseGraph;
44564 const prevGraph = _headCache.graph;
44565 const currGraph = context.graph();
44566 if (currGraph === prevGraph) {
44567 _headIsCurrent = true;
44568 dispatch14.call("validated");
44569 return Promise.resolve();
44571 if (_headPromise) {
44572 _headIsCurrent = false;
44573 return _headPromise;
44575 _headCache.graph = currGraph;
44576 _completeDiff = context.history().difference().complete();
44577 const incrementalDiff = coreDifference(prevGraph, currGraph);
44578 let entityIDs = Object.keys(incrementalDiff.complete());
44579 entityIDs = _headCache.withAllRelatedEntities(entityIDs);
44580 if (!entityIDs.size) {
44581 dispatch14.call("validated");
44582 return Promise.resolve();
44584 _headPromise = validateEntitiesAsync(entityIDs, _headCache).then(() => updateResolvedIssues(entityIDs)).then(() => dispatch14.call("validated")).catch(() => {
44586 _headPromise = null;
44587 if (!_headIsCurrent) {
44588 validator.validate();
44591 return _headPromise;
44593 context.history().on("restore.validator", validator.validate).on("undone.validator", validator.validate).on("redone.validator", validator.validate).on("reset.validator", () => {
44595 validator.validate();
44597 context.on("exit.validator", validator.validate);
44598 context.history().on("merge.validator", (entities) => {
44601 const baseGraph = context.history().base();
44602 if (!_headCache.graph)
44603 _headCache.graph = baseGraph;
44604 if (!_baseCache.graph)
44605 _baseCache.graph = baseGraph;
44606 let entityIDs = entities.map((entity) => entity.id);
44607 entityIDs = _baseCache.withAllRelatedEntities(entityIDs);
44608 validateEntitiesAsync(entityIDs, _baseCache);
44610 function validateEntity(entity, graph) {
44611 let result = { issues: [], provisional: false };
44612 Object.keys(_rules).forEach(runValidation);
44614 function runValidation(key) {
44615 const fn = _rules[key];
44616 if (typeof fn !== "function") {
44617 console.error("no such validation rule = " + key);
44620 let detected = fn(entity, graph);
44621 if (detected.provisional) {
44622 result.provisional = true;
44624 detected = detected.filter(applySeverityOverrides);
44625 result.issues = result.issues.concat(detected);
44626 function applySeverityOverrides(issue) {
44627 const type2 = issue.type;
44628 const subtype = issue.subtype || "";
44630 for (i3 = 0; i3 < _errorOverrides.length; i3++) {
44631 if (_errorOverrides[i3].type.test(type2) && _errorOverrides[i3].subtype.test(subtype)) {
44632 issue.severity = "error";
44636 for (i3 = 0; i3 < _warningOverrides.length; i3++) {
44637 if (_warningOverrides[i3].type.test(type2) && _warningOverrides[i3].subtype.test(subtype)) {
44638 issue.severity = "warning";
44642 for (i3 = 0; i3 < _disableOverrides.length; i3++) {
44643 if (_disableOverrides[i3].type.test(type2) && _disableOverrides[i3].subtype.test(subtype)) {
44651 function updateResolvedIssues(entityIDs) {
44652 entityIDs.forEach((entityID) => {
44653 const baseIssues = _baseCache.issuesByEntityID[entityID];
44656 baseIssues.forEach((issueID) => {
44657 const issue = _baseCache.issuesByIssueID[issueID];
44658 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
44659 if (userModified && !_headCache.issuesByIssueID[issueID]) {
44660 _resolvedIssueIDs.add(issueID);
44662 _resolvedIssueIDs.delete(issueID);
44667 function validateEntitiesAsync(entityIDs, cache) {
44668 const jobs = Array.from(entityIDs).map((entityID) => {
44669 if (cache.queuedEntityIDs.has(entityID))
44671 cache.queuedEntityIDs.add(entityID);
44672 cache.uncacheEntityID(entityID);
44674 cache.queuedEntityIDs.delete(entityID);
44675 const graph = cache.graph;
44678 const entity = graph.hasEntity(entityID);
44681 const result = validateEntity(entity, graph);
44682 if (result.provisional) {
44683 cache.provisionalEntityIDs.add(entityID);
44685 cache.cacheIssues(result.issues);
44687 }).filter(Boolean);
44688 cache.queue = cache.queue.concat(utilArrayChunk(jobs, 100));
44689 if (cache.queuePromise)
44690 return cache.queuePromise;
44691 cache.queuePromise = processQueue(cache).then(() => revalidateProvisionalEntities(cache)).catch(() => {
44692 }).finally(() => cache.queuePromise = null);
44693 return cache.queuePromise;
44695 function revalidateProvisionalEntities(cache) {
44696 if (!cache.provisionalEntityIDs.size)
44698 const handle = window.setTimeout(() => {
44699 _deferredST.delete(handle);
44700 if (!cache.provisionalEntityIDs.size)
44702 validateEntitiesAsync(Array.from(cache.provisionalEntityIDs), cache);
44704 _deferredST.add(handle);
44706 function processQueue(cache) {
44707 if (!cache.queue.length)
44708 return Promise.resolve();
44709 const chunk = cache.queue.pop();
44710 return new Promise((resolvePromise, rejectPromise) => {
44711 const handle = window.requestIdleCallback(() => {
44712 delete _deferredRIC[handle];
44713 chunk.forEach((job) => job());
44716 _deferredRIC[handle] = rejectPromise;
44718 if (cache.queue.length % 25 === 0)
44719 dispatch14.call("validated");
44720 }).then(() => processQueue(cache));
44724 function validationCache(which) {
44729 queuePromise: null,
44730 queuedEntityIDs: /* @__PURE__ */ new Set(),
44731 provisionalEntityIDs: /* @__PURE__ */ new Set(),
44732 issuesByIssueID: {},
44733 // issue.id -> issue
44734 issuesByEntityID: {}
44735 // entity.id -> Set(issue.id)
44737 cache.cacheIssue = (issue) => {
44738 (issue.entityIds || []).forEach((entityID) => {
44739 if (!cache.issuesByEntityID[entityID]) {
44740 cache.issuesByEntityID[entityID] = /* @__PURE__ */ new Set();
44742 cache.issuesByEntityID[entityID].add(issue.id);
44744 cache.issuesByIssueID[issue.id] = issue;
44746 cache.uncacheIssue = (issue) => {
44747 (issue.entityIds || []).forEach((entityID) => {
44748 if (cache.issuesByEntityID[entityID]) {
44749 cache.issuesByEntityID[entityID].delete(issue.id);
44752 delete cache.issuesByIssueID[issue.id];
44754 cache.cacheIssues = (issues) => {
44755 issues.forEach(cache.cacheIssue);
44757 cache.uncacheIssues = (issues) => {
44758 issues.forEach(cache.uncacheIssue);
44760 cache.uncacheIssuesOfType = (type2) => {
44761 const issuesOfType = Object.values(cache.issuesByIssueID).filter((issue) => issue.type === type2);
44762 cache.uncacheIssues(issuesOfType);
44764 cache.uncacheEntityID = (entityID) => {
44765 const entityIssueIDs = cache.issuesByEntityID[entityID];
44766 if (entityIssueIDs) {
44767 entityIssueIDs.forEach((issueID) => {
44768 const issue = cache.issuesByIssueID[issueID];
44770 cache.uncacheIssue(issue);
44772 delete cache.issuesByIssueID[issueID];
44776 delete cache.issuesByEntityID[entityID];
44777 cache.provisionalEntityIDs.delete(entityID);
44779 cache.withAllRelatedEntities = (entityIDs) => {
44780 let result = /* @__PURE__ */ new Set();
44781 (entityIDs || []).forEach((entityID) => {
44782 result.add(entityID);
44783 const entityIssueIDs = cache.issuesByEntityID[entityID];
44784 if (entityIssueIDs) {
44785 entityIssueIDs.forEach((issueID) => {
44786 const issue = cache.issuesByIssueID[issueID];
44788 (issue.entityIds || []).forEach((relatedID) => result.add(relatedID));
44790 delete cache.issuesByIssueID[issueID];
44800 // modules/core/uploader.js
44801 function coreUploader(context) {
44802 var dispatch14 = dispatch_default(
44803 // Start and end events are dispatched exactly once each per legitimate outside call to `save`
44805 // dispatched as soon as a call to `save` has been deemed legitimate
44807 // dispatched after the result event has been dispatched
44808 "willAttemptUpload",
44809 // dispatched before the actual upload call occurs, if it will
44811 // Each save results in one of these outcomes:
44813 // upload wasn't attempted since there were no edits
44815 // upload failed due to errors
44817 // upload failed due to data conflicts
44819 // upload completed without errors
44821 var _isSaving = false;
44822 var _conflicts = [];
44825 var _discardTags = {};
44826 _mainFileFetcher.get("discarded").then(function(d2) {
44828 }).catch(function() {
44830 var uploader = utilRebind({}, dispatch14, "on");
44831 uploader.isSaving = function() {
44834 uploader.save = function(changeset, tryAgain, checkConflicts) {
44835 if (_isSaving && !tryAgain) {
44838 var osm = context.connection();
44841 if (!osm.authenticated()) {
44842 osm.authenticate(function(err) {
44844 uploader.save(changeset, tryAgain, checkConflicts);
44851 dispatch14.call("saveStarted", this);
44853 var history = context.history();
44856 _origChanges = history.changes(actionDiscardTags(history.difference(), _discardTags));
44858 history.perform(actionNoop());
44860 if (!checkConflicts) {
44863 performFullConflictCheck(changeset);
44866 function performFullConflictCheck(changeset) {
44867 var osm = context.connection();
44870 var history = context.history();
44871 var localGraph = context.graph();
44872 var remoteGraph = coreGraph(history.base(), true);
44873 var summary = history.difference().summary();
44875 for (var i3 = 0; i3 < summary.length; i3++) {
44876 var item = summary[i3];
44877 if (item.changeType === "modified") {
44878 _toCheck.push(item.entity.id);
44881 var _toLoad = withChildNodes(_toCheck, localGraph);
44883 var _toLoadCount = 0;
44884 var _toLoadTotal = _toLoad.length;
44885 if (_toCheck.length) {
44886 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
44887 _toLoad.forEach(function(id2) {
44888 _loaded[id2] = false;
44890 osm.loadMultiple(_toLoad, loaded);
44895 function withChildNodes(ids, graph) {
44896 var s2 = new Set(ids);
44897 ids.forEach(function(id2) {
44898 var entity = graph.entity(id2);
44899 if (entity.type !== "way")
44901 graph.childNodes(entity).forEach(function(child) {
44902 if (child.version !== void 0) {
44907 return Array.from(s2);
44909 function loaded(err, result) {
44910 if (_errors.length)
44914 msg: err.message || err.responseText,
44915 details: [_t("save.status_code", { code: err.status })]
44917 didResultInErrors();
44920 result.data.forEach(function(entity) {
44921 remoteGraph.replace(entity);
44922 _loaded[entity.id] = true;
44923 _toLoad = _toLoad.filter(function(val) {
44924 return val !== entity.id;
44926 if (!entity.visible)
44929 if (entity.type === "way") {
44930 for (i4 = 0; i4 < entity.nodes.length; i4++) {
44931 id2 = entity.nodes[i4];
44932 if (_loaded[id2] === void 0) {
44933 _loaded[id2] = false;
44934 loadMore.push(id2);
44937 } else if (entity.type === "relation" && entity.isMultipolygon()) {
44938 for (i4 = 0; i4 < entity.members.length; i4++) {
44939 id2 = entity.members[i4].id;
44940 if (_loaded[id2] === void 0) {
44941 _loaded[id2] = false;
44942 loadMore.push(id2);
44947 _toLoadCount += result.data.length;
44948 _toLoadTotal += loadMore.length;
44949 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
44950 if (loadMore.length) {
44951 _toLoad.push.apply(_toLoad, loadMore);
44952 osm.loadMultiple(loadMore, loaded);
44954 if (!_toLoad.length) {
44960 function detectConflicts() {
44961 function choice(id2, text2, action) {
44965 action: function() {
44966 history.replace(action);
44970 function formatUser(d2) {
44971 return '<a href="' + osm.userURL(d2) + '" target="_blank">' + escape_default(d2) + "</a>";
44973 function entityName(entity) {
44974 return utilDisplayName(entity) || utilDisplayType(entity.id) + " " + entity.id;
44976 function sameVersions(local, remote) {
44977 if (local.version !== remote.version)
44979 if (local.type === "way") {
44980 var children2 = utilArrayUnion(local.nodes, remote.nodes);
44981 for (var i4 = 0; i4 < children2.length; i4++) {
44982 var a2 = localGraph.hasEntity(children2[i4]);
44983 var b2 = remoteGraph.hasEntity(children2[i4]);
44984 if (a2 && b2 && a2.version !== b2.version)
44990 _toCheck.forEach(function(id2) {
44991 var local = localGraph.entity(id2);
44992 var remote = remoteGraph.entity(id2);
44993 if (sameVersions(local, remote))
44995 var merge2 = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags, formatUser);
44996 history.replace(merge2);
44997 var mergeConflicts = merge2.conflicts();
44998 if (!mergeConflicts.length)
45000 var forceLocal = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_local");
45001 var forceRemote = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_remote");
45002 var keepMine = _t("save.conflict." + (remote.visible ? "keep_local" : "restore"));
45003 var keepTheirs = _t("save.conflict." + (remote.visible ? "keep_remote" : "delete"));
45006 name: entityName(local),
45007 details: mergeConflicts,
45010 choice(id2, keepMine, forceLocal),
45011 choice(id2, keepTheirs, forceRemote)
45017 function upload(changeset) {
45018 var osm = context.connection();
45020 _errors.push({ msg: "No OSM Service" });
45022 if (_conflicts.length) {
45023 didResultInConflicts(changeset);
45024 } else if (_errors.length) {
45025 didResultInErrors();
45027 var history = context.history();
45028 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
45029 if (changes.modified.length || changes.created.length || changes.deleted.length) {
45030 dispatch14.call("willAttemptUpload", this);
45031 osm.putChangeset(changeset, changes, uploadCallback);
45033 didResultInNoChanges();
45037 function uploadCallback(err, changeset) {
45039 if (err.status === 409) {
45040 uploader.save(changeset, true, true);
45043 msg: err.message || err.responseText,
45044 details: [_t("save.status_code", { code: err.status })]
45046 didResultInErrors();
45049 didResultInSuccess(changeset);
45052 function didResultInNoChanges() {
45053 dispatch14.call("resultNoChanges", this);
45057 function didResultInErrors() {
45058 context.history().pop();
45059 dispatch14.call("resultErrors", this, _errors);
45062 function didResultInConflicts(changeset) {
45063 _conflicts.sort(function(a2, b2) {
45064 return b2.id.localeCompare(a2.id);
45066 dispatch14.call("resultConflicts", this, changeset, _conflicts, _origChanges);
45069 function didResultInSuccess(changeset) {
45070 context.history().clearSaved();
45071 dispatch14.call("resultSuccess", this, changeset);
45072 window.setTimeout(function() {
45077 function endSave() {
45079 dispatch14.call("saveEnded", this);
45081 uploader.cancelConflictResolution = function() {
45082 context.history().pop();
45084 uploader.processResolvedConflicts = function(changeset) {
45085 var history = context.history();
45086 for (var i3 = 0; i3 < _conflicts.length; i3++) {
45087 if (_conflicts[i3].chosen === 1) {
45088 var entity = context.hasEntity(_conflicts[i3].id);
45089 if (entity && entity.type === "way") {
45090 var children2 = utilArrayUniq(entity.nodes);
45091 for (var j3 = 0; j3 < children2.length; j3++) {
45092 history.replace(actionRevert(children2[j3]));
45095 history.replace(actionRevert(_conflicts[i3].id));
45098 uploader.save(changeset, true, false);
45100 uploader.reset = function() {
45105 // modules/renderer/background_source.js
45106 var import_lodash4 = __toESM(require_lodash());
45108 // modules/util/IntervalTasksQueue.js
45109 var IntervalTasksQueue = class {
45111 * Interval in milliseconds inside which only 1 task can execute.
45112 * e.g. if interval is 200ms, and 5 async tasks are unqueued,
45113 * they will complete in ~1s if not cleared
45114 * @param {number} intervalInMs
45116 constructor(intervalInMs) {
45117 this.intervalInMs = intervalInMs;
45118 this.pendingHandles = [];
45122 let taskTimeout = this.time;
45123 this.time += this.intervalInMs;
45124 this.pendingHandles.push(setTimeout(() => {
45125 this.time -= this.intervalInMs;
45130 this.pendingHandles.forEach((timeoutHandle) => {
45131 clearTimeout(timeoutHandle);
45133 this.pendingHandles = [];
45138 // modules/renderer/background_source.js
45139 var isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
45140 window.matchMedia(`
45141 (-webkit-min-device-pixel-ratio: 2), /* Safari */
45142 (min-resolution: 2dppx), /* standard */
45143 (min-resolution: 192dpi) /* fallback */
45144 `).addListener(function() {
45145 isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
45147 function localeDateString(s2) {
45150 var options2 = { day: "numeric", month: "short", year: "numeric" };
45151 var d2 = new Date(s2);
45152 if (isNaN(d2.getTime()))
45154 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
45156 function vintageRange(vintage) {
45158 if (vintage.start || vintage.end) {
45159 s2 = vintage.start || "?";
45160 if (vintage.start !== vintage.end) {
45161 s2 += " - " + (vintage.end || "?");
45166 function rendererBackgroundSource(data) {
45167 var source = Object.assign({}, data);
45168 var _offset = [0, 0];
45169 var _name = source.name;
45170 var _description = source.description;
45171 var _best = !!source.best;
45172 var _template = source.encrypted ? utilAesDecrypt(source.template) : source.template;
45173 source.tileSize = data.tileSize || 256;
45174 source.zoomExtent = data.zoomExtent || [0, 22];
45175 source.overzoom = data.overzoom !== false;
45176 source.offset = function(val) {
45177 if (!arguments.length)
45182 source.nudge = function(val, zoomlevel) {
45183 _offset[0] += val[0] / Math.pow(2, zoomlevel);
45184 _offset[1] += val[1] / Math.pow(2, zoomlevel);
45187 source.name = function() {
45188 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45189 return _t("imagery." + id_safe + ".name", { default: (0, import_lodash4.escape)(_name) });
45191 source.label = function() {
45192 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45193 return _t.append("imagery." + id_safe + ".name", { default: (0, import_lodash4.escape)(_name) });
45195 source.hasDescription = function() {
45196 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45197 var descriptionText = _mainLocalizer.tInfo("imagery." + id_safe + ".description", { default: (0, import_lodash4.escape)(_description) }).text;
45198 return descriptionText !== "";
45200 source.description = function() {
45201 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45202 return _t.append("imagery." + id_safe + ".description", { default: (0, import_lodash4.escape)(_description) });
45204 source.best = function() {
45207 source.area = function() {
45209 return Number.MAX_VALUE;
45210 var area = area_default({ type: "MultiPolygon", coordinates: [data.polygon] });
45211 return isNaN(area) ? 0 : area;
45213 source.imageryUsed = function() {
45214 return _name || source.id;
45216 source.template = function(val) {
45217 if (!arguments.length)
45219 if (source.id === "custom" || source.id === "Bing") {
45224 source.url = function(coord2) {
45225 var result = _template.replace(/#[\s\S]*/u, "");
45228 if (!source.type || source.id === "custom") {
45229 if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(result)) {
45230 source.type = "wms";
45231 source.projection = "EPSG:3857";
45232 } else if (/\{(x|y)\}/.test(result)) {
45233 source.type = "tms";
45234 } else if (/\{u\}/.test(result)) {
45235 source.type = "bing";
45238 if (source.type === "wms") {
45239 var tileToProjectedCoords = function(x2, y2, z2) {
45240 var zoomSize = Math.pow(2, z2);
45241 var lon = x2 / zoomSize * Math.PI * 2 - Math.PI;
45242 var lat = Math.atan(Math.sinh(Math.PI * (1 - 2 * y2 / zoomSize)));
45243 switch (source.projection) {
45246 x: lon * 180 / Math.PI,
45247 y: lat * 180 / Math.PI
45250 var mercCoords = mercatorRaw(lon, lat);
45252 x: 2003750834e-2 / Math.PI * mercCoords[0],
45253 y: 2003750834e-2 / Math.PI * mercCoords[1]
45257 var tileSize = source.tileSize;
45258 var projection2 = source.projection;
45259 var minXmaxY = tileToProjectedCoords(coord2[0], coord2[1], coord2[2]);
45260 var maxXminY = tileToProjectedCoords(coord2[0] + 1, coord2[1] + 1, coord2[2]);
45261 result = result.replace(/\{(\w+)\}/g, function(token, key) {
45267 return projection2;
45269 return projection2.replace(/^EPSG:/, "");
45271 if (projection2 === "EPSG:4326" && // The CRS parameter implies version 1.3 (prior versions use SRS)
45272 /VERSION=1.3|CRS={proj}/.test(source.template().toUpperCase())) {
45273 return maxXminY.y + "," + minXmaxY.x + "," + minXmaxY.y + "," + maxXminY.x;
45275 return minXmaxY.x + "," + maxXminY.y + "," + maxXminY.x + "," + minXmaxY.y;
45289 } else if (source.type === "tms") {
45290 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" : "");
45291 } else if (source.type === "bing") {
45292 result = result.replace("{u}", function() {
45294 for (var zoom = coord2[2]; zoom > 0; zoom--) {
45296 var mask = 1 << zoom - 1;
45297 if ((coord2[0] & mask) !== 0)
45299 if ((coord2[1] & mask) !== 0)
45301 u2 += b2.toString();
45306 result = result.replace(/\{switch:([^}]+)\}/, function(s2, r2) {
45307 var subdomains = r2.split(",");
45308 return subdomains[(coord2[0] + coord2[1]) % subdomains.length];
45312 source.validZoom = function(z2) {
45313 return source.zoomExtent[0] <= z2 && (source.overzoom || source.zoomExtent[1] > z2);
45315 source.isLocatorOverlay = function() {
45316 return source.id === "mapbox_locator_overlay";
45318 source.isHidden = function() {
45319 return source.id === "DigitalGlobe-Premium-vintage" || source.id === "DigitalGlobe-Standard-vintage";
45321 source.copyrightNotices = function() {
45323 source.getMetadata = function(center, tileCoord, callback) {
45325 start: localeDateString(source.startDate),
45326 end: localeDateString(source.endDate)
45328 vintage.range = vintageRange(vintage);
45329 var metadata = { vintage };
45330 callback(null, metadata);
45334 rendererBackgroundSource.Bing = function(data, dispatch14) {
45335 data.template = "https://ecn.t{switch:0,1,2,3}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=1&pr=odbl&n=z";
45336 var bing = rendererBackgroundSource(data);
45337 var key = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
45338 const strictParam = "n";
45339 var url = "https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&uriScheme=https&key=" + key;
45342 var providers = [];
45343 var taskQueue = new IntervalTasksQueue(250);
45344 var metadataLastZoom = -1;
45345 json_default(url).then(function(json) {
45346 let imageryResource = json.resourceSets[0].resources[0];
45347 let template = imageryResource.imageUrl;
45348 let subDomains = imageryResource.imageUrlSubdomains;
45349 let subDomainNumbers = subDomains.map((subDomain) => {
45350 return subDomain.substring(1);
45352 template = template.replace("{subdomain}", `t{switch:${subDomainNumbers}}`).replace("{quadkey}", "{u}");
45353 if (!new URLSearchParams(template).has(strictParam)) {
45354 template += `&${strictParam}=z`;
45356 bing.template(template);
45357 providers = imageryResource.imageryProviders.map(function(provider) {
45359 attribution: provider.attribution,
45360 areas: provider.coverageAreas.map(function(area) {
45362 zoom: [area.zoomMin, area.zoomMax],
45363 extent: geoExtent([area.bbox[1], area.bbox[0]], [area.bbox[3], area.bbox[2]])
45368 dispatch14.call("change");
45369 }).catch(function() {
45371 bing.copyrightNotices = function(zoom, extent) {
45372 zoom = Math.min(zoom, 21);
45373 return providers.filter(function(provider) {
45374 return provider.areas.some(function(area) {
45375 return extent.intersects(area.extent) && area.zoom[0] <= zoom && area.zoom[1] >= zoom;
45377 }).map(function(provider) {
45378 return provider.attribution;
45381 bing.getMetadata = function(center, tileCoord, callback) {
45382 var tileID = tileCoord.slice(0, 3).join("/");
45383 var zoom = Math.min(tileCoord[2], 21);
45384 var centerPoint = center[1] + "," + center[0];
45385 var url2 = "https://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/AerialOSM/" + centerPoint + "?zl=" + zoom + "&key=" + key;
45386 if (inflight[tileID])
45388 if (!cache[tileID]) {
45389 cache[tileID] = {};
45391 if (cache[tileID] && cache[tileID].metadata) {
45392 return callback(null, cache[tileID].metadata);
45394 inflight[tileID] = true;
45395 if (metadataLastZoom !== tileCoord[2]) {
45396 metadataLastZoom = tileCoord[2];
45399 taskQueue.enqueue(() => {
45400 json_default(url2).then(function(result) {
45401 delete inflight[tileID];
45403 throw new Error("Unknown Error");
45406 start: localeDateString(result.resourceSets[0].resources[0].vintageStart),
45407 end: localeDateString(result.resourceSets[0].resources[0].vintageEnd)
45409 vintage.range = vintageRange(vintage);
45410 var metadata = { vintage };
45411 cache[tileID].metadata = metadata;
45413 callback(null, metadata);
45414 }).catch(function(err) {
45415 delete inflight[tileID];
45417 callback(err.message);
45421 bing.terms_url = "https://blog.openstreetmap.org/2010/11/30/microsoft-imagery-details";
45424 rendererBackgroundSource.Esri = function(data) {
45425 if (data.template.match(/blankTile/) === null) {
45426 data.template = data.template + "?blankTile=false";
45428 var esri = rendererBackgroundSource(data);
45432 esri.fetchTilemap = function(center) {
45433 if (_prevCenter && geoSphericalDistance(center, _prevCenter) < 5e3)
45435 _prevCenter = center;
45437 var dummyUrl = esri.url([1, 2, 3]);
45438 var x2 = Math.floor((center[0] + 180) / 360 * Math.pow(2, z2));
45439 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));
45440 var tilemapUrl = dummyUrl.replace(/tile\/[0-9]+\/[0-9]+\/[0-9]+\?blankTile=false/, "tilemap") + "/" + z2 + "/" + y2 + "/" + x2 + "/8/8";
45441 json_default(tilemapUrl).then(function(tilemap) {
45443 throw new Error("Unknown Error");
45445 var hasTiles = true;
45446 for (var i3 = 0; i3 < tilemap.data.length; i3++) {
45447 if (!tilemap.data[i3]) {
45452 esri.zoomExtent[1] = hasTiles ? 22 : 19;
45453 }).catch(function() {
45456 esri.getMetadata = function(center, tileCoord, callback) {
45457 if (esri.id !== "EsriWorldImagery") {
45458 return callback(null, {});
45460 var tileID = tileCoord.slice(0, 3).join("/");
45461 var zoom = Math.min(tileCoord[2], esri.zoomExtent[1]);
45462 var centerPoint = center[0] + "," + center[1];
45463 var unknown = _t("info_panels.background.unknown");
45466 if (inflight[tileID])
45468 var url = "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/4/query";
45469 url += "?returnGeometry=false&geometry=" + centerPoint + "&inSR=4326&geometryType=esriGeometryPoint&outFields=*&f=json";
45470 if (!cache[tileID]) {
45471 cache[tileID] = {};
45473 if (cache[tileID] && cache[tileID].metadata) {
45474 return callback(null, cache[tileID].metadata);
45476 inflight[tileID] = true;
45477 json_default(url).then(function(result) {
45478 delete inflight[tileID];
45479 result = result.features.map((f3) => f3.attributes).filter((a2) => a2.MinMapLevel <= zoom && a2.MaxMapLevel >= zoom)[0];
45481 throw new Error("Unknown Error");
45482 } else if (result.features && result.features.length < 1) {
45483 throw new Error("No Results");
45484 } else if (result.error && result.error.message) {
45485 throw new Error(result.error.message);
45487 var captureDate = localeDateString(result.SRC_DATE2);
45489 start: captureDate,
45495 source: clean2(result.NICE_NAME),
45496 description: clean2(result.NICE_DESC),
45497 resolution: clean2(+Number(result.SRC_RES).toFixed(4)),
45498 accuracy: clean2(+Number(result.SRC_ACC).toFixed(4))
45500 if (isFinite(metadata.resolution)) {
45501 metadata.resolution += " m";
45503 if (isFinite(metadata.accuracy)) {
45504 metadata.accuracy += " m";
45506 cache[tileID].metadata = metadata;
45508 callback(null, metadata);
45509 }).catch(function(err) {
45510 delete inflight[tileID];
45512 callback(err.message);
45514 function clean2(val) {
45515 return String(val).trim() || unknown;
45520 rendererBackgroundSource.None = function() {
45521 var source = rendererBackgroundSource({ id: "none", template: "" });
45522 source.name = function() {
45523 return _t("background.none");
45525 source.label = function() {
45526 return _t.append("background.none");
45528 source.imageryUsed = function() {
45531 source.area = function() {
45536 rendererBackgroundSource.Custom = function(template) {
45537 var source = rendererBackgroundSource({ id: "custom", template });
45538 source.name = function() {
45539 return _t("background.custom");
45541 source.label = function() {
45542 return _t.append("background.custom");
45544 source.imageryUsed = function() {
45545 var cleaned = source.template();
45546 if (cleaned.indexOf("?") !== -1) {
45547 var parts = cleaned.split("?", 2);
45548 var qs = utilStringQs(parts[1]);
45549 ["access_token", "connectId", "token"].forEach(function(param) {
45551 qs[param] = "{apikey}";
45554 cleaned = parts[0] + "?" + utilQsString(qs, true);
45556 cleaned = cleaned.replace(/token\/(\w+)/, "token/{apikey}").replace(/key=(\w+)/, "key={apikey}");
45557 return "Custom (" + cleaned + " )";
45559 source.area = function() {
45565 // node_modules/@turf/helpers/dist/es/index.js
45566 var earthRadius = 63710088e-1;
45568 centimeters: earthRadius * 100,
45569 centimetres: earthRadius * 100,
45570 degrees: earthRadius / 111325,
45571 feet: earthRadius * 3.28084,
45572 inches: earthRadius * 39.37,
45573 kilometers: earthRadius / 1e3,
45574 kilometres: earthRadius / 1e3,
45575 meters: earthRadius,
45576 metres: earthRadius,
45577 miles: earthRadius / 1609.344,
45578 millimeters: earthRadius * 1e3,
45579 millimetres: earthRadius * 1e3,
45580 nauticalmiles: earthRadius / 1852,
45582 yards: earthRadius * 1.0936
45584 var unitsFactors = {
45587 degrees: 1 / 111325,
45590 kilometers: 1 / 1e3,
45591 kilometres: 1 / 1e3,
45594 miles: 1 / 1609.344,
45597 nauticalmiles: 1 / 1852,
45598 radians: 1 / earthRadius,
45601 function feature2(geom, properties, options2) {
45602 if (options2 === void 0) {
45605 var feat = { type: "Feature" };
45606 if (options2.id === 0 || options2.id) {
45607 feat.id = options2.id;
45609 if (options2.bbox) {
45610 feat.bbox = options2.bbox;
45612 feat.properties = properties || {};
45613 feat.geometry = geom;
45616 function polygon(coordinates, properties, options2) {
45617 if (options2 === void 0) {
45620 for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
45621 var ring = coordinates_1[_i];
45622 if (ring.length < 4) {
45623 throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
45625 for (var j3 = 0; j3 < ring[ring.length - 1].length; j3++) {
45626 if (ring[ring.length - 1][j3] !== ring[0][j3]) {
45627 throw new Error("First and last Position are not equivalent.");
45635 return feature2(geom, properties, options2);
45637 function lineString(coordinates, properties, options2) {
45638 if (options2 === void 0) {
45641 if (coordinates.length < 2) {
45642 throw new Error("coordinates must be an array of two or more positions");
45645 type: "LineString",
45648 return feature2(geom, properties, options2);
45650 function multiLineString(coordinates, properties, options2) {
45651 if (options2 === void 0) {
45655 type: "MultiLineString",
45658 return feature2(geom, properties, options2);
45660 function multiPolygon(coordinates, properties, options2) {
45661 if (options2 === void 0) {
45665 type: "MultiPolygon",
45668 return feature2(geom, properties, options2);
45671 // node_modules/@turf/invariant/dist/es/index.js
45672 function getGeom(geojson) {
45673 if (geojson.type === "Feature") {
45674 return geojson.geometry;
45679 // node_modules/@turf/bbox-clip/dist/es/lib/lineclip.js
45680 function lineclip(points, bbox2, result) {
45681 var len = points.length, codeA = bitCode(points[0], bbox2), part = [], i3, codeB, lastCode;
45686 for (i3 = 1; i3 < len; i3++) {
45687 a2 = points[i3 - 1];
45689 codeB = lastCode = bitCode(b2, bbox2);
45691 if (!(codeA | codeB)) {
45693 if (codeB !== lastCode) {
45695 if (i3 < len - 1) {
45699 } else if (i3 === len - 1) {
45703 } else if (codeA & codeB) {
45705 } else if (codeA) {
45706 a2 = intersect(a2, b2, codeA, bbox2);
45707 codeA = bitCode(a2, bbox2);
45709 b2 = intersect(a2, b2, codeB, bbox2);
45710 codeB = bitCode(b2, bbox2);
45719 function polygonclip(points, bbox2) {
45720 var result, edge, prev, prevInside, i3, p2, inside;
45721 for (edge = 1; edge <= 8; edge *= 2) {
45723 prev = points[points.length - 1];
45724 prevInside = !(bitCode(prev, bbox2) & edge);
45725 for (i3 = 0; i3 < points.length; i3++) {
45727 inside = !(bitCode(p2, bbox2) & edge);
45728 if (inside !== prevInside)
45729 result.push(intersect(prev, p2, edge, bbox2));
45733 prevInside = inside;
45736 if (!points.length)
45741 function intersect(a2, b2, edge, bbox2) {
45742 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;
45744 function bitCode(p2, bbox2) {
45746 if (p2[0] < bbox2[0])
45748 else if (p2[0] > bbox2[2])
45750 if (p2[1] < bbox2[1])
45752 else if (p2[1] > bbox2[3])
45757 // node_modules/@turf/bbox-clip/dist/es/index.js
45758 function bboxClip(feature3, bbox2) {
45759 var geom = getGeom(feature3);
45760 var type2 = geom.type;
45761 var properties = feature3.type === "Feature" ? feature3.properties : {};
45762 var coords = geom.coordinates;
45765 case "MultiLineString": {
45767 if (type2 === "LineString") {
45770 coords.forEach(function(line) {
45771 lineclip(line, bbox2, lines_1);
45773 if (lines_1.length === 1) {
45774 return lineString(lines_1[0], properties);
45776 return multiLineString(lines_1, properties);
45779 return polygon(clipPolygon(coords, bbox2), properties);
45780 case "MultiPolygon":
45781 return multiPolygon(coords.map(function(poly) {
45782 return clipPolygon(poly, bbox2);
45785 throw new Error("geometry " + type2 + " not supported");
45788 function clipPolygon(rings, bbox2) {
45790 for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
45791 var ring = rings_1[_i];
45792 var clipped = polygonclip(ring, bbox2);
45793 if (clipped.length > 0) {
45794 if (clipped[0][0] !== clipped[clipped.length - 1][0] || clipped[0][1] !== clipped[clipped.length - 1][1]) {
45795 clipped.push(clipped[0]);
45797 if (clipped.length >= 4) {
45798 outRings.push(clipped);
45805 // node_modules/@turf/meta/dist/es/index.js
45806 function coordEach(geojson, callback, excludeWrapCoord) {
45807 if (geojson === null)
45809 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;
45810 for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
45811 geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
45812 isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
45813 stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
45814 for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
45815 var multiFeatureIndex = 0;
45816 var geometryIndex = 0;
45817 geometry = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
45818 if (geometry === null)
45820 coords = geometry.coordinates;
45821 var geomType = geometry.type;
45822 wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
45823 switch (geomType) {
45836 multiFeatureIndex++;
45840 for (j3 = 0; j3 < coords.length; j3++) {
45850 if (geomType === "MultiPoint")
45851 multiFeatureIndex++;
45853 if (geomType === "LineString")
45854 multiFeatureIndex++;
45857 case "MultiLineString":
45858 for (j3 = 0; j3 < coords.length; j3++) {
45859 for (k2 = 0; k2 < coords[j3].length - wrapShrink; k2++) {
45870 if (geomType === "MultiLineString")
45871 multiFeatureIndex++;
45872 if (geomType === "Polygon")
45875 if (geomType === "Polygon")
45876 multiFeatureIndex++;
45878 case "MultiPolygon":
45879 for (j3 = 0; j3 < coords.length; j3++) {
45881 for (k2 = 0; k2 < coords[j3].length; k2++) {
45882 for (l2 = 0; l2 < coords[j3][k2].length - wrapShrink; l2++) {
45884 coords[j3][k2][l2],
45895 multiFeatureIndex++;
45898 case "GeometryCollection":
45899 for (j3 = 0; j3 < geometry.geometries.length; j3++)
45900 if (coordEach(geometry.geometries[j3], callback, excludeWrapCoord) === false)
45904 throw new Error("Unknown Geometry Type");
45910 // node_modules/@turf/bbox/dist/es/index.js
45911 function bbox(geojson) {
45912 var result = [Infinity, Infinity, -Infinity, -Infinity];
45913 coordEach(geojson, function(coord2) {
45914 if (result[0] > coord2[0]) {
45915 result[0] = coord2[0];
45917 if (result[1] > coord2[1]) {
45918 result[1] = coord2[1];
45920 if (result[2] < coord2[0]) {
45921 result[2] = coord2[0];
45923 if (result[3] < coord2[1]) {
45924 result[3] = coord2[1];
45929 bbox["default"] = bbox;
45930 var es_default = bbox;
45932 // modules/renderer/background.js
45933 var import_which_polygon3 = __toESM(require_which_polygon());
45935 // modules/renderer/tile_layer.js
45936 function rendererTileLayer(context) {
45937 var transformProp = utilPrefixCSSProperty("Transform");
45938 var tiler9 = utilTiler();
45939 var _tileSize = 256;
45945 function tileSizeAtZoom(d2, z2) {
45946 var EPSILON = 2e-3;
45947 return _tileSize * Math.pow(2, z2 - d2[2]) / _tileSize + EPSILON;
45949 function atZoom(t2, distance) {
45950 var power = Math.pow(2, distance);
45952 Math.floor(t2[0] * power),
45953 Math.floor(t2[1] * power),
45957 function lookUp(d2) {
45958 for (var up = -1; up > -d2[2]; up--) {
45959 var tile = atZoom(d2, up);
45960 if (_cache4[_source.url(tile)] !== false) {
45965 function uniqueBy(a2, n3) {
45968 for (var i3 = 0; i3 < a2.length; i3++) {
45969 if (seen[a2[i3][n3]] === void 0) {
45971 seen[a2[i3][n3]] = true;
45976 function addSource(d2) {
45977 d2.push(_source.url(d2));
45980 function background(selection2) {
45981 _zoom = geoScaleToZoom(_projection.scale(), _tileSize);
45985 _source.offset()[0] * Math.pow(2, _zoom),
45986 _source.offset()[1] * Math.pow(2, _zoom)
45989 pixelOffset = [0, 0];
45992 _projection.translate()[0] + pixelOffset[0],
45993 _projection.translate()[1] + pixelOffset[1]
45995 tiler9.scale(_projection.scale() * 2 * Math.PI).translate(translate);
45997 _projection.scale() * Math.PI - translate[0],
45998 _projection.scale() * Math.PI - translate[1]
46000 render(selection2);
46002 function render(selection2) {
46006 var showDebug = context.getDebug("tile") && !_source.overlay;
46007 if (_source.validZoom(_zoom)) {
46008 tiler9.skipNullIsland(!!_source.overlay);
46009 tiler9().forEach(function(d2) {
46013 if (typeof d2[3] !== "string")
46016 if (_cache4[d2[3]] === false && lookUp(d2)) {
46017 requests.push(addSource(lookUp(d2)));
46020 requests = uniqueBy(requests, 3).filter(function(r2) {
46021 return _cache4[r2[3]] !== false;
46024 function load(d3_event, d2) {
46025 _cache4[d2[3]] = true;
46026 select_default2(this).on("error", null).on("load", null).classed("tile-loaded", true);
46027 render(selection2);
46029 function error(d3_event, d2) {
46030 _cache4[d2[3]] = false;
46031 select_default2(this).on("error", null).on("load", null).remove();
46032 render(selection2);
46034 function imageTransform(d2) {
46035 var ts = _tileSize * Math.pow(2, _zoom - d2[2]);
46036 var scale = tileSizeAtZoom(d2, _zoom);
46037 return "translate(" + (d2[0] * ts - _tileOrigin[0]) + "px," + (d2[1] * ts - _tileOrigin[1]) + "px) scale(" + scale + "," + scale + ")";
46039 function tileCenter(d2) {
46040 var ts = _tileSize * Math.pow(2, _zoom - d2[2]);
46042 d2[0] * ts - _tileOrigin[0] + ts / 2,
46043 d2[1] * ts - _tileOrigin[1] + ts / 2
46046 function debugTransform(d2) {
46047 var coord2 = tileCenter(d2);
46048 return "translate(" + coord2[0] + "px," + coord2[1] + "px)";
46050 var dims = tiler9.size();
46051 var mapCenter = [dims[0] / 2, dims[1] / 2];
46052 var minDist = Math.max(dims[0], dims[1]);
46054 requests.forEach(function(d2) {
46055 var c2 = tileCenter(d2);
46056 var dist = geoVecLength(c2, mapCenter);
46057 if (dist < minDist) {
46062 var image = selection2.selectAll("img").data(requests, function(d2) {
46065 image.exit().style(transformProp, imageTransform).classed("tile-removing", true).classed("tile-center", false).each(function() {
46066 var tile = select_default2(this);
46067 window.setTimeout(function() {
46068 if (tile.classed("tile-removing")) {
46073 image.enter().append("img").attr("class", "tile").attr("alt", "").attr("draggable", "false").style("width", _tileSize + "px").style("height", _tileSize + "px").attr("src", function(d2) {
46075 }).on("error", error).on("load", load).merge(image).style(transformProp, imageTransform).classed("tile-debug", showDebug).classed("tile-removing", false).classed("tile-center", function(d2) {
46076 return d2 === nearCenter;
46078 var debug2 = selection2.selectAll(".tile-label-debug").data(showDebug ? requests : [], function(d2) {
46081 debug2.exit().remove();
46083 var debugEnter = debug2.enter().append("div").attr("class", "tile-label-debug");
46084 debugEnter.append("div").attr("class", "tile-label-debug-coord");
46085 debugEnter.append("div").attr("class", "tile-label-debug-vintage");
46086 debug2 = debug2.merge(debugEnter);
46087 debug2.style(transformProp, debugTransform);
46088 debug2.selectAll(".tile-label-debug-coord").text(function(d2) {
46089 return d2[2] + " / " + d2[0] + " / " + d2[1];
46091 debug2.selectAll(".tile-label-debug-vintage").each(function(d2) {
46092 var span = select_default2(this);
46093 var center = context.projection.invert(tileCenter(d2));
46094 _source.getMetadata(center, d2, function(err, result) {
46095 if (result && result.vintage && result.vintage.range) {
46096 span.text(result.vintage.range);
46099 span.call(_t.append("info_panels.background.vintage"));
46100 span.append("span").text(": ");
46101 span.call(_t.append("info_panels.background.unknown"));
46107 background.projection = function(val) {
46108 if (!arguments.length)
46109 return _projection;
46113 background.dimensions = function(val) {
46114 if (!arguments.length)
46115 return tiler9.size();
46119 background.source = function(val) {
46120 if (!arguments.length)
46123 _tileSize = _source.tileSize;
46125 tiler9.tileSize(_source.tileSize).zoomExtent(_source.zoomExtent);
46131 // modules/renderer/background.js
46132 var _imageryIndex = null;
46133 function rendererBackground(context) {
46134 const dispatch14 = dispatch_default("change");
46135 const baseLayer = rendererTileLayer(context).projection(context.projection);
46136 let _checkedBlocklists = [];
46137 let _isValid = true;
46138 let _overlayLayers = [];
46139 let _brightness = 1;
46141 let _saturation = 1;
46142 let _sharpness = 1;
46143 function ensureImageryIndex() {
46144 return _mainFileFetcher.get("imagery").then((sources) => {
46146 return _imageryIndex;
46151 const features = sources.map((source) => {
46152 if (!source.polygon)
46154 const rings = source.polygon.map((ring) => [ring]);
46157 properties: { id: source.id },
46158 geometry: { type: "MultiPolygon", coordinates: rings }
46160 _imageryIndex.features[source.id] = feature3;
46162 }).filter(Boolean);
46163 _imageryIndex.query = (0, import_which_polygon3.default)({ type: "FeatureCollection", features });
46164 _imageryIndex.backgrounds = sources.map((source) => {
46165 if (source.type === "bing") {
46166 return rendererBackgroundSource.Bing(source, dispatch14);
46167 } else if (/^EsriWorldImagery/.test(source.id)) {
46168 return rendererBackgroundSource.Esri(source);
46170 return rendererBackgroundSource(source);
46173 _imageryIndex.backgrounds.unshift(rendererBackgroundSource.None());
46174 let template = corePreferences("background-custom-template") || "";
46175 const custom = rendererBackgroundSource.Custom(template);
46176 _imageryIndex.backgrounds.unshift(custom);
46177 return _imageryIndex;
46180 function background(selection2) {
46181 const currSource = baseLayer.source();
46182 if (context.map().zoom() > 18) {
46183 if (currSource && /^EsriWorldImagery/.test(currSource.id)) {
46184 const center = context.map().center();
46185 currSource.fetchTilemap(center);
46188 const sources = background.sources(context.map().extent());
46189 const wasValid = _isValid;
46190 _isValid = !!sources.filter((d2) => d2 === currSource).length;
46191 if (wasValid !== _isValid) {
46192 background.updateImagery();
46194 let baseFilter = "";
46195 if (_brightness !== 1) {
46196 baseFilter += ` brightness(${_brightness})`;
46198 if (_contrast !== 1) {
46199 baseFilter += ` contrast(${_contrast})`;
46201 if (_saturation !== 1) {
46202 baseFilter += ` saturate(${_saturation})`;
46204 if (_sharpness < 1) {
46205 const blur = number_default(0.5, 5)(1 - _sharpness);
46206 baseFilter += ` blur(${blur}px)`;
46208 let base = selection2.selectAll(".layer-background").data([0]);
46209 base = base.enter().insert("div", ".layer-data").attr("class", "layer layer-background").merge(base);
46210 base.style("filter", baseFilter || null);
46211 let imagery = base.selectAll(".layer-imagery").data([0]);
46212 imagery.enter().append("div").attr("class", "layer layer-imagery").merge(imagery).call(baseLayer);
46213 let maskFilter = "";
46214 let mixBlendMode = "";
46215 if (_sharpness > 1) {
46216 mixBlendMode = "overlay";
46217 maskFilter = "saturate(0) blur(3px) invert(1)";
46218 let contrast = _sharpness - 1;
46219 maskFilter += ` contrast(${contrast})`;
46220 let brightness = number_default(1, 0.85)(_sharpness - 1);
46221 maskFilter += ` brightness(${brightness})`;
46223 let mask = base.selectAll(".layer-unsharp-mask").data(_sharpness > 1 ? [0] : []);
46224 mask.exit().remove();
46225 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);
46226 let overlays = selection2.selectAll(".layer-overlay").data(_overlayLayers, (d2) => d2.source().name());
46227 overlays.exit().remove();
46228 overlays.enter().insert("div", ".layer-data").attr("class", "layer layer-overlay").merge(overlays).each((layer, i3, nodes) => select_default2(nodes[i3]).call(layer));
46230 background.updateImagery = function() {
46231 let currSource = baseLayer.source();
46232 if (context.inIntro() || !currSource)
46234 let o2 = _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).map((d2) => d2.source().id).join(",");
46235 const meters = geoOffsetToMeters(currSource.offset());
46236 const EPSILON = 0.01;
46237 const x2 = +meters[0].toFixed(2);
46238 const y2 = +meters[1].toFixed(2);
46239 let hash = utilStringQs(window.location.hash);
46240 let id2 = currSource.id;
46241 if (id2 === "custom") {
46242 id2 = `custom:${currSource.template()}`;
46245 hash.background = id2;
46247 delete hash.background;
46250 hash.overlays = o2;
46252 delete hash.overlays;
46254 if (Math.abs(x2) > EPSILON || Math.abs(y2) > EPSILON) {
46255 hash.offset = `${x2},${y2}`;
46257 delete hash.offset;
46259 if (!window.mocha) {
46260 window.location.replace("#" + utilQsString(hash, true));
46262 let imageryUsed = [];
46263 let photoOverlaysUsed = [];
46264 const currUsed = currSource.imageryUsed();
46265 if (currUsed && _isValid) {
46266 imageryUsed.push(currUsed);
46268 _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).forEach((d2) => imageryUsed.push(d2.source().imageryUsed()));
46269 const dataLayer = context.layers().layer("data");
46270 if (dataLayer && dataLayer.enabled() && dataLayer.hasData()) {
46271 imageryUsed.push(dataLayer.getSrc());
46273 const photoOverlayLayers = {
46274 streetside: "Bing Streetside",
46275 mapillary: "Mapillary Images",
46276 "mapillary-map-features": "Mapillary Map Features",
46277 "mapillary-signs": "Mapillary Signs",
46278 kartaview: "KartaView Images",
46279 vegbilder: "Norwegian Road Administration Images",
46280 mapilio: "Mapilio Images"
46282 for (let layerID in photoOverlayLayers) {
46283 const layer = context.layers().layer(layerID);
46284 if (layer && layer.enabled()) {
46285 photoOverlaysUsed.push(layerID);
46286 imageryUsed.push(photoOverlayLayers[layerID]);
46289 context.history().imageryUsed(imageryUsed);
46290 context.history().photoOverlaysUsed(photoOverlaysUsed);
46292 background.sources = (extent, zoom, includeCurrent) => {
46293 if (!_imageryIndex)
46296 (_imageryIndex.query.bbox(extent.rectangle(), true) || []).forEach((d2) => visible[d2.id] = true);
46297 const currSource = baseLayer.source();
46298 const osm = context.connection();
46299 const blocklists = osm && osm.imageryBlocklists() || [];
46300 const blocklistChanged = blocklists.length !== _checkedBlocklists.length || blocklists.some((regex, index) => String(regex) !== _checkedBlocklists[index]);
46301 if (blocklistChanged) {
46302 _imageryIndex.backgrounds.forEach((source) => {
46303 source.isBlocked = blocklists.some((regex) => regex.test(source.template()));
46305 _checkedBlocklists = blocklists.map((regex) => String(regex));
46307 return _imageryIndex.backgrounds.filter((source) => {
46308 if (includeCurrent && currSource === source)
46310 if (source.isBlocked)
46312 if (!source.polygon)
46314 if (zoom && zoom < 6)
46316 return visible[source.id];
46319 background.dimensions = (val) => {
46322 baseLayer.dimensions(val);
46323 _overlayLayers.forEach((layer) => layer.dimensions(val));
46325 background.baseLayerSource = function(d2) {
46326 if (!arguments.length)
46327 return baseLayer.source();
46328 const osm = context.connection();
46331 const blocklists = osm.imageryBlocklists();
46332 const template = d2.template();
46336 for (let i3 = 0; i3 < blocklists.length; i3++) {
46337 regex = blocklists[i3];
46338 fail = regex.test(template);
46344 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
46345 fail = regex.test(template);
46347 baseLayer.source(!fail ? d2 : background.findSource("none"));
46348 dispatch14.call("change");
46349 background.updateImagery();
46352 background.findSource = (id2) => {
46353 if (!id2 || !_imageryIndex)
46355 return _imageryIndex.backgrounds.find((d2) => d2.id && d2.id === id2);
46357 background.bing = () => {
46358 background.baseLayerSource(background.findSource("Bing"));
46360 background.showsLayer = (d2) => {
46361 const currSource = baseLayer.source();
46362 if (!d2 || !currSource)
46364 return d2.id === currSource.id || _overlayLayers.some((layer) => d2.id === layer.source().id);
46366 background.overlayLayerSources = () => {
46367 return _overlayLayers.map((layer) => layer.source());
46369 background.toggleOverlayLayer = (d2) => {
46371 for (let i3 = 0; i3 < _overlayLayers.length; i3++) {
46372 layer = _overlayLayers[i3];
46373 if (layer.source() === d2) {
46374 _overlayLayers.splice(i3, 1);
46375 dispatch14.call("change");
46376 background.updateImagery();
46380 layer = rendererTileLayer(context).source(d2).projection(context.projection).dimensions(
46381 baseLayer.dimensions()
46383 _overlayLayers.push(layer);
46384 dispatch14.call("change");
46385 background.updateImagery();
46387 background.nudge = (d2, zoom) => {
46388 const currSource = baseLayer.source();
46390 currSource.nudge(d2, zoom);
46391 dispatch14.call("change");
46392 background.updateImagery();
46396 background.offset = function(d2) {
46397 const currSource = baseLayer.source();
46398 if (!arguments.length) {
46399 return currSource && currSource.offset() || [0, 0];
46402 currSource.offset(d2);
46403 dispatch14.call("change");
46404 background.updateImagery();
46408 background.brightness = function(d2) {
46409 if (!arguments.length)
46410 return _brightness;
46412 if (context.mode())
46413 dispatch14.call("change");
46416 background.contrast = function(d2) {
46417 if (!arguments.length)
46420 if (context.mode())
46421 dispatch14.call("change");
46424 background.saturation = function(d2) {
46425 if (!arguments.length)
46426 return _saturation;
46428 if (context.mode())
46429 dispatch14.call("change");
46432 background.sharpness = function(d2) {
46433 if (!arguments.length)
46436 if (context.mode())
46437 dispatch14.call("change");
46441 background.ensureLoaded = () => {
46443 return _loadPromise;
46444 return _loadPromise = ensureImageryIndex();
46446 background.init = () => {
46447 const loadPromise = background.ensureLoaded();
46448 const hash = utilStringQs(window.location.hash);
46449 const requestedBackground = hash.background || hash.layer;
46450 const lastUsedBackground = corePreferences("background-last-used");
46451 return loadPromise.then((imageryIndex) => {
46452 const extent = context.map().extent();
46453 const validBackgrounds = background.sources(extent).filter((d2) => d2.id !== "none" && d2.id !== "custom");
46454 const first = validBackgrounds.length && validBackgrounds[0];
46455 const isLastUsedValid = !!validBackgrounds.find((d2) => d2.id && d2.id === lastUsedBackground);
46457 if (!requestedBackground && extent) {
46458 const viewArea = extent.area();
46459 best = validBackgrounds.find((s2) => {
46460 if (!s2.best() || s2.overlay)
46462 let bbox2 = es_default(bboxClip(
46463 { type: "MultiPolygon", coordinates: [s2.polygon || [extent.polygon()]] },
46466 let area = geoExtent(bbox2.slice(0, 2), bbox2.slice(2, 4)).area();
46467 return area / viewArea > 0.5;
46470 if (requestedBackground && requestedBackground.indexOf("custom:") === 0) {
46471 const template = requestedBackground.replace(/^custom:/, "");
46472 const custom = background.findSource("custom");
46473 background.baseLayerSource(custom.template(template));
46474 corePreferences("background-custom-template", template);
46476 background.baseLayerSource(
46477 background.findSource(requestedBackground) || best || isLastUsedValid && background.findSource(lastUsedBackground) || background.findSource("Bing") || first || background.findSource("none")
46480 const locator = imageryIndex.backgrounds.find((d2) => d2.overlay && d2.default);
46482 background.toggleOverlayLayer(locator);
46484 const overlays = (hash.overlays || "").split(",");
46485 overlays.forEach((overlay) => {
46486 overlay = background.findSource(overlay);
46488 background.toggleOverlayLayer(overlay);
46492 const gpx2 = context.layers().layer("data");
46494 gpx2.url(hash.gpx, ".gpx");
46498 const offset = hash.offset.replace(/;/g, ",").split(",").map((n3) => !isNaN(n3) && n3);
46499 if (offset.length === 2) {
46500 background.offset(geoMetersToOffset(offset));
46503 }).catch((err) => {
46504 console.error(err);
46507 return utilRebind(background, dispatch14, "on");
46510 // modules/renderer/features.js
46511 function rendererFeatures(context) {
46512 var dispatch14 = dispatch_default("change", "redraw");
46513 var features = utilRebind({}, dispatch14, "on");
46514 var _deferred2 = /* @__PURE__ */ new Set();
46515 var traffic_roads = {
46517 "motorway_link": true,
46519 "trunk_link": true,
46521 "primary_link": true,
46523 "secondary_link": true,
46525 "tertiary_link": true,
46526 "residential": true,
46527 "unclassified": true,
46528 "living_street": true,
46531 var service_roads = {
46544 var _cullFactor = 1;
46550 var _forceVisible = {};
46551 function update() {
46552 if (!window.mocha) {
46553 var hash = utilStringQs(window.location.hash);
46554 var disabled = features.disabled();
46555 if (disabled.length) {
46556 hash.disable_features = disabled.join(",");
46558 delete hash.disable_features;
46560 window.location.replace("#" + utilQsString(hash, true));
46561 corePreferences("disabled-features", disabled.join(","));
46563 _hidden = features.hidden();
46564 dispatch14.call("change");
46565 dispatch14.call("redraw");
46567 function defineRule(k2, filter2, max3) {
46568 var isEnabled = true;
46572 enabled: isEnabled,
46573 // whether the user wants it enabled..
46575 currentMax: max3 || Infinity,
46576 defaultMax: max3 || Infinity,
46577 enable: function() {
46578 this.enabled = true;
46579 this.currentMax = this.defaultMax;
46581 disable: function() {
46582 this.enabled = false;
46583 this.currentMax = 0;
46585 hidden: function() {
46586 return this.count === 0 && !this.enabled || this.count > this.currentMax * _cullFactor;
46588 autoHidden: function() {
46589 return this.hidden() && this.currentMax > 0;
46593 defineRule("points", function isPoint(tags, geometry) {
46594 return geometry === "point";
46596 defineRule("traffic_roads", function isTrafficRoad(tags) {
46597 return traffic_roads[tags.highway];
46599 defineRule("service_roads", function isServiceRoad(tags) {
46600 return service_roads[tags.highway];
46602 defineRule("paths", function isPath(tags) {
46603 return paths[tags.highway];
46605 defineRule("buildings", function isBuilding(tags) {
46606 return !!tags.building && tags.building !== "no" || tags.parking === "multi-storey" || tags.parking === "sheds" || tags.parking === "carports" || tags.parking === "garage_boxes";
46608 defineRule("building_parts", function isBuildingPart(tags) {
46609 return tags["building:part"];
46611 defineRule("indoor", function isIndoor(tags) {
46612 return tags.indoor;
46614 defineRule("landuse", function isLanduse(tags, geometry) {
46615 return geometry === "area" && !_rules.buildings.filter(tags) && !_rules.building_parts.filter(tags) && !_rules.indoor.filter(tags) && !_rules.water.filter(tags) && !_rules.pistes.filter(tags);
46617 defineRule("boundaries", function isBoundary(tags, geometry) {
46618 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);
46620 defineRule("water", function isWater(tags) {
46621 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";
46623 defineRule("rail", function isRail(tags) {
46624 return (!!tags.railway || tags.landuse === "railway") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]);
46626 defineRule("pistes", function isPiste(tags) {
46627 return tags["piste:type"];
46629 defineRule("aerialways", function isPiste(tags) {
46630 return tags.aerialway && tags.aerialway !== "yes" && tags.aerialway !== "station";
46632 defineRule("power", function isPower(tags) {
46633 return !!tags.power;
46635 defineRule("past_future", function isPastFuture(tags) {
46636 if (traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]) {
46639 var strings = Object.keys(tags);
46640 for (var i3 = 0; i3 < strings.length; i3++) {
46641 var s2 = strings[i3];
46642 if (osmLifecyclePrefixes[s2] || osmLifecyclePrefixes[tags[s2]])
46647 defineRule("others", function isOther(tags, geometry) {
46648 return geometry === "line" || geometry === "area";
46650 features.features = function() {
46653 features.keys = function() {
46656 features.enabled = function(k2) {
46657 if (!arguments.length) {
46658 return _keys.filter(function(k3) {
46659 return _rules[k3].enabled;
46662 return _rules[k2] && _rules[k2].enabled;
46664 features.disabled = function(k2) {
46665 if (!arguments.length) {
46666 return _keys.filter(function(k3) {
46667 return !_rules[k3].enabled;
46670 return _rules[k2] && !_rules[k2].enabled;
46672 features.hidden = function(k2) {
46673 if (!arguments.length) {
46674 return _keys.filter(function(k3) {
46675 return _rules[k3].hidden();
46678 return _rules[k2] && _rules[k2].hidden();
46680 features.autoHidden = function(k2) {
46681 if (!arguments.length) {
46682 return _keys.filter(function(k3) {
46683 return _rules[k3].autoHidden();
46686 return _rules[k2] && _rules[k2].autoHidden();
46688 features.enable = function(k2) {
46689 if (_rules[k2] && !_rules[k2].enabled) {
46690 _rules[k2].enable();
46694 features.enableAll = function() {
46695 var didEnable = false;
46696 for (var k2 in _rules) {
46697 if (!_rules[k2].enabled) {
46699 _rules[k2].enable();
46705 features.disable = function(k2) {
46706 if (_rules[k2] && _rules[k2].enabled) {
46707 _rules[k2].disable();
46711 features.disableAll = function() {
46712 var didDisable = false;
46713 for (var k2 in _rules) {
46714 if (_rules[k2].enabled) {
46716 _rules[k2].disable();
46722 features.toggle = function(k2) {
46725 return f3.enabled ? f3.disable() : f3.enable();
46730 features.resetStats = function() {
46731 for (var i3 = 0; i3 < _keys.length; i3++) {
46732 _rules[_keys[i3]].count = 0;
46734 dispatch14.call("change");
46736 features.gatherStats = function(d2, resolver, dimensions) {
46737 var needsRedraw = false;
46738 var types = utilArrayGroupBy(d2, "type");
46739 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
46740 var currHidden, geometry, matches, i3, j3;
46741 for (i3 = 0; i3 < _keys.length; i3++) {
46742 _rules[_keys[i3]].count = 0;
46744 _cullFactor = dimensions[0] * dimensions[1] / 1e6;
46745 for (i3 = 0; i3 < entities.length; i3++) {
46746 geometry = entities[i3].geometry(resolver);
46747 matches = Object.keys(features.getMatches(entities[i3], resolver, geometry));
46748 for (j3 = 0; j3 < matches.length; j3++) {
46749 _rules[matches[j3]].count++;
46752 currHidden = features.hidden();
46753 if (currHidden !== _hidden) {
46754 _hidden = currHidden;
46755 needsRedraw = true;
46756 dispatch14.call("change");
46758 return needsRedraw;
46760 features.stats = function() {
46761 for (var i3 = 0; i3 < _keys.length; i3++) {
46762 _stats[_keys[i3]] = _rules[_keys[i3]].count;
46766 features.clear = function(d2) {
46767 for (var i3 = 0; i3 < d2.length; i3++) {
46768 features.clearEntity(d2[i3]);
46771 features.clearEntity = function(entity) {
46772 delete _cache4[osmEntity.key(entity)];
46774 features.reset = function() {
46775 Array.from(_deferred2).forEach(function(handle) {
46776 window.cancelIdleCallback(handle);
46777 _deferred2.delete(handle);
46781 function relationShouldBeChecked(relation) {
46782 return relation.tags.type === "boundary";
46784 features.getMatches = function(entity, resolver, geometry) {
46785 if (geometry === "vertex" || geometry === "relation" && !relationShouldBeChecked(entity))
46787 var ent = osmEntity.key(entity);
46788 if (!_cache4[ent]) {
46791 if (!_cache4[ent].matches) {
46793 var hasMatch = false;
46794 for (var i3 = 0; i3 < _keys.length; i3++) {
46795 if (_keys[i3] === "others") {
46798 if (entity.type === "way") {
46799 var parents = features.getParents(entity, resolver, geometry);
46800 if (parents.length === 1 && parents[0].isMultipolygon() || // 2b. or belongs only to boundary relations
46801 parents.length > 0 && parents.every(function(parent) {
46802 return parent.tags.type === "boundary";
46804 var pkey = osmEntity.key(parents[0]);
46805 if (_cache4[pkey] && _cache4[pkey].matches) {
46806 matches = Object.assign({}, _cache4[pkey].matches);
46812 if (_rules[_keys[i3]].filter(entity.tags, geometry)) {
46813 matches[_keys[i3]] = hasMatch = true;
46816 _cache4[ent].matches = matches;
46818 return _cache4[ent].matches;
46820 features.getParents = function(entity, resolver, geometry) {
46821 if (geometry === "point")
46823 var ent = osmEntity.key(entity);
46824 if (!_cache4[ent]) {
46827 if (!_cache4[ent].parents) {
46829 if (geometry === "vertex") {
46830 parents = resolver.parentWays(entity);
46832 parents = resolver.parentRelations(entity);
46834 _cache4[ent].parents = parents;
46836 return _cache4[ent].parents;
46838 features.isHiddenPreset = function(preset, geometry) {
46839 if (!_hidden.length)
46843 var test = preset.setTags({}, geometry);
46844 for (var key in _rules) {
46845 if (_rules[key].filter(test, geometry)) {
46846 if (_hidden.indexOf(key) !== -1) {
46854 features.isHiddenFeature = function(entity, resolver, geometry) {
46855 if (!_hidden.length)
46857 if (!entity.version)
46859 if (_forceVisible[entity.id])
46861 var matches = Object.keys(features.getMatches(entity, resolver, geometry));
46862 return matches.length && matches.every(function(k2) {
46863 return features.hidden(k2);
46866 features.isHiddenChild = function(entity, resolver, geometry) {
46867 if (!_hidden.length)
46869 if (!entity.version || geometry === "point")
46871 if (_forceVisible[entity.id])
46873 var parents = features.getParents(entity, resolver, geometry);
46874 if (!parents.length)
46876 for (var i3 = 0; i3 < parents.length; i3++) {
46877 if (!features.isHidden(parents[i3], resolver, parents[i3].geometry(resolver))) {
46883 features.hasHiddenConnections = function(entity, resolver) {
46884 if (!_hidden.length)
46886 var childNodes, connections;
46887 if (entity.type === "midpoint") {
46888 childNodes = [resolver.entity(entity.edge[0]), resolver.entity(entity.edge[1])];
46891 childNodes = entity.nodes ? resolver.childNodes(entity) : [];
46892 connections = features.getParents(entity, resolver, entity.geometry(resolver));
46894 connections = childNodes.reduce(function(result, e3) {
46895 return resolver.isShared(e3) ? utilArrayUnion(result, resolver.parentWays(e3)) : result;
46897 return connections.some(function(e3) {
46898 return features.isHidden(e3, resolver, e3.geometry(resolver));
46901 features.isHidden = function(entity, resolver, geometry) {
46902 if (!_hidden.length)
46904 if (!entity.version)
46906 var fn = geometry === "vertex" ? features.isHiddenChild : features.isHiddenFeature;
46907 return fn(entity, resolver, geometry);
46909 features.filter = function(d2, resolver) {
46910 if (!_hidden.length)
46913 for (var i3 = 0; i3 < d2.length; i3++) {
46914 var entity = d2[i3];
46915 if (!features.isHidden(entity, resolver, entity.geometry(resolver))) {
46916 result.push(entity);
46921 features.forceVisible = function(entityIDs) {
46922 if (!arguments.length)
46923 return Object.keys(_forceVisible);
46924 _forceVisible = {};
46925 for (var i3 = 0; i3 < entityIDs.length; i3++) {
46926 _forceVisible[entityIDs[i3]] = true;
46927 var entity = context.hasEntity(entityIDs[i3]);
46928 if (entity && entity.type === "relation") {
46929 for (var j3 in entity.members) {
46930 _forceVisible[entity.members[j3].id] = true;
46936 features.init = function() {
46937 var storage = corePreferences("disabled-features");
46939 var storageDisabled = storage.replace(/;/g, ",").split(",");
46940 storageDisabled.forEach(features.disable);
46942 var hash = utilStringQs(window.location.hash);
46943 if (hash.disable_features) {
46944 var hashDisabled = hash.disable_features.replace(/;/g, ",").split(",");
46945 hashDisabled.forEach(features.disable);
46948 context.history().on("merge.features", function(newEntities) {
46951 var handle = window.requestIdleCallback(function() {
46952 var graph = context.graph();
46953 var types = utilArrayGroupBy(newEntities, "type");
46954 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
46955 for (var i3 = 0; i3 < entities.length; i3++) {
46956 var geometry = entities[i3].geometry(graph);
46957 features.getMatches(entities[i3], graph, geometry);
46960 _deferred2.add(handle);
46965 // modules/svg/areas.js
46966 var import_fast_deep_equal5 = __toESM(require_fast_deep_equal());
46968 // modules/svg/helpers.js
46969 function svgPassiveVertex(node, graph, activeID) {
46972 if (activeID === node.id)
46974 var parents = graph.parentWays(node);
46975 var i3, j3, nodes, isClosed, ix1, ix2, ix3, ix4, max3;
46976 for (i3 = 0; i3 < parents.length; i3++) {
46977 nodes = parents[i3].nodes;
46978 isClosed = parents[i3].isClosed();
46979 for (j3 = 0; j3 < nodes.length; j3++) {
46980 if (nodes[j3] === node.id) {
46986 max3 = nodes.length - 1;
46996 if (nodes[ix1] === activeID)
46998 else if (nodes[ix2] === activeID)
47000 else if (nodes[ix3] === activeID)
47002 else if (nodes[ix4] === activeID)
47004 else if (isClosed && nodes.indexOf(activeID) !== -1)
47011 function svgMarkerSegments(projection2, graph, dt2, shouldReverse, bothDirections) {
47012 return function(entity) {
47016 var clip = identity_default2().clipExtent(projection2.clipExtent()).stream;
47017 var coordinates = graph.childNodes(entity).map(function(n3) {
47021 if (shouldReverse(entity)) {
47022 coordinates.reverse();
47025 type: "LineString",
47027 }, projection2.stream(clip({
47028 lineStart: function() {
47030 lineEnd: function() {
47033 point: function(x2, y2) {
47036 var span = geoVecLength(a2, b2) - offset;
47038 var heading = geoVecAngle(a2, b2);
47039 var dx = dt2 * Math.cos(heading);
47040 var dy = dt2 * Math.sin(heading);
47042 a2[0] + offset * Math.cos(heading),
47043 a2[1] + offset * Math.sin(heading)
47045 var coord2 = [a2, p2];
47046 for (span -= dt2; span >= 0; span -= dt2) {
47047 p2 = geoVecAdd(p2, [dx, dy]);
47053 for (j3 = 0; j3 < coord2.length; j3++) {
47054 segment += (j3 === 0 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
47056 segments.push({ id: entity.id, index: i3++, d: segment });
47057 if (bothDirections(entity)) {
47059 for (j3 = coord2.length - 1; j3 >= 0; j3--) {
47060 segment += (j3 === coord2.length - 1 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
47062 segments.push({ id: entity.id, index: i3++, d: segment });
47073 function svgPath(projection2, graph, isArea) {
47075 var padding = isArea ? 65 : 5;
47076 var viewport = projection2.clipExtent();
47077 var paddedExtent = [
47078 [viewport[0][0] - padding, viewport[0][1] - padding],
47079 [viewport[1][0] + padding, viewport[1][1] + padding]
47081 var clip = identity_default2().clipExtent(paddedExtent).stream;
47082 var project = projection2.stream;
47083 var path = path_default().projection({ stream: function(output) {
47084 return project(clip(output));
47086 var svgpath = function(entity) {
47087 if (entity.id in cache) {
47088 return cache[entity.id];
47090 return cache[entity.id] = path(entity.asGeoJSON(graph));
47093 svgpath.geojson = function(d2) {
47094 if (d2.__featurehash__ !== void 0) {
47095 if (d2.__featurehash__ in cache) {
47096 return cache[d2.__featurehash__];
47098 return cache[d2.__featurehash__] = path(d2);
47106 function svgPointTransform(projection2) {
47107 var svgpoint = function(entity) {
47108 var pt2 = projection2(entity.loc);
47109 return "translate(" + pt2[0] + "," + pt2[1] + ")";
47111 svgpoint.geojson = function(d2) {
47112 return svgpoint(d2.properties.entity);
47116 function svgRelationMemberTags(graph) {
47117 return function(entity) {
47118 var tags = entity.tags;
47119 var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
47120 graph.parentRelations(entity).forEach(function(relation) {
47121 var type2 = relation.tags.type;
47122 if (type2 === "multipolygon" && shouldCopyMultipolygonTags || type2 === "boundary") {
47123 tags = Object.assign({}, relation.tags, tags);
47129 function svgSegmentWay(way, graph, activeID) {
47130 if (activeID === void 0) {
47131 return graph.transient(way, "waySegments", getWaySegments);
47133 return getWaySegments();
47135 function getWaySegments() {
47136 var isActiveWay = way.nodes.indexOf(activeID) !== -1;
47137 var features = { passive: [], active: [] };
47141 for (var i3 = 0; i3 < way.nodes.length; i3++) {
47142 node = graph.entity(way.nodes[i3]);
47143 type2 = svgPassiveVertex(node, graph, activeID);
47144 end = { node, type: type2 };
47145 if (start2.type !== void 0) {
47146 if (start2.node.id === activeID || end.node.id === activeID) {
47147 } else if (isActiveWay && (start2.type === 2 || end.type === 2)) {
47148 pushActive(start2, end, i3);
47149 } else if (start2.type === 0 && end.type === 0) {
47150 pushActive(start2, end, i3);
47152 pushPassive(start2, end, i3);
47158 function pushActive(start3, end2, index) {
47159 features.active.push({
47161 id: way.id + "-" + index + "-nope",
47166 nodes: [start3.node, end2.node],
47170 type: "LineString",
47171 coordinates: [start3.node.loc, end2.node.loc]
47175 function pushPassive(start3, end2, index) {
47176 features.passive.push({
47178 id: way.id + "-" + index,
47182 nodes: [start3.node, end2.node],
47186 type: "LineString",
47187 coordinates: [start3.node.loc, end2.node.loc]
47194 // modules/svg/tag_classes.js
47195 function svgTagClasses() {
47218 var statuses = Object.keys(osmLifecyclePrefixes);
47219 var secondaries = [
47232 "public_transport",
47243 var _tags = function(entity) {
47244 return entity.tags;
47246 var tagClasses = function(selection2) {
47247 selection2.each(function tagClassesEach(entity) {
47248 var value = this.className;
47249 if (value.baseVal !== void 0) {
47250 value = value.baseVal;
47252 var t2 = _tags(entity);
47253 var computed = tagClasses.getClassesString(t2, value);
47254 if (computed !== value) {
47255 select_default2(this).attr("class", computed);
47259 tagClasses.getClassesString = function(t2, value) {
47260 var primary, status;
47261 var i3, j3, k2, v2;
47262 var overrideGeometry;
47263 if (/\bstroke\b/.test(value)) {
47264 if (!!t2.barrier && t2.barrier !== "no") {
47265 overrideGeometry = "line";
47268 var classes = value.trim().split(/\s+/).filter(function(klass) {
47269 return klass.length && !/^tag-/.test(klass);
47270 }).map(function(klass) {
47271 return klass === "line" || klass === "area" ? overrideGeometry || klass : klass;
47273 for (i3 = 0; i3 < primaries.length; i3++) {
47274 k2 = primaries[i3];
47276 if (!v2 || v2 === "no")
47278 if (k2 === "piste:type") {
47280 } else if (k2 === "building:part") {
47281 k2 = "building_part";
47284 if (statuses.indexOf(v2) !== -1) {
47286 classes.push("tag-" + k2);
47288 classes.push("tag-" + k2);
47289 classes.push("tag-" + k2 + "-" + v2);
47294 for (i3 = 0; i3 < statuses.length; i3++) {
47295 for (j3 = 0; j3 < primaries.length; j3++) {
47296 k2 = statuses[i3] + ":" + primaries[j3];
47298 if (!v2 || v2 === "no")
47300 status = statuses[i3];
47306 for (i3 = 0; i3 < statuses.length; i3++) {
47309 if (!v2 || v2 === "no")
47311 if (v2 === "yes") {
47313 } else if (primary && primary === v2) {
47315 } else if (!primary && primaries.indexOf(v2) !== -1) {
47318 classes.push("tag-" + v2);
47325 classes.push("tag-status");
47326 classes.push("tag-status-" + status);
47328 for (i3 = 0; i3 < secondaries.length; i3++) {
47329 k2 = secondaries[i3];
47331 if (!v2 || v2 === "no" || k2 === primary)
47333 classes.push("tag-" + k2);
47334 classes.push("tag-" + k2 + "-" + v2);
47336 if (primary === "highway" && !osmPathHighwayTagValues[t2.highway] || primary === "aeroway") {
47337 var surface = t2.highway === "track" ? "unpaved" : "paved";
47340 if (k2 in osmPavedTags) {
47341 surface = osmPavedTags[k2][v2] ? "paved" : "unpaved";
47343 if (k2 in osmSemipavedTags && !!osmSemipavedTags[k2][v2]) {
47344 surface = "semipaved";
47347 classes.push("tag-" + surface);
47349 var qid = t2.wikidata || t2["flag:wikidata"] || t2["brand:wikidata"] || t2["network:wikidata"] || t2["operator:wikidata"];
47351 classes.push("tag-wikidata");
47353 return classes.filter((klass) => /^[-_a-z0-9]+$/.test(klass)).join(" ").trim();
47355 tagClasses.tags = function(val) {
47356 if (!arguments.length)
47364 // modules/svg/tag_pattern.js
47366 // tag - pattern name
47368 // tag - value - pattern name
47370 // tag - value - rules (optional tag-values, pattern name)
47371 // (matches earlier rules first, so fallback should be last entry)
47373 grave_yard: "cemetery",
47374 fountain: "water_standing"
47378 { religion: "christian", pattern: "cemetery_christian" },
47379 { religion: "buddhist", pattern: "cemetery_buddhist" },
47380 { religion: "muslim", pattern: "cemetery_muslim" },
47381 { religion: "jewish", pattern: "cemetery_jewish" },
47382 { pattern: "cemetery" }
47384 construction: "construction",
47385 farmland: "farmland",
47386 farmyard: "farmyard",
47388 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
47389 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
47390 { leaf_type: "leafless", pattern: "forest_leafless" },
47391 { pattern: "forest" }
47392 // same as 'leaf_type:mixed'
47394 grave_yard: "cemetery",
47396 landfill: "landfill",
47398 military: "construction",
47399 orchard: "orchard",
47401 vineyard: "vineyard"
47404 horse_riding: "farmyard"
47408 grassland: "grass",
47412 { water: "pond", pattern: "pond" },
47413 { water: "reservoir", pattern: "water_standing" },
47414 { pattern: "waves" }
47417 { wetland: "marsh", pattern: "wetland_marsh" },
47418 { wetland: "swamp", pattern: "wetland_swamp" },
47419 { wetland: "bog", pattern: "wetland_bog" },
47420 { wetland: "reedbed", pattern: "wetland_reedbed" },
47421 { pattern: "wetland" }
47424 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
47425 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
47426 { leaf_type: "leafless", pattern: "forest_leafless" },
47427 { pattern: "forest" }
47428 // same as 'leaf_type:mixed'
47432 green: "golf_green",
47442 function svgTagPattern(tags) {
47443 if (tags.building && tags.building !== "no") {
47446 for (var tag in patterns) {
47447 var entityValue = tags[tag];
47450 if (typeof patterns[tag] === "string") {
47451 return "pattern-" + patterns[tag];
47453 var values = patterns[tag];
47454 for (var value in values) {
47455 if (entityValue !== value)
47457 var rules = values[value];
47458 if (typeof rules === "string") {
47459 return "pattern-" + rules;
47461 for (var ruleKey in rules) {
47462 var rule = rules[ruleKey];
47464 for (var criterion in rule) {
47465 if (criterion !== "pattern") {
47466 var v2 = tags[criterion];
47467 if (!v2 || v2 !== rule[criterion]) {
47474 return "pattern-" + rule.pattern;
47483 // modules/svg/areas.js
47484 function svgAreas(projection2, context) {
47485 function getPatternStyle(tags) {
47486 var imageID = svgTagPattern(tags);
47488 return 'url("#ideditor-' + imageID + '")';
47492 function drawTargets(selection2, graph, entities, filter2) {
47493 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
47494 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
47495 var getPath = svgPath(projection2).geojson;
47496 var activeID = context.activeID();
47497 var base = context.history().base();
47498 var data = { targets: [], nopes: [] };
47499 entities.forEach(function(way) {
47500 var features = svgSegmentWay(way, graph, activeID);
47501 data.targets.push.apply(data.targets, features.passive);
47502 data.nopes.push.apply(data.nopes, features.active);
47504 var targetData = data.targets.filter(getPath);
47505 var targets = selection2.selectAll(".area.target-allowed").filter(function(d2) {
47506 return filter2(d2.properties.entity);
47507 }).data(targetData, function key(d2) {
47510 targets.exit().remove();
47511 var segmentWasEdited = function(d2) {
47512 var wayID = d2.properties.entity.id;
47513 if (!base.entities[wayID] || !(0, import_fast_deep_equal5.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
47516 return d2.properties.nodes.some(function(n3) {
47517 return !base.entities[n3.id] || !(0, import_fast_deep_equal5.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
47520 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
47521 return "way area target target-allowed " + targetClass + d2.id;
47522 }).classed("segment-edited", segmentWasEdited);
47523 var nopeData = data.nopes.filter(getPath);
47524 var nopes = selection2.selectAll(".area.target-nope").filter(function(d2) {
47525 return filter2(d2.properties.entity);
47526 }).data(nopeData, function key(d2) {
47529 nopes.exit().remove();
47530 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
47531 return "way area target target-nope " + nopeClass + d2.id;
47532 }).classed("segment-edited", segmentWasEdited);
47534 function drawAreas(selection2, graph, entities, filter2) {
47535 var path = svgPath(projection2, graph, true);
47538 var base = context.history().base();
47539 for (var i3 = 0; i3 < entities.length; i3++) {
47540 var entity = entities[i3];
47541 if (entity.geometry(graph) !== "area")
47543 multipolygon = osmIsOldMultipolygonOuterMember(entity, graph);
47544 if (multipolygon) {
47545 areas[multipolygon.id] = {
47546 entity: multipolygon.mergeTags(entity.tags),
47547 area: Math.abs(entity.area(graph))
47549 } else if (!areas[entity.id]) {
47550 areas[entity.id] = {
47552 area: Math.abs(entity.area(graph))
47556 var fills = Object.values(areas).filter(function hasPath(a2) {
47557 return path(a2.entity);
47559 fills.sort(function areaSort(a2, b2) {
47560 return b2.area - a2.area;
47562 fills = fills.map(function(a2) {
47565 var strokes = fills.filter(function(area) {
47566 return area.type === "way";
47574 var clipPaths = context.surface().selectAll("defs").selectAll(".clipPath-osm").filter(filter2).data(data.clip, osmEntity.key);
47575 clipPaths.exit().remove();
47576 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-osm").attr("id", function(entity2) {
47577 return "ideditor-" + entity2.id + "-clippath";
47579 clipPathsEnter.append("path");
47580 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", path);
47581 var drawLayer = selection2.selectAll(".layer-osm.areas");
47582 var touchLayer = selection2.selectAll(".layer-touch.areas");
47583 var areagroup = drawLayer.selectAll("g.areagroup").data(["fill", "shadow", "stroke"]);
47584 areagroup = areagroup.enter().append("g").attr("class", function(d2) {
47585 return "areagroup area-" + d2;
47586 }).merge(areagroup);
47587 var paths = areagroup.selectAll("path").filter(filter2).data(function(layer) {
47588 return data[layer];
47590 paths.exit().remove();
47591 var fillpaths = selection2.selectAll(".area-fill path.area").nodes();
47592 var bisect = bisector(function(node) {
47593 return -node.__data__.area(graph);
47595 function sortedByArea(entity2) {
47596 if (this._parent.__data__ === "fill") {
47597 return fillpaths[bisect(fillpaths, -entity2.area(graph))];
47600 paths = paths.enter().insert("path", sortedByArea).merge(paths).each(function(entity2) {
47601 var layer = this.parentNode.__data__;
47602 this.setAttribute("class", entity2.type + " area " + layer + " " + entity2.id);
47603 if (layer === "fill") {
47604 this.setAttribute("clip-path", "url(#ideditor-" + entity2.id + "-clippath)");
47605 this.style.fill = this.style.stroke = getPatternStyle(entity2.tags);
47607 }).classed("added", function(d2) {
47608 return !base.entities[d2.id];
47609 }).classed("geometry-edited", function(d2) {
47610 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);
47611 }).classed("retagged", function(d2) {
47612 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);
47613 }).call(svgTagClasses()).attr("d", path);
47614 touchLayer.call(drawTargets, graph, data.stroke, filter2);
47619 // modules/svg/data.js
47620 var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify());
47622 // node_modules/@tmcw/togeojson/dist/togeojson.es.mjs
47623 function $(element, tagName) {
47624 return Array.from(element.getElementsByTagName(tagName));
47626 function normalizeId(id2) {
47627 return id2[0] === "#" ? id2 : `#${id2}`;
47629 function $ns(element, tagName, ns) {
47630 return Array.from(element.getElementsByTagNameNS(ns, tagName));
47632 function nodeVal(node) {
47634 return node && node.textContent || "";
47636 function get1(node, tagName, callback) {
47637 const n3 = node.getElementsByTagName(tagName);
47638 const result = n3.length ? n3[0] : null;
47639 if (result && callback)
47643 function get3(node, tagName, callback) {
47644 const properties = {};
47647 const n3 = node.getElementsByTagName(tagName);
47648 const result = n3.length ? n3[0] : null;
47649 if (result && callback) {
47650 return callback(result, properties);
47654 function val1(node, tagName, callback) {
47655 const val = nodeVal(get1(node, tagName));
47656 if (val && callback)
47657 return callback(val) || {};
47660 function $num(node, tagName, callback) {
47661 const val = parseFloat(nodeVal(get1(node, tagName)));
47664 if (val && callback)
47665 return callback(val) || {};
47668 function num1(node, tagName, callback) {
47669 const val = parseFloat(nodeVal(get1(node, tagName)));
47676 function getMulti(node, propertyNames) {
47677 const properties = {};
47678 for (const property of propertyNames) {
47679 val1(node, property, (val) => {
47680 properties[property] = val;
47685 function isElement(node) {
47686 return node?.nodeType === 1;
47688 function getLineStyle(node) {
47689 return get3(node, "line", (lineStyle) => {
47690 const val = Object.assign({}, val1(lineStyle, "color", (color2) => {
47691 return { stroke: `#${color2}` };
47692 }), $num(lineStyle, "opacity", (opacity) => {
47693 return { "stroke-opacity": opacity };
47694 }), $num(lineStyle, "width", (width) => {
47695 return { "stroke-width": width * 96 / 25.4 };
47700 function getExtensions(node) {
47704 for (const child of Array.from(node.childNodes)) {
47705 if (!isElement(child))
47707 const name = abbreviateName(child.nodeName);
47708 if (name === "gpxtpx:TrackPointExtension") {
47709 values = values.concat(getExtensions(child));
47711 const val = nodeVal(child);
47712 values.push([name, parseNumeric(val)]);
47717 function abbreviateName(name) {
47718 return ["heart", "gpxtpx:hr", "hr"].includes(name) ? "heart" : name;
47720 function parseNumeric(val) {
47721 const num = parseFloat(val);
47722 return isNaN(num) ? val : num;
47724 function coordPair$1(node) {
47726 parseFloat(node.getAttribute("lon") || ""),
47727 parseFloat(node.getAttribute("lat") || "")
47729 if (isNaN(ll[0]) || isNaN(ll[1])) {
47732 num1(node, "ele", (val) => {
47735 const time = get1(node, "time");
47738 time: time ? nodeVal(time) : null,
47739 extendedValues: getExtensions(get1(node, "extensions"))
47742 function extractProperties(node) {
47743 const properties = getMulti(node, [
47751 const extensions = Array.from(node.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3", "*"));
47752 for (const child of extensions) {
47753 if (child.parentNode?.parentNode === node) {
47754 properties[child.tagName.replace(":", "_")] = nodeVal(child);
47757 const links = $(node, "link");
47758 if (links.length) {
47759 properties.links = links.map((link2) => Object.assign({ href: link2.getAttribute("href") }, getMulti(link2, ["text", "type"])));
47763 function getPoints$1(node, pointname) {
47764 const pts = $(node, pointname);
47767 const extendedValues = {};
47768 for (let i3 = 0; i3 < pts.length; i3++) {
47769 const c2 = coordPair$1(pts[i3]);
47773 line.push(c2.coordinates);
47775 times.push(c2.time);
47776 for (const [name, val] of c2.extendedValues) {
47777 const plural = name === "heart" ? name : name.replace("gpxtpx:", "") + "s";
47778 if (!extendedValues[plural]) {
47779 extendedValues[plural] = Array(pts.length).fill(null);
47781 extendedValues[plural][i3] = val;
47784 if (line.length < 2)
47792 function getRoute(node) {
47793 const line = getPoints$1(node, "rtept");
47798 properties: Object.assign({ _gpxType: "rte" }, extractProperties(node), getLineStyle(get1(node, "extensions"))),
47800 type: "LineString",
47801 coordinates: line.line
47805 function getTrack(node) {
47806 const segments = $(node, "trkseg");
47809 const extractedLines = [];
47810 for (const segment of segments) {
47811 const line = getPoints$1(segment, "trkpt");
47813 extractedLines.push(line);
47814 if (line.times && line.times.length)
47815 times.push(line.times);
47818 if (extractedLines.length === 0)
47820 const multi = extractedLines.length > 1;
47821 const properties = Object.assign({ _gpxType: "trk" }, extractProperties(node), getLineStyle(get1(node, "extensions")), times.length ? {
47822 coordinateProperties: {
47823 times: multi ? times : times[0]
47826 for (const line of extractedLines) {
47827 track.push(line.line);
47828 if (!properties.coordinateProperties) {
47829 properties.coordinateProperties = {};
47831 const props = properties.coordinateProperties;
47832 const entries = Object.entries(line.extendedValues);
47833 for (let i3 = 0; i3 < entries.length; i3++) {
47834 const [name, val] = entries[i3];
47836 if (!props[name]) {
47837 props[name] = extractedLines.map((line2) => new Array(line2.line.length).fill(null));
47839 props[name][i3] = val;
47848 geometry: multi ? {
47849 type: "MultiLineString",
47852 type: "LineString",
47853 coordinates: track[0]
47857 function getPoint(node) {
47858 const properties = Object.assign(extractProperties(node), getMulti(node, ["sym"]));
47859 const pair3 = coordPair$1(node);
47867 coordinates: pair3.coordinates
47871 function* gpxGen(node) {
47872 for (const track of $(node, "trk")) {
47873 const feature3 = getTrack(track);
47877 for (const route of $(node, "rte")) {
47878 const feature3 = getRoute(route);
47882 for (const waypoint of $(node, "wpt")) {
47883 const point2 = getPoint(waypoint);
47888 function gpx(node) {
47890 type: "FeatureCollection",
47891 features: Array.from(gpxGen(node))
47894 function fixColor(v2, prefix) {
47895 const properties = {};
47896 const colorProp = prefix == "stroke" || prefix === "fill" ? prefix : prefix + "-color";
47897 if (v2[0] === "#") {
47898 v2 = v2.substring(1);
47900 if (v2.length === 6 || v2.length === 3) {
47901 properties[colorProp] = "#" + v2;
47902 } else if (v2.length === 8) {
47903 properties[prefix + "-opacity"] = parseInt(v2.substring(0, 2), 16) / 255;
47904 properties[colorProp] = "#" + v2.substring(6, 8) + v2.substring(4, 6) + v2.substring(2, 4);
47908 function numericProperty(node, source, target) {
47909 const properties = {};
47910 num1(node, source, (val) => {
47911 properties[target] = val;
47915 function getColor(node, output) {
47916 return get3(node, "color", (elem) => fixColor(nodeVal(elem), output));
47918 function extractIconHref(node) {
47919 return get3(node, "Icon", (icon2, properties) => {
47920 val1(icon2, "href", (href) => {
47921 properties.icon = href;
47926 function extractIcon(node) {
47927 return get3(node, "IconStyle", (iconStyle) => {
47928 return Object.assign(getColor(iconStyle, "icon"), numericProperty(iconStyle, "scale", "icon-scale"), numericProperty(iconStyle, "heading", "icon-heading"), get3(iconStyle, "hotSpot", (hotspot) => {
47929 const left = parseFloat(hotspot.getAttribute("x") || "");
47930 const top = parseFloat(hotspot.getAttribute("y") || "");
47931 const xunits = hotspot.getAttribute("xunits") || "";
47932 const yunits = hotspot.getAttribute("yunits") || "";
47933 if (!isNaN(left) && !isNaN(top))
47935 "icon-offset": [left, top],
47936 "icon-offset-units": [xunits, yunits]
47939 }), extractIconHref(iconStyle));
47942 function extractLabel(node) {
47943 return get3(node, "LabelStyle", (labelStyle) => {
47944 return Object.assign(getColor(labelStyle, "label"), numericProperty(labelStyle, "scale", "label-scale"));
47947 function extractLine(node) {
47948 return get3(node, "LineStyle", (lineStyle) => {
47949 return Object.assign(getColor(lineStyle, "stroke"), numericProperty(lineStyle, "width", "stroke-width"));
47952 function extractPoly(node) {
47953 return get3(node, "PolyStyle", (polyStyle, properties) => {
47954 return Object.assign(properties, get3(polyStyle, "color", (elem) => fixColor(nodeVal(elem), "fill")), val1(polyStyle, "fill", (fill) => {
47956 return { "fill-opacity": 0 };
47957 }), val1(polyStyle, "outline", (outline) => {
47958 if (outline === "0")
47959 return { "stroke-opacity": 0 };
47963 function extractStyle(node) {
47964 return Object.assign({}, extractPoly(node), extractLine(node), extractLabel(node), extractIcon(node));
47966 var toNumber2 = (x2) => Number(x2);
47967 var typeConverters = {
47968 string: (x2) => x2,
47975 bool: (x2) => Boolean(x2)
47977 function extractExtendedData(node, schema) {
47978 return get3(node, "ExtendedData", (extendedData, properties) => {
47979 for (const data of $(extendedData, "Data")) {
47980 properties[data.getAttribute("name") || ""] = nodeVal(get1(data, "value"));
47982 for (const simpleData of $(extendedData, "SimpleData")) {
47983 const name = simpleData.getAttribute("name") || "";
47984 const typeConverter = schema[name] || typeConverters.string;
47985 properties[name] = typeConverter(nodeVal(simpleData));
47990 function getMaybeHTMLDescription(node) {
47991 const descriptionNode = get1(node, "description");
47992 for (const c2 of Array.from(descriptionNode?.childNodes || [])) {
47993 if (c2.nodeType === 4) {
48004 function extractTimeSpan(node) {
48005 return get3(node, "TimeSpan", (timeSpan) => {
48008 begin: nodeVal(get1(timeSpan, "begin")),
48009 end: nodeVal(get1(timeSpan, "end"))
48014 function extractTimeStamp(node) {
48015 return get3(node, "TimeStamp", (timeStamp) => {
48016 return { timestamp: nodeVal(get1(timeStamp, "when")) };
48019 function extractCascadedStyle(node, styleMap) {
48020 return val1(node, "styleUrl", (styleUrl) => {
48021 styleUrl = normalizeId(styleUrl);
48022 if (styleMap[styleUrl]) {
48023 return Object.assign({ styleUrl }, styleMap[styleUrl]);
48025 return { styleUrl };
48028 var removeSpace = /\s*/g;
48029 var trimSpace = /^\s*|\s*$/g;
48030 var splitSpace = /\s+/;
48031 function coord1(value) {
48032 return value.replace(removeSpace, "").split(",").map(parseFloat).filter((num) => !isNaN(num)).slice(0, 3);
48034 function coord(value) {
48035 return value.replace(trimSpace, "").split(splitSpace).map(coord1).filter((coord2) => {
48036 return coord2.length >= 2;
48039 function gxCoords(node) {
48040 let elems = $(node, "coord");
48041 if (elems.length === 0) {
48042 elems = $ns(node, "coord", "*");
48044 const coordinates = elems.map((elem) => {
48045 return nodeVal(elem).split(" ").map(parseFloat);
48047 if (coordinates.length === 0) {
48051 geometry: coordinates.length > 2 ? {
48052 type: "LineString",
48056 coordinates: coordinates[0]
48058 times: $(node, "when").map((elem) => nodeVal(elem))
48061 function fixRing(ring) {
48062 if (ring.length === 0)
48064 const first = ring[0];
48065 const last = ring[ring.length - 1];
48067 for (let i3 = 0; i3 < Math.max(first.length, last.length); i3++) {
48068 if (first[i3] !== last[i3]) {
48074 return ring.concat([ring[0]]);
48078 function getCoordinates(node) {
48079 return nodeVal(get1(node, "coordinates"));
48081 function getGeometry(node) {
48082 let geometries = [];
48083 let coordTimes = [];
48084 for (let i3 = 0; i3 < node.childNodes.length; i3++) {
48085 const child = node.childNodes.item(i3);
48086 if (isElement(child)) {
48087 switch (child.tagName) {
48088 case "MultiGeometry":
48090 case "gx:MultiTrack": {
48091 const childGeometries = getGeometry(child);
48092 geometries = geometries.concat(childGeometries.geometries);
48093 coordTimes = coordTimes.concat(childGeometries.coordTimes);
48097 const coordinates = coord1(getCoordinates(child));
48098 if (coordinates.length >= 2) {
48107 case "LineString": {
48108 const coordinates = coord(getCoordinates(child));
48109 if (coordinates.length >= 2) {
48111 type: "LineString",
48119 for (const linearRing of $(child, "LinearRing")) {
48120 const ring = fixRing(coord(getCoordinates(linearRing)));
48121 if (ring.length >= 4) {
48125 if (coords.length) {
48128 coordinates: coords
48135 const gx = gxCoords(child);
48138 const { times, geometry } = gx;
48139 geometries.push(geometry);
48141 coordTimes.push(times);
48152 function geometryListToGeometry(geometries) {
48153 return geometries.length === 0 ? null : geometries.length === 1 ? geometries[0] : {
48154 type: "GeometryCollection",
48158 function getPlacemark(node, styleMap, schema, options2) {
48159 const { coordTimes, geometries } = getGeometry(node);
48160 const geometry = geometryListToGeometry(geometries);
48161 if (!geometry && options2.skipNullGeometry) {
48167 properties: Object.assign(getMulti(node, [
48174 ]), getMaybeHTMLDescription(node), extractCascadedStyle(node, styleMap), extractStyle(node), extractExtendedData(node, schema), extractTimeSpan(node), extractTimeStamp(node), coordTimes.length ? {
48175 coordinateProperties: {
48176 times: coordTimes.length === 1 ? coordTimes[0] : coordTimes
48180 if (feature3.properties?.visibility !== void 0) {
48181 feature3.properties.visibility = feature3.properties.visibility !== "0";
48183 const id2 = node.getAttribute("id");
48184 if (id2 !== null && id2 !== "")
48188 function getGroundOverlayBox(node) {
48189 const latLonQuad = get1(node, "gx:LatLonQuad");
48191 const ring = fixRing(coord(getCoordinates(node)));
48195 coordinates: [ring]
48199 return getLatLonBox(node);
48201 var DEGREES_TO_RADIANS = Math.PI / 180;
48202 function rotateBox(bbox2, coordinates, rotation) {
48203 const center = [(bbox2[0] + bbox2[2]) / 2, (bbox2[1] + bbox2[3]) / 2];
48205 coordinates[0].map((coordinate) => {
48206 const dy = coordinate[1] - center[1];
48207 const dx = coordinate[0] - center[0];
48208 const distance = Math.sqrt(Math.pow(dy, 2) + Math.pow(dx, 2));
48209 const angle2 = Math.atan2(dy, dx) + rotation * DEGREES_TO_RADIANS;
48211 center[0] + Math.cos(angle2) * distance,
48212 center[1] + Math.sin(angle2) * distance
48217 function getLatLonBox(node) {
48218 const latLonBox = get1(node, "LatLonBox");
48220 const north = num1(latLonBox, "north");
48221 const west = num1(latLonBox, "west");
48222 const east = num1(latLonBox, "east");
48223 const south = num1(latLonBox, "south");
48224 const rotation = num1(latLonBox, "rotation");
48225 if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
48226 const bbox2 = [west, south, east, north];
48227 let coordinates = [
48234 // top left (again)
48237 if (typeof rotation === "number") {
48238 coordinates = rotateBox(bbox2, coordinates, rotation);
48251 function getGroundOverlay(node, styleMap, schema, options2) {
48252 const box = getGroundOverlayBox(node);
48253 const geometry = box?.geometry || null;
48254 if (!geometry && options2.skipNullGeometry) {
48260 properties: Object.assign(
48263 * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
48265 { "@geometry-type": "groundoverlay" },
48274 getMaybeHTMLDescription(node),
48275 extractCascadedStyle(node, styleMap),
48276 extractStyle(node),
48277 extractIconHref(node),
48278 extractExtendedData(node, schema),
48279 extractTimeSpan(node),
48280 extractTimeStamp(node)
48284 feature3.bbox = box.bbox;
48286 if (feature3.properties?.visibility !== void 0) {
48287 feature3.properties.visibility = feature3.properties.visibility !== "0";
48289 const id2 = node.getAttribute("id");
48290 if (id2 !== null && id2 !== "")
48294 function getStyleId(style) {
48295 let id2 = style.getAttribute("id");
48296 const parentNode = style.parentNode;
48297 if (!id2 && isElement(parentNode) && parentNode.localName === "CascadingStyle") {
48298 id2 = parentNode.getAttribute("kml:id") || parentNode.getAttribute("id");
48300 return normalizeId(id2 || "");
48302 function buildStyleMap(node) {
48303 const styleMap = {};
48304 for (const style of $(node, "Style")) {
48305 styleMap[getStyleId(style)] = extractStyle(style);
48307 for (const map2 of $(node, "StyleMap")) {
48308 const id2 = normalizeId(map2.getAttribute("id") || "");
48309 val1(map2, "styleUrl", (styleUrl) => {
48310 styleUrl = normalizeId(styleUrl);
48311 if (styleMap[styleUrl]) {
48312 styleMap[id2] = styleMap[styleUrl];
48318 function buildSchema(node) {
48320 for (const field of $(node, "SimpleField")) {
48321 schema[field.getAttribute("name") || ""] = typeConverters[field.getAttribute("type") || ""] || typeConverters["string"];
48325 function* kmlGen(node, options2 = {
48326 skipNullGeometry: false
48328 const styleMap = buildStyleMap(node);
48329 const schema = buildSchema(node);
48330 for (const placemark of $(node, "Placemark")) {
48331 const feature3 = getPlacemark(placemark, styleMap, schema, options2);
48335 for (const groundOverlay of $(node, "GroundOverlay")) {
48336 const feature3 = getGroundOverlay(groundOverlay, styleMap, schema, options2);
48341 function kml(node, options2 = {
48342 skipNullGeometry: false
48345 type: "FeatureCollection",
48346 features: Array.from(kmlGen(node, options2))
48350 // modules/svg/data.js
48351 var _initialized = false;
48352 var _enabled = false;
48354 function svgData(projection2, context, dispatch14) {
48355 var throttledRedraw = throttle_default(function() {
48356 dispatch14.call("change");
48358 var _showLabels = true;
48359 var detected = utilDetect();
48360 var layer = select_default2(null);
48365 const supportedFormats = [
48376 function over(d3_event) {
48377 d3_event.stopPropagation();
48378 d3_event.preventDefault();
48379 d3_event.dataTransfer.dropEffect = "copy";
48381 context.container().attr("dropzone", "copy").on("drop.svgData", function(d3_event) {
48382 d3_event.stopPropagation();
48383 d3_event.preventDefault();
48384 if (!detected.filedrop)
48386 var f3 = d3_event.dataTransfer.files[0];
48387 var extension = getExtension(f3.name);
48388 if (!supportedFormats.includes(extension))
48390 drawData.fileList(d3_event.dataTransfer.files);
48391 }).on("dragenter.svgData", over).on("dragexit.svgData", over).on("dragover.svgData", over);
48392 _initialized = true;
48394 function getService() {
48395 if (services.vectorTile && !_vtService) {
48396 _vtService = services.vectorTile;
48397 _vtService.event.on("loadedData", throttledRedraw);
48398 } else if (!services.vectorTile && _vtService) {
48403 function showLayer() {
48405 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
48406 dispatch14.call("change");
48409 function hideLayer() {
48410 throttledRedraw.cancel();
48411 layer.transition().duration(250).style("opacity", 0).on("end", layerOff);
48413 function layerOn() {
48414 layer.style("display", "block");
48416 function layerOff() {
48417 layer.selectAll(".viewfield-group").remove();
48418 layer.style("display", "none");
48420 function ensureIDs(gj) {
48423 if (gj.type === "FeatureCollection") {
48424 for (var i3 = 0; i3 < gj.features.length; i3++) {
48425 ensureFeatureID(gj.features[i3]);
48428 ensureFeatureID(gj);
48432 function ensureFeatureID(feature3) {
48435 feature3.__featurehash__ = utilHashcode((0, import_fast_json_stable_stringify.default)(feature3));
48438 function getFeatures(gj) {
48441 if (gj.type === "FeatureCollection") {
48442 return gj.features;
48447 function featureKey(d2) {
48448 return d2.__featurehash__;
48450 function isPolygon(d2) {
48451 return d2.geometry.type === "Polygon" || d2.geometry.type === "MultiPolygon";
48453 function clipPathID(d2) {
48454 return "ideditor-data-" + d2.__featurehash__ + "-clippath";
48456 function featureClasses(d2) {
48458 "data" + d2.__featurehash__,
48460 isPolygon(d2) ? "area" : "",
48461 d2.__layerID__ || ""
48462 ].filter(Boolean).join(" ");
48464 function drawData(selection2) {
48465 var vtService = getService();
48466 var getPath = svgPath(projection2).geojson;
48467 var getAreaPath = svgPath(projection2, null, true).geojson;
48468 var hasData = drawData.hasData();
48469 layer = selection2.selectAll(".layer-mapdata").data(_enabled && hasData ? [0] : []);
48470 layer.exit().remove();
48471 layer = layer.enter().append("g").attr("class", "layer-mapdata").merge(layer);
48472 var surface = context.surface();
48473 if (!surface || surface.empty())
48475 var geoData, polygonData;
48476 if (_template && vtService) {
48477 var sourceID = _template;
48478 vtService.loadTiles(sourceID, _template, projection2);
48479 geoData = vtService.data(sourceID, projection2);
48481 geoData = getFeatures(_geojson);
48483 geoData = geoData.filter(getPath);
48484 polygonData = geoData.filter(isPolygon);
48485 var clipPaths = surface.selectAll("defs").selectAll(".clipPath-data").data(polygonData, featureKey);
48486 clipPaths.exit().remove();
48487 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-data").attr("id", clipPathID);
48488 clipPathsEnter.append("path");
48489 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", getAreaPath);
48490 var datagroups = layer.selectAll("g.datagroup").data(["fill", "shadow", "stroke"]);
48491 datagroups = datagroups.enter().append("g").attr("class", function(d2) {
48492 return "datagroup datagroup-" + d2;
48493 }).merge(datagroups);
48499 var paths = datagroups.selectAll("path").data(function(layer2) {
48500 return pathData[layer2];
48502 paths.exit().remove();
48503 paths = paths.enter().append("path").attr("class", function(d2) {
48504 var datagroup = this.parentNode.__data__;
48505 return "pathdata " + datagroup + " " + featureClasses(d2);
48506 }).attr("clip-path", function(d2) {
48507 var datagroup = this.parentNode.__data__;
48508 return datagroup === "fill" ? "url(#" + clipPathID(d2) + ")" : null;
48509 }).merge(paths).attr("d", function(d2) {
48510 var datagroup = this.parentNode.__data__;
48511 return datagroup === "fill" ? getAreaPath(d2) : getPath(d2);
48513 layer.call(drawLabels, "label-halo", geoData).call(drawLabels, "label", geoData);
48514 function drawLabels(selection3, textClass, data) {
48515 var labelPath = path_default(projection2);
48516 var labelData = data.filter(function(d2) {
48517 return _showLabels && d2.properties && (d2.properties.desc || d2.properties.name);
48519 var labels = selection3.selectAll("text." + textClass).data(labelData, featureKey);
48520 labels.exit().remove();
48521 labels = labels.enter().append("text").attr("class", function(d2) {
48522 return textClass + " " + featureClasses(d2);
48523 }).merge(labels).text(function(d2) {
48524 return d2.properties.desc || d2.properties.name;
48525 }).attr("x", function(d2) {
48526 var centroid = labelPath.centroid(d2);
48527 return centroid[0] + 11;
48528 }).attr("y", function(d2) {
48529 var centroid = labelPath.centroid(d2);
48530 return centroid[1];
48534 function getExtension(fileName) {
48537 var re3 = /\.(gpx|kml|(geo)?json|png)$/i;
48538 var match = fileName.toLowerCase().match(re3);
48539 return match && match.length && match[0];
48541 function xmlToDom(textdata) {
48542 return new DOMParser().parseFromString(textdata, "text/xml");
48544 function stringifyGeojsonProperties(feature3) {
48545 const properties = feature3.properties;
48546 for (const key in properties) {
48547 const property = properties[key];
48548 if (typeof property === "number" || typeof property === "boolean" || Array.isArray(property)) {
48549 properties[key] = property.toString();
48550 } else if (property === null) {
48551 properties[key] = "null";
48552 } else if (typeof property === "object") {
48553 properties[key] = JSON.stringify(property);
48557 drawData.setFile = function(extension, data) {
48563 switch (extension) {
48565 gj = gpx(xmlToDom(data));
48568 gj = kml(xmlToDom(data));
48572 gj = JSON.parse(data);
48573 if (gj.type === "FeatureCollection") {
48574 gj.features.forEach(stringifyGeojsonProperties);
48575 } else if (gj.type === "Feature") {
48576 stringifyGeojsonProperties(gj);
48581 if (Object.keys(gj).length) {
48582 _geojson = ensureIDs(gj);
48583 _src = extension + " data file";
48586 dispatch14.call("change");
48589 drawData.showLabels = function(val) {
48590 if (!arguments.length)
48591 return _showLabels;
48595 drawData.enabled = function(val) {
48596 if (!arguments.length)
48604 dispatch14.call("change");
48607 drawData.hasData = function() {
48608 var gj = _geojson || {};
48609 return !!(_template || Object.keys(gj).length);
48611 drawData.template = function(val, src) {
48612 if (!arguments.length)
48614 var osm = context.connection();
48616 var blocklists = osm.imageryBlocklists();
48620 for (var i3 = 0; i3 < blocklists.length; i3++) {
48621 regex = blocklists[i3];
48622 fail = regex.test(val);
48628 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
48629 fail = regex.test(val);
48635 _src = src || "vectortile:" + val.split(/[?#]/)[0];
48636 dispatch14.call("change");
48639 drawData.geojson = function(gj, src) {
48640 if (!arguments.length)
48647 if (Object.keys(gj).length) {
48648 _geojson = ensureIDs(gj);
48649 _src = src || "unknown.geojson";
48651 dispatch14.call("change");
48654 drawData.fileList = function(fileList) {
48655 if (!arguments.length)
48660 _fileList = fileList;
48661 if (!fileList || !fileList.length)
48663 var f3 = fileList[0];
48664 var extension = getExtension(f3.name);
48665 var reader = new FileReader();
48666 reader.onload = function() {
48667 return function(e3) {
48668 drawData.setFile(extension, e3.target.result);
48671 reader.readAsText(f3);
48674 drawData.url = function(url, defaultExtension) {
48679 var testUrl = url.split(/[?#]/)[0];
48680 var extension = getExtension(testUrl) || defaultExtension;
48683 text_default3(url).then(function(data) {
48684 drawData.setFile(extension, data);
48685 }).catch(function() {
48688 drawData.template(url);
48692 drawData.getSrc = function() {
48695 drawData.fitZoom = function() {
48696 var features = getFeatures(_geojson);
48697 if (!features.length)
48699 var map2 = context.map();
48700 var viewport = map2.trimmedExtent().polygon();
48701 var coords = features.reduce(function(coords2, feature3) {
48702 var geom = feature3.geometry;
48705 var c2 = geom.coordinates;
48706 switch (geom.type) {
48712 case "MultiPolygon":
48713 c2 = utilArrayFlatten(c2);
48715 case "MultiLineString":
48716 c2 = utilArrayFlatten(c2);
48719 return utilArrayUnion(coords2, c2);
48721 if (!geoPolygonIntersectsPolygon(viewport, coords, true)) {
48722 var extent = geoExtent(bounds_default({ type: "LineString", coordinates: coords }));
48723 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
48731 // modules/svg/debug.js
48732 function svgDebug(projection2, context) {
48733 function drawDebug(selection2) {
48734 const showTile = context.getDebug("tile");
48735 const showCollision = context.getDebug("collision");
48736 const showImagery = context.getDebug("imagery");
48737 const showTouchTargets = context.getDebug("target");
48738 const showDownloaded = context.getDebug("downloaded");
48739 let debugData = [];
48741 debugData.push({ class: "red", label: "tile" });
48743 if (showCollision) {
48744 debugData.push({ class: "yellow", label: "collision" });
48747 debugData.push({ class: "orange", label: "imagery" });
48749 if (showTouchTargets) {
48750 debugData.push({ class: "pink", label: "touchTargets" });
48752 if (showDownloaded) {
48753 debugData.push({ class: "purple", label: "downloaded" });
48755 let legend = context.container().select(".main-content").selectAll(".debug-legend").data(debugData.length ? [0] : []);
48756 legend.exit().remove();
48757 legend = legend.enter().append("div").attr("class", "fillD debug-legend").merge(legend);
48758 let legendItems = legend.selectAll(".debug-legend-item").data(debugData, (d2) => d2.label);
48759 legendItems.exit().remove();
48760 legendItems.enter().append("span").attr("class", (d2) => `debug-legend-item ${d2.class}`).text((d2) => d2.label);
48761 let layer = selection2.selectAll(".layer-debug").data(showImagery || showDownloaded ? [0] : []);
48762 layer.exit().remove();
48763 layer = layer.enter().append("g").attr("class", "layer-debug").merge(layer);
48764 const extent = context.map().extent();
48765 _mainFileFetcher.get("imagery").then((d2) => {
48766 const hits = showImagery && d2.query.bbox(extent.rectangle(), true) || [];
48767 const features = hits.map((d4) => d4.features[d4.id]);
48768 let imagery = layer.selectAll("path.debug-imagery").data(features);
48769 imagery.exit().remove();
48770 imagery.enter().append("path").attr("class", "debug-imagery debug orange");
48773 const osm = context.connection();
48774 let dataDownloaded = [];
48775 if (osm && showDownloaded) {
48776 const rtree = osm.caches("get").tile.rtree;
48777 dataDownloaded = rtree.all().map((bbox2) => {
48780 properties: { id: bbox2.id },
48784 [bbox2.minX, bbox2.minY],
48785 [bbox2.minX, bbox2.maxY],
48786 [bbox2.maxX, bbox2.maxY],
48787 [bbox2.maxX, bbox2.minY],
48788 [bbox2.minX, bbox2.minY]
48794 let downloaded = layer.selectAll("path.debug-downloaded").data(showDownloaded ? dataDownloaded : []);
48795 downloaded.exit().remove();
48796 downloaded.enter().append("path").attr("class", "debug-downloaded debug purple");
48797 layer.selectAll("path").attr("d", svgPath(projection2).geojson);
48799 drawDebug.enabled = function() {
48800 if (!arguments.length) {
48801 return context.getDebug("tile") || context.getDebug("collision") || context.getDebug("imagery") || context.getDebug("target") || context.getDebug("downloaded");
48809 // modules/svg/defs.js
48810 function svgDefs(context) {
48811 var _defsSelection = select_default2(null);
48812 var _spritesheetIds = [
48820 function drawDefs(selection2) {
48821 _defsSelection = selection2.append("defs");
48822 _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");
48823 function addSidedMarker(name, color2, offset) {
48824 _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);
48826 addSidedMarker("natural", "rgb(170, 170, 170)", 0);
48827 addSidedMarker("coastline", "#77dede", 1);
48828 addSidedMarker("waterway", "#77dede", 1);
48829 addSidedMarker("barrier", "#ddd", 1);
48830 addSidedMarker("man_made", "#fff", 0);
48831 _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");
48832 _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");
48833 var patterns2 = _defsSelection.selectAll("pattern").data([
48834 // pattern name, pattern image name
48836 ["construction", "construction"],
48837 ["cemetery", "cemetery"],
48838 ["cemetery_christian", "cemetery_christian"],
48839 ["cemetery_buddhist", "cemetery_buddhist"],
48840 ["cemetery_muslim", "cemetery_muslim"],
48841 ["cemetery_jewish", "cemetery_jewish"],
48842 ["farmland", "farmland"],
48843 ["farmyard", "farmyard"],
48844 ["forest", "forest"],
48845 ["forest_broadleaved", "forest_broadleaved"],
48846 ["forest_needleleaved", "forest_needleleaved"],
48847 ["forest_leafless", "forest_leafless"],
48848 ["golf_green", "grass"],
48849 ["grass", "grass"],
48850 ["landfill", "landfill"],
48851 ["meadow", "grass"],
48852 ["orchard", "orchard"],
48854 ["quarry", "quarry"],
48855 ["scrub", "bushes"],
48856 ["vineyard", "vineyard"],
48857 ["water_standing", "lines"],
48858 ["waves", "waves"],
48859 ["wetland", "wetland"],
48860 ["wetland_marsh", "wetland_marsh"],
48861 ["wetland_swamp", "wetland_swamp"],
48862 ["wetland_bog", "wetland_bog"],
48863 ["wetland_reedbed", "wetland_reedbed"]
48864 ]).enter().append("pattern").attr("id", function(d2) {
48865 return "ideditor-pattern-" + d2[0];
48866 }).attr("width", 32).attr("height", 32).attr("patternUnits", "userSpaceOnUse");
48867 patterns2.append("rect").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("class", function(d2) {
48868 return "pattern-color-" + d2[0];
48870 patterns2.append("image").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("xlink:href", function(d2) {
48871 return context.imagePath("pattern/" + d2[1] + ".png");
48873 _defsSelection.selectAll("clipPath").data([12, 18, 20, 32, 45]).enter().append("clipPath").attr("id", function(d2) {
48874 return "ideditor-clip-square-" + d2;
48875 }).append("rect").attr("x", 0).attr("y", 0).attr("width", function(d2) {
48877 }).attr("height", function(d2) {
48880 addSprites(_spritesheetIds, true);
48882 function addSprites(ids, overrideColors) {
48883 _spritesheetIds = utilArrayUniq(_spritesheetIds.concat(ids));
48884 var spritesheets = _defsSelection.selectAll(".spritesheet").data(_spritesheetIds);
48885 spritesheets.enter().append("g").attr("class", function(d2) {
48886 return "spritesheet spritesheet-" + d2;
48887 }).each(function(d2) {
48888 var url = context.imagePath(d2 + ".svg");
48889 var node = select_default2(this).node();
48890 svg(url).then(function(svg2) {
48892 select_default2(svg2.documentElement).attr("id", "ideditor-" + d2).node()
48894 if (overrideColors && d2 !== "iD-sprite") {
48895 select_default2(node).selectAll("path").attr("fill", "currentColor");
48897 }).catch(function() {
48900 spritesheets.exit().remove();
48902 drawDefs.addSprites = addSprites;
48906 // modules/svg/keepRight.js
48907 var _layerEnabled = false;
48909 function svgKeepRight(projection2, context, dispatch14) {
48910 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
48911 const minZoom4 = 12;
48912 let touchLayer = select_default2(null);
48913 let drawLayer = select_default2(null);
48914 let layerVisible = false;
48915 function markerPath(selection2, klass) {
48916 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");
48918 function getService() {
48919 if (services.keepRight && !_qaService) {
48920 _qaService = services.keepRight;
48921 _qaService.on("loaded", throttledRedraw);
48922 } else if (!services.keepRight && _qaService) {
48927 function editOn() {
48928 if (!layerVisible) {
48929 layerVisible = true;
48930 drawLayer.style("display", "block");
48933 function editOff() {
48934 if (layerVisible) {
48935 layerVisible = false;
48936 drawLayer.style("display", "none");
48937 drawLayer.selectAll(".qaItem.keepRight").remove();
48938 touchLayer.selectAll(".qaItem.keepRight").remove();
48941 function layerOn() {
48943 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
48945 function layerOff() {
48946 throttledRedraw.cancel();
48947 drawLayer.interrupt();
48948 touchLayer.selectAll(".qaItem.keepRight").remove();
48949 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
48951 dispatch14.call("change");
48954 function updateMarkers() {
48955 if (!layerVisible || !_layerEnabled)
48957 const service = getService();
48958 const selectedID = context.selectedErrorID();
48959 const data = service ? service.getItems(projection2) : [];
48960 const getTransform = svgPointTransform(projection2);
48961 const markers = drawLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
48962 markers.exit().remove();
48963 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.parentIssueType}`);
48964 markersEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
48965 markersEnter.append("path").call(markerPath, "shadow");
48966 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");
48967 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
48968 if (touchLayer.empty())
48970 const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
48971 const targets = touchLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
48972 targets.exit().remove();
48973 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);
48974 function sortY(a2, b2) {
48975 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];
48978 function drawKeepRight(selection2) {
48979 const service = getService();
48980 const surface = context.surface();
48981 if (surface && !surface.empty()) {
48982 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
48984 drawLayer = selection2.selectAll(".layer-keepRight").data(service ? [0] : []);
48985 drawLayer.exit().remove();
48986 drawLayer = drawLayer.enter().append("g").attr("class", "layer-keepRight").style("display", _layerEnabled ? "block" : "none").merge(drawLayer);
48987 if (_layerEnabled) {
48988 if (service && ~~context.map().zoom() >= minZoom4) {
48990 service.loadIssues(projection2);
48997 drawKeepRight.enabled = function(val) {
48998 if (!arguments.length)
48999 return _layerEnabled;
49000 _layerEnabled = val;
49001 if (_layerEnabled) {
49005 if (context.selectedErrorID()) {
49006 context.enter(modeBrowse(context));
49009 dispatch14.call("change");
49012 drawKeepRight.supported = () => !!getService();
49013 return drawKeepRight;
49016 // modules/svg/geolocate.js
49017 function svgGeolocate(projection2) {
49018 var layer = select_default2(null);
49021 if (svgGeolocate.initialized)
49023 svgGeolocate.enabled = false;
49024 svgGeolocate.initialized = true;
49026 function showLayer() {
49027 layer.style("display", "block");
49029 function hideLayer() {
49030 layer.transition().duration(250).style("opacity", 0);
49032 function layerOn() {
49033 layer.style("opacity", 0).transition().duration(250).style("opacity", 1);
49035 function layerOff() {
49036 layer.style("display", "none");
49038 function transform2(d2) {
49039 return svgPointTransform(projection2)(d2);
49041 function accuracy(accuracy2, loc) {
49042 var degreesRadius = geoMetersToLat(accuracy2), tangentLoc = [loc[0], loc[1] + degreesRadius], projectedTangent = projection2(tangentLoc), projectedLoc = projection2([loc[0], loc[1]]);
49043 return Math.round(projectedLoc[1] - projectedTangent[1]).toString();
49045 function update() {
49046 var geolocation = { loc: [_position.coords.longitude, _position.coords.latitude] };
49047 var groups = layer.selectAll(".geolocations").selectAll(".geolocation").data([geolocation]);
49048 groups.exit().remove();
49049 var pointsEnter = groups.enter().append("g").attr("class", "geolocation");
49050 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");
49051 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");
49052 groups.merge(pointsEnter).attr("transform", transform2);
49053 layer.select(".geolocate-radius").attr("r", accuracy(_position.coords.accuracy, geolocation.loc));
49055 function drawLocation(selection2) {
49056 var enabled = svgGeolocate.enabled;
49057 layer = selection2.selectAll(".layer-geolocate").data([0]);
49058 layer.exit().remove();
49059 var layerEnter = layer.enter().append("g").attr("class", "layer-geolocate").style("display", enabled ? "block" : "none");
49060 layerEnter.append("g").attr("class", "geolocations");
49061 layer = layerEnter.merge(layer);
49068 drawLocation.enabled = function(position, enabled) {
49069 if (!arguments.length)
49070 return svgGeolocate.enabled;
49071 _position = position;
49072 svgGeolocate.enabled = enabled;
49073 if (svgGeolocate.enabled) {
49082 return drawLocation;
49085 // modules/svg/labels.js
49086 var import_rbush6 = __toESM(require_rbush_min());
49087 function svgLabels(projection2, context) {
49088 var path = path_default(projection2);
49089 var detected = utilDetect();
49090 var baselineHack = detected.ie || detected.browser.toLowerCase() === "edge" || detected.browser.toLowerCase() === "firefox" && detected.version >= 70;
49091 var _rdrawn = new import_rbush6.default();
49092 var _rskipped = new import_rbush6.default();
49093 var _textWidthCache = {};
49094 var _entitybboxes = {};
49096 ["line", "aeroway", "*", 12],
49097 ["line", "highway", "motorway", 12],
49098 ["line", "highway", "trunk", 12],
49099 ["line", "highway", "primary", 12],
49100 ["line", "highway", "secondary", 12],
49101 ["line", "highway", "tertiary", 12],
49102 ["line", "highway", "*", 12],
49103 ["line", "railway", "*", 12],
49104 ["line", "waterway", "*", 12],
49105 ["area", "aeroway", "*", 12],
49106 ["area", "amenity", "*", 12],
49107 ["area", "building", "*", 12],
49108 ["area", "historic", "*", 12],
49109 ["area", "leisure", "*", 12],
49110 ["area", "man_made", "*", 12],
49111 ["area", "natural", "*", 12],
49112 ["area", "shop", "*", 12],
49113 ["area", "tourism", "*", 12],
49114 ["area", "camp_site", "*", 12],
49115 ["point", "aeroway", "*", 10],
49116 ["point", "amenity", "*", 10],
49117 ["point", "building", "*", 10],
49118 ["point", "historic", "*", 10],
49119 ["point", "leisure", "*", 10],
49120 ["point", "man_made", "*", 10],
49121 ["point", "natural", "*", 10],
49122 ["point", "shop", "*", 10],
49123 ["point", "tourism", "*", 10],
49124 ["point", "camp_site", "*", 10],
49125 ["line", "ref", "*", 12],
49126 ["area", "ref", "*", 12],
49127 ["point", "ref", "*", 10],
49128 ["line", "name", "*", 12],
49129 ["area", "name", "*", 12],
49130 ["point", "name", "*", 10]
49132 function shouldSkipIcon(preset) {
49133 var noIcons = ["building", "landuse", "natural"];
49134 return noIcons.some(function(s2) {
49135 return preset.id.indexOf(s2) >= 0;
49138 function get4(array2, prop) {
49139 return function(d2, i3) {
49140 return array2[i3][prop];
49143 function textWidth(text2, size, elem) {
49144 var c2 = _textWidthCache[size];
49146 c2 = _textWidthCache[size] = {};
49150 c2[text2] = elem.getComputedTextLength();
49153 var str2 = encodeURIComponent(text2).match(/%[CDEFcdef]/g);
49154 if (str2 === null) {
49155 return size / 3 * 2 * text2.length;
49157 return size / 3 * (2 * text2.length + str2.length);
49161 function drawLinePaths(selection2, entities, filter2, classes, labels) {
49162 var paths = selection2.selectAll("path").filter(filter2).data(entities, osmEntity.key);
49163 paths.exit().remove();
49164 paths.enter().append("path").style("stroke-width", get4(labels, "font-size")).attr("id", function(d2) {
49165 return "ideditor-labelpath-" + d2.id;
49166 }).attr("class", classes).merge(paths).attr("d", get4(labels, "lineString"));
49168 function drawLineLabels(selection2, entities, filter2, classes, labels) {
49169 var texts = selection2.selectAll("text." + classes).filter(filter2).data(entities, osmEntity.key);
49170 texts.exit().remove();
49171 texts.enter().append("text").attr("class", function(d2, i3) {
49172 return classes + " " + labels[i3].classes + " " + d2.id;
49173 }).attr("dy", baselineHack ? "0.35em" : null).append("textPath").attr("class", "textpath");
49174 selection2.selectAll("text." + classes).selectAll(".textpath").filter(filter2).data(entities, osmEntity.key).attr("startOffset", "50%").attr("xlink:href", function(d2) {
49175 return "#ideditor-labelpath-" + d2.id;
49176 }).text(utilDisplayNameForPath);
49178 function drawPointLabels(selection2, entities, filter2, classes, labels) {
49179 var texts = selection2.selectAll("text." + classes).filter(filter2).data(entities, osmEntity.key);
49180 texts.exit().remove();
49181 texts.enter().append("text").attr("class", function(d2, i3) {
49182 return classes + " " + labels[i3].classes + " " + d2.id;
49183 }).merge(texts).attr("x", get4(labels, "x")).attr("y", get4(labels, "y")).style("text-anchor", get4(labels, "textAnchor")).text(utilDisplayName).each(function(d2, i3) {
49184 textWidth(utilDisplayName(d2), labels[i3].height, this);
49187 function drawAreaLabels(selection2, entities, filter2, classes, labels) {
49188 entities = entities.filter(hasText);
49189 labels = labels.filter(hasText);
49190 drawPointLabels(selection2, entities, filter2, classes, labels);
49191 function hasText(d2, i3) {
49192 return labels[i3].hasOwnProperty("x") && labels[i3].hasOwnProperty("y");
49195 function drawAreaIcons(selection2, entities, filter2, classes, labels) {
49196 var icons = selection2.selectAll("use." + classes).filter(filter2).data(entities, osmEntity.key);
49197 icons.exit().remove();
49198 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) {
49199 var preset = _mainPresetIndex.match(d2, context.graph());
49200 var picon = preset && preset.icon;
49201 return picon ? "#" + picon : "";
49204 function drawCollisionBoxes(selection2, rtree, which) {
49205 var classes = "debug " + which + " " + (which === "debug-skipped" ? "orange" : "yellow");
49207 if (context.getDebug("collision")) {
49208 gj = rtree.all().map(function(d2) {
49209 return { type: "Polygon", coordinates: [[
49210 [d2.minX, d2.minY],
49211 [d2.maxX, d2.minY],
49212 [d2.maxX, d2.maxY],
49213 [d2.minX, d2.maxY],
49218 var boxes = selection2.selectAll("." + which).data(gj);
49219 boxes.exit().remove();
49220 boxes.enter().append("path").attr("class", classes).merge(boxes).attr("d", path_default());
49222 function drawLabels(selection2, graph, entities, filter2, dimensions, fullRedraw) {
49223 var wireframe = context.surface().classed("fill-wireframe");
49224 var zoom = geoScaleToZoom(projection2.scale());
49225 var labelable = [];
49226 var renderNodeAs = {};
49227 var i3, j3, k2, entity, geometry;
49228 for (i3 = 0; i3 < labelStack.length; i3++) {
49229 labelable.push([]);
49234 _entitybboxes = {};
49236 for (i3 = 0; i3 < entities.length; i3++) {
49237 entity = entities[i3];
49238 var toRemove = [].concat(_entitybboxes[entity.id] || []).concat(_entitybboxes[entity.id + "I"] || []);
49239 for (j3 = 0; j3 < toRemove.length; j3++) {
49240 _rdrawn.remove(toRemove[j3]);
49241 _rskipped.remove(toRemove[j3]);
49245 for (i3 = 0; i3 < entities.length; i3++) {
49246 entity = entities[i3];
49247 geometry = entity.geometry(graph);
49248 if (geometry === "point" || geometry === "vertex" && isInterestingVertex(entity)) {
49249 var hasDirections = entity.directions(graph, projection2).length;
49251 if (!wireframe && geometry === "point" && !(zoom >= 18 && hasDirections)) {
49252 renderNodeAs[entity.id] = "point";
49253 markerPadding = 20;
49255 renderNodeAs[entity.id] = "vertex";
49258 var coord2 = projection2(entity.loc);
49259 var nodePadding = 10;
49261 minX: coord2[0] - nodePadding,
49262 minY: coord2[1] - nodePadding - markerPadding,
49263 maxX: coord2[0] + nodePadding,
49264 maxY: coord2[1] + nodePadding
49266 doInsert(bbox2, entity.id + "P");
49268 if (geometry === "vertex") {
49269 geometry = "point";
49271 var preset = geometry === "area" && _mainPresetIndex.match(entity, graph);
49272 var icon2 = preset && !shouldSkipIcon(preset) && preset.icon;
49273 if (!icon2 && !utilDisplayName(entity))
49275 for (k2 = 0; k2 < labelStack.length; k2++) {
49276 var matchGeom = labelStack[k2][0];
49277 var matchKey = labelStack[k2][1];
49278 var matchVal = labelStack[k2][2];
49279 var hasVal = entity.tags[matchKey];
49280 if (geometry === matchGeom && hasVal && (matchVal === "*" || matchVal === hasVal)) {
49281 labelable[k2].push(entity);
49296 for (k2 = 0; k2 < labelable.length; k2++) {
49297 var fontSize = labelStack[k2][3];
49298 for (i3 = 0; i3 < labelable[k2].length; i3++) {
49299 entity = labelable[k2][i3];
49300 geometry = entity.geometry(graph);
49301 var getName = geometry === "line" ? utilDisplayNameForPath : utilDisplayName;
49302 var name = getName(entity);
49303 var width = name && textWidth(name, fontSize);
49305 if (geometry === "point" || geometry === "vertex") {
49308 var renderAs = renderNodeAs[entity.id];
49309 if (renderAs === "vertex" && zoom < 17)
49311 p2 = getPointLabel(entity, width, fontSize, renderAs);
49312 } else if (geometry === "line") {
49313 p2 = getLineLabel(entity, width, fontSize);
49314 } else if (geometry === "area") {
49315 p2 = getAreaLabel(entity, width, fontSize);
49318 if (geometry === "vertex") {
49319 geometry = "point";
49321 p2.classes = geometry + " tag-" + labelStack[k2][1];
49322 positions[geometry].push(p2);
49323 labelled[geometry].push(entity);
49327 function isInterestingVertex(entity2) {
49328 var selectedIDs = context.selectedIDs();
49329 return entity2.hasInterestingTags() || entity2.isEndpoint(graph) || entity2.isConnected(graph) || selectedIDs.indexOf(entity2.id) !== -1 || graph.parentWays(entity2).some(function(parent) {
49330 return selectedIDs.indexOf(parent.id) !== -1;
49333 function getPointLabel(entity2, width2, height, geometry2) {
49334 var y2 = geometry2 === "point" ? -12 : 0;
49335 var pointOffsets = {
49336 ltr: [15, y2, "start"],
49337 rtl: [-15, y2, "end"]
49339 var textDirection = _mainLocalizer.textDirection();
49340 var coord3 = projection2(entity2.loc);
49341 var textPadding = 2;
49342 var offset = pointOffsets[textDirection];
49346 x: coord3[0] + offset[0],
49347 y: coord3[1] + offset[1],
49348 textAnchor: offset[2]
49351 if (textDirection === "rtl") {
49353 minX: p3.x - width2 - textPadding,
49354 minY: p3.y - height / 2 - textPadding,
49355 maxX: p3.x + textPadding,
49356 maxY: p3.y + height / 2 + textPadding
49360 minX: p3.x - textPadding,
49361 minY: p3.y - height / 2 - textPadding,
49362 maxX: p3.x + width2 + textPadding,
49363 maxY: p3.y + height / 2 + textPadding
49366 if (tryInsert([bbox3], entity2.id, true)) {
49370 function getLineLabel(entity2, width2, height) {
49371 var viewport = geoExtent(context.projection.clipExtent()).polygon();
49372 var points = graph.childNodes(entity2).map(function(node) {
49373 return projection2(node.loc);
49375 var length = geoPathLength(points);
49376 if (length < width2 + 20)
49378 var lineOffsets = [
49400 for (var i4 = 0; i4 < lineOffsets.length; i4++) {
49401 var offset = lineOffsets[i4];
49402 var middle = offset / 100 * length;
49403 var start2 = middle - width2 / 2;
49404 if (start2 < 0 || start2 + width2 > length)
49406 var sub = subpath(points, start2, start2 + width2);
49407 if (!sub || !geoPolygonIntersectsPolygon(viewport, sub, true)) {
49410 var isReverse = reverse(sub);
49412 sub = sub.reverse();
49415 var boxsize = (height + 2) / 2;
49416 for (var j4 = 0; j4 < sub.length - 1; j4++) {
49418 var b2 = sub[j4 + 1];
49419 var num = Math.max(1, Math.floor(geoVecLength(a2, b2) / boxsize / 2));
49420 for (var box = 0; box < num; box++) {
49421 var p3 = geoVecInterp(a2, b2, box / num);
49422 var x05 = p3[0] - boxsize - padding;
49423 var y05 = p3[1] - boxsize - padding;
49424 var x12 = p3[0] + boxsize + padding;
49425 var y12 = p3[1] + boxsize + padding;
49427 minX: Math.min(x05, x12),
49428 minY: Math.min(y05, y12),
49429 maxX: Math.max(x05, x12),
49430 maxY: Math.max(y05, y12)
49434 if (tryInsert(bboxes, entity2.id, false)) {
49436 "font-size": height + 2,
49437 lineString: lineString2(sub),
49438 startOffset: offset + "%"
49442 function reverse(p4) {
49443 var angle2 = Math.atan2(p4[1][1] - p4[0][1], p4[1][0] - p4[0][0]);
49444 return !(p4[0][0] < p4[p4.length - 1][0] && angle2 < Math.PI / 2 && angle2 > -Math.PI / 2);
49446 function lineString2(points2) {
49447 return "M" + points2.join("L");
49449 function subpath(points2, from, to) {
49451 var start3, end, i0, i1;
49452 for (var i5 = 0; i5 < points2.length - 1; i5++) {
49453 var a3 = points2[i5];
49454 var b3 = points2[i5 + 1];
49455 var current = geoVecLength(a3, b3);
49457 if (!start3 && sofar + current >= from) {
49458 portion = (from - sofar) / current;
49460 a3[0] + portion * (b3[0] - a3[0]),
49461 a3[1] + portion * (b3[1] - a3[1])
49465 if (!end && sofar + current >= to) {
49466 portion = (to - sofar) / current;
49468 a3[0] + portion * (b3[0] - a3[0]),
49469 a3[1] + portion * (b3[1] - a3[1])
49475 var result = points2.slice(i0, i1);
49476 result.unshift(start3);
49481 function getAreaLabel(entity2, width2, height) {
49482 var centroid = path.centroid(entity2.asGeoJSON(graph));
49483 var extent = entity2.extent(graph);
49484 var areaWidth = projection2(extent[1])[0] - projection2(extent[0])[0];
49485 if (isNaN(centroid[0]) || areaWidth < 20)
49487 var preset2 = _mainPresetIndex.match(entity2, context.graph());
49488 var picon = preset2 && preset2.icon;
49494 addLabel(iconSize + padding);
49502 function addIcon() {
49503 var iconX = centroid[0] - iconSize / 2;
49504 var iconY = centroid[1] - iconSize / 2;
49508 maxX: iconX + iconSize,
49509 maxY: iconY + iconSize
49511 if (tryInsert([bbox3], entity2.id + "I", true)) {
49512 p3.transform = "translate(" + iconX + "," + iconY + ")";
49517 function addLabel(yOffset) {
49518 if (width2 && areaWidth >= width2 + 20) {
49519 var labelX = centroid[0];
49520 var labelY = centroid[1] + yOffset;
49522 minX: labelX - width2 / 2 - padding,
49523 minY: labelY - height / 2 - padding,
49524 maxX: labelX + width2 / 2 + padding,
49525 maxY: labelY + height / 2 + padding
49527 if (tryInsert([bbox3], entity2.id, true)) {
49530 p3.textAnchor = "middle";
49531 p3.height = height;
49538 function doInsert(bbox3, id2) {
49540 var oldbox = _entitybboxes[id2];
49542 _rdrawn.remove(oldbox);
49544 _entitybboxes[id2] = bbox3;
49545 _rdrawn.insert(bbox3);
49547 function tryInsert(bboxes, id2, saveSkipped) {
49548 var skipped = false;
49549 for (var i4 = 0; i4 < bboxes.length; i4++) {
49550 var bbox3 = bboxes[i4];
49552 if (bbox3.minX < 0 || bbox3.minY < 0 || bbox3.maxX > dimensions[0] || bbox3.maxY > dimensions[1]) {
49556 if (_rdrawn.collides(bbox3)) {
49561 _entitybboxes[id2] = bboxes;
49564 _rskipped.load(bboxes);
49567 _rdrawn.load(bboxes);
49571 var layer = selection2.selectAll(".layer-osm.labels");
49572 layer.selectAll(".labels-group").data(["halo", "label", "debug"]).enter().append("g").attr("class", function(d2) {
49573 return "labels-group " + d2;
49575 var halo = layer.selectAll(".labels-group.halo");
49576 var label = layer.selectAll(".labels-group.label");
49577 var debug2 = layer.selectAll(".labels-group.debug");
49578 drawPointLabels(label, labelled.point, filter2, "pointlabel", positions.point);
49579 drawPointLabels(halo, labelled.point, filter2, "pointlabel-halo", positions.point);
49580 drawLinePaths(layer, labelled.line, filter2, "", positions.line);
49581 drawLineLabels(label, labelled.line, filter2, "linelabel", positions.line);
49582 drawLineLabels(halo, labelled.line, filter2, "linelabel-halo", positions.line);
49583 drawAreaLabels(label, labelled.area, filter2, "arealabel", positions.area);
49584 drawAreaLabels(halo, labelled.area, filter2, "arealabel-halo", positions.area);
49585 drawAreaIcons(label, labelled.area, filter2, "areaicon", positions.area);
49586 drawAreaIcons(halo, labelled.area, filter2, "areaicon-halo", positions.area);
49587 drawCollisionBoxes(debug2, _rskipped, "debug-skipped");
49588 drawCollisionBoxes(debug2, _rdrawn, "debug-drawn");
49589 layer.call(filterLabels);
49591 function filterLabels(selection2) {
49592 var drawLayer = selection2.selectAll(".layer-osm.labels");
49593 var layers = drawLayer.selectAll(".labels-group.halo, .labels-group.label");
49594 layers.selectAll(".nolabel").classed("nolabel", false);
49595 var mouse = context.map().mouse();
49596 var graph = context.graph();
49597 var selectedIDs = context.selectedIDs();
49602 bbox2 = { minX: mouse[0] - pad2, minY: mouse[1] - pad2, maxX: mouse[0] + pad2, maxY: mouse[1] + pad2 };
49603 var nearMouse = _rdrawn.search(bbox2).map(function(entity2) {
49606 ids.push.apply(ids, nearMouse);
49608 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
49609 var entity = graph.hasEntity(selectedIDs[i3]);
49610 if (entity && entity.type === "node") {
49611 ids.push(selectedIDs[i3]);
49614 layers.selectAll(utilEntitySelector(ids)).classed("nolabel", true);
49615 var debug2 = selection2.selectAll(".labels-group.debug");
49617 if (context.getDebug("collision")) {
49621 [bbox2.minX, bbox2.minY],
49622 [bbox2.maxX, bbox2.minY],
49623 [bbox2.maxX, bbox2.maxY],
49624 [bbox2.minX, bbox2.maxY],
49625 [bbox2.minX, bbox2.minY]
49629 var box = debug2.selectAll(".debug-mouse").data(gj);
49630 box.exit().remove();
49631 box.enter().append("path").attr("class", "debug debug-mouse yellow").merge(box).attr("d", path_default());
49633 var throttleFilterLabels = throttle_default(filterLabels, 100);
49634 drawLabels.observe = function(selection2) {
49635 var listener = function() {
49636 throttleFilterLabels(selection2);
49638 selection2.on("mousemove.hidelabels", listener);
49639 context.on("enter.hidelabels", listener);
49641 drawLabels.off = function(selection2) {
49642 throttleFilterLabels.cancel();
49643 selection2.on("mousemove.hidelabels", null);
49644 context.on("enter.hidelabels", null);
49649 // node_modules/exifr/dist/full.esm.mjs
49650 var e = "undefined" != typeof self ? self : global;
49651 var t = "undefined" != typeof navigator;
49652 var i2 = t && "undefined" == typeof HTMLImageElement;
49653 var n2 = !("undefined" == typeof global || "undefined" == typeof process || !process.versions || !process.versions.node);
49657 var o = (e3) => e3;
49658 function l(e3, t2 = o) {
49661 return "function" == typeof __require ? Promise.resolve(t2(__require(e3))) : import(
49662 /* webpackIgnore: true */
49666 console.warn(`Couldn't load ${e3}`);
49670 var u = (e3) => h = e3;
49672 const e3 = l("http", (e4) => e4), t2 = l("https", (e4) => e4), i3 = (n3, { headers: s2 } = {}) => new Promise(async (r2, a2) => {
49673 let { port: o2, hostname: l2, pathname: h2, protocol: u2, search: c2 } = new URL(n3);
49674 const f3 = { method: "GET", hostname: l2, path: encodeURI(h2) + c2, headers: s2 };
49675 "" !== o2 && (f3.port = Number(o2));
49676 const d2 = ("https:" === u2 ? await t2 : await e3).request(f3, (e4) => {
49677 if (301 === e4.statusCode || 302 === e4.statusCode) {
49678 let t3 = new URL(e4.headers.location, n3).toString();
49679 return i3(t3, { headers: s2 }).then(r2).catch(a2);
49681 r2({ status: e4.statusCode, arrayBuffer: () => new Promise((t3) => {
49683 e4.on("data", (e6) => i4.push(e6)), e4.on("end", () => t3(Buffer.concat(i4)));
49686 d2.on("error", a2), d2.end();
49690 function c(e3, t2, i3) {
49691 return t2 in e3 ? Object.defineProperty(e3, t2, { value: i3, enumerable: true, configurable: true, writable: true }) : e3[t2] = i3, e3;
49693 var f2 = (e3) => p(e3) ? void 0 : e3;
49694 var d = (e3) => void 0 !== e3;
49696 return void 0 === e3 || (e3 instanceof Map ? 0 === e3.size : 0 === Object.values(e3).filter(d).length);
49699 let t2 = new Error(e3);
49700 throw delete t2.stack, t2;
49703 return "" === (e3 = function(e4) {
49704 for (; e4.endsWith("\0"); )
49705 e4 = e4.slice(0, -1);
49707 }(e3).trim()) ? void 0 : e3;
49710 let t2 = function(e4) {
49712 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;
49714 return e3.jfif.enabled && (t2 += 50), e3.xmp.enabled && (t2 += 2e4), e3.iptc.enabled && (t2 += 14e3), e3.icc.enabled && (t2 += 6e3), t2;
49716 var C = (e3) => String.fromCharCode.apply(null, e3);
49717 var y = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : void 0;
49719 return y ? y.decode(e3) : a ? Buffer.from(e3).toString("utf8") : decodeURIComponent(escape(C(e3)));
49722 static from(e3, t2) {
49723 return e3 instanceof this && e3.le === t2 ? e3 : new _I(e3, void 0, void 0, t2);
49725 constructor(e3, t2 = 0, i3, n3) {
49726 if ("boolean" == typeof n3 && (this.le = n3), Array.isArray(e3) && (e3 = new Uint8Array(e3)), 0 === e3)
49727 this.byteOffset = 0, this.byteLength = 0;
49728 else if (e3 instanceof ArrayBuffer) {
49729 void 0 === i3 && (i3 = e3.byteLength - t2);
49730 let n4 = new DataView(e3, t2, i3);
49731 this._swapDataView(n4);
49732 } else if (e3 instanceof Uint8Array || e3 instanceof DataView || e3 instanceof _I) {
49733 void 0 === i3 && (i3 = e3.byteLength - t2), (t2 += e3.byteOffset) + i3 > e3.byteOffset + e3.byteLength && g2("Creating view outside of available memory in ArrayBuffer");
49734 let n4 = new DataView(e3.buffer, t2, i3);
49735 this._swapDataView(n4);
49736 } else if ("number" == typeof e3) {
49737 let t3 = new DataView(new ArrayBuffer(e3));
49738 this._swapDataView(t3);
49740 g2("Invalid input argument for BufferView: " + e3);
49742 _swapArrayBuffer(e3) {
49743 this._swapDataView(new DataView(e3));
49746 this._swapDataView(new DataView(e3.buffer, e3.byteOffset, e3.byteLength));
49748 _swapDataView(e3) {
49749 this.dataView = e3, this.buffer = e3.buffer, this.byteOffset = e3.byteOffset, this.byteLength = e3.byteLength;
49752 return this.byteLength - e3;
49754 set(e3, t2, i3 = _I) {
49755 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);
49758 return t2 = t2 || this._lengthToEnd(e3), new _I(this, e3, t2);
49761 return new Uint8Array(this.buffer, this.byteOffset, this.byteLength);
49763 getUint8Array(e3, t2) {
49764 return new Uint8Array(this.buffer, this.byteOffset + e3, t2);
49766 getString(e3 = 0, t2 = this.byteLength) {
49767 return b(this.getUint8Array(e3, t2));
49769 getLatin1String(e3 = 0, t2 = this.byteLength) {
49770 let i3 = this.getUint8Array(e3, t2);
49773 getUnicodeString(e3 = 0, t2 = this.byteLength) {
49775 for (let n3 = 0; n3 < t2 && e3 + n3 < this.byteLength; n3 += 2)
49776 i3.push(this.getUint16(e3 + n3));
49780 return this.dataView.getInt8(e3);
49783 return this.dataView.getUint8(e3);
49785 getInt16(e3, t2 = this.le) {
49786 return this.dataView.getInt16(e3, t2);
49788 getInt32(e3, t2 = this.le) {
49789 return this.dataView.getInt32(e3, t2);
49791 getUint16(e3, t2 = this.le) {
49792 return this.dataView.getUint16(e3, t2);
49794 getUint32(e3, t2 = this.le) {
49795 return this.dataView.getUint32(e3, t2);
49797 getFloat32(e3, t2 = this.le) {
49798 return this.dataView.getFloat32(e3, t2);
49800 getFloat64(e3, t2 = this.le) {
49801 return this.dataView.getFloat64(e3, t2);
49803 getFloat(e3, t2 = this.le) {
49804 return this.dataView.getFloat32(e3, t2);
49806 getDouble(e3, t2 = this.le) {
49807 return this.dataView.getFloat64(e3, t2);
49809 getUintBytes(e3, t2, i3) {
49812 return this.getUint8(e3, i3);
49814 return this.getUint16(e3, i3);
49816 return this.getUint32(e3, i3);
49818 return this.getUint64 && this.getUint64(e3, i3);
49821 getUint(e3, t2, i3) {
49824 return this.getUint8(e3, i3);
49826 return this.getUint16(e3, i3);
49828 return this.getUint32(e3, i3);
49830 return this.getUint64 && this.getUint64(e3, i3);
49834 return this.dataView.toString(e3, this.constructor.name);
49839 function P(e3, t2) {
49840 g2(`${e3} '${t2}' was not loaded, try using full build of exifr.`);
49842 var k = class extends Map {
49844 super(), this.kind = e3;
49847 return this.has(e3) || P(this.kind, e3), t2 && (e3 in t2 || function(e4, t3) {
49848 g2(`Unknown ${e4} '${t3}'.`);
49849 }(this.kind, e3), t2[e3].enabled || P(this.kind, e3)), super.get(e3);
49852 return Array.from(this.keys());
49855 var w = new k("file parser");
49856 var T = new k("segment parser");
49857 var A = new k("file reader");
49858 function D(e3, n3) {
49859 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");
49861 function O(e3, i3) {
49862 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");
49865 async function x(e3, t2, i3, n3) {
49866 return A.has(i3) ? v(e3, t2, i3) : n3 ? async function(e4, t3) {
49867 let i4 = await t3(e4);
49869 }(e3, n3) : void g2(`Parser ${i3} is not loaded`);
49871 async function v(e3, t2, i3) {
49872 let n3 = new (A.get(i3))(e3, t2);
49873 return await n3.read(), n3;
49875 var M = (e3) => h(e3).then((e4) => e4.arrayBuffer());
49876 var R = (e3) => new Promise((t2, i3) => {
49877 let n3 = new FileReader();
49878 n3.onloadend = () => t2(n3.result || new ArrayBuffer()), n3.onerror = i3, n3.readAsArrayBuffer(e3);
49880 var L = class extends Map {
49882 return this.allKeys || (this.allKeys = Array.from(this.keys())), this.allKeys;
49885 return this.allValues || (this.allValues = Array.from(this.values())), this.allValues;
49888 function U(e3, t2, i3) {
49890 for (let [e4, t3] of i3)
49892 if (Array.isArray(t2))
49899 function F(e3, t2, i3) {
49900 let n3, s2 = e3.get(t2);
49902 s2.set(n3[0], n3[1]);
49904 var E = /* @__PURE__ */ new Map();
49905 var B = /* @__PURE__ */ new Map();
49906 var N = /* @__PURE__ */ new Map();
49907 var G = ["chunked", "firstChunkSize", "firstChunkSizeNode", "firstChunkSizeBrowser", "chunkSize", "chunkLimit"];
49908 var V = ["jfif", "xmp", "icc", "iptc", "ihdr"];
49909 var z = ["tiff", ...V];
49910 var H = ["ifd0", "ifd1", "exif", "gps", "interop"];
49911 var j2 = [...z, ...H];
49912 var W = ["makerNote", "userComment"];
49913 var K = ["translateKeys", "translateValues", "reviveValues", "multiSegment"];
49914 var X = [...K, "sanitize", "mergeOutput", "silentErrors"];
49917 return this.translateKeys || this.translateValues || this.reviveValues;
49920 var Y = class extends _ {
49922 return this.enabled || this.deps.size > 0;
49924 constructor(e3, t2, i3, n3) {
49925 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)
49926 if (Array.isArray(i3))
49927 this.parse = this.enabled = true, this.canBeFiltered && i3.length > 0 && this.translateTagSet(i3, this.pick);
49928 else if ("object" == typeof i3) {
49929 if (this.enabled = true, this.parse = false !== i3.parse, this.canBeFiltered) {
49930 let { pick: e4, skip: t3 } = i3;
49931 e4 && e4.length > 0 && this.translateTagSet(e4, this.pick), t3 && t3.length > 0 && this.translateTagSet(t3, this.skip);
49933 this.applyInheritables(i3);
49935 true === i3 || false === i3 ? this.parse = this.enabled = i3 : g2(`Invalid options argument: ${i3}`);
49937 applyInheritables(e3) {
49940 i3 = e3[t2], void 0 !== i3 && (this[t2] = i3);
49942 translateTagSet(e3, t2) {
49944 let i3, n3, { tagKeys: s2, tagValues: r2 } = this.dict;
49946 "string" == typeof i3 ? (n3 = r2.indexOf(i3), -1 === n3 && (n3 = s2.indexOf(Number(i3))), -1 !== n3 && t2.add(Number(s2[n3]))) : t2.add(i3);
49951 finalizeFilters() {
49952 !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);
49955 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 };
49956 var J = /* @__PURE__ */ new Map();
49957 var q = class extends _ {
49958 static useCached(e3) {
49959 let t2 = J.get(e3);
49960 return void 0 !== t2 || (t2 = new this(e3), J.set(e3, t2)), t2;
49963 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();
49965 setupFromUndefined() {
49974 this[e3] = new Y(e3, $2[e3], void 0, this);
49985 this[e3] = new Y(e3, true, void 0, this);
49987 setupFromArray(e3) {
49996 this[t2] = new Y(t2, false, void 0, this);
49997 this.setupGlobalFilters(e3, void 0, H);
49999 setupFromObject(e3) {
50001 for (t2 of (H.ifd0 = H.ifd0 || H.image, H.ifd1 = H.ifd1 || H.thumbnail, Object.assign(this, e3), G))
50002 this[t2] = Z(e3[t2], $2[t2]);
50004 this[t2] = Z(e3[t2], $2[t2]);
50006 this[t2] = Z(e3[t2], $2[t2]);
50008 this[t2] = new Y(t2, $2[t2], e3[t2], this);
50010 this[t2] = new Y(t2, $2[t2], e3[t2], this.tiff);
50011 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);
50013 batchEnableWithBool(e3, t2) {
50015 this[i3].enabled = t2;
50017 batchEnableWithUserValue(e3, t2) {
50018 for (let i3 of e3) {
50020 this[i3].enabled = false !== e4 && void 0 !== e4;
50023 setupGlobalFilters(e3, t2, i3, n3 = i3) {
50024 if (e3 && e3.length) {
50026 this[e4].enabled = false;
50027 let t3 = Q(e3, i3);
50028 for (let [e4, i4] of t3)
50029 ee(this[e4].pick, i4), this[e4].enabled = true;
50030 } else if (t2 && t2.length) {
50031 let e4 = Q(t2, i3);
50032 for (let [t3, i4] of e4)
50033 ee(this[t3].skip, i4);
50036 filterNestedSegmentTags() {
50037 let { ifd0: e3, exif: t2, xmp: i3, iptc: n3, icc: s2 } = this;
50038 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);
50040 traverseTiffDependencyTree() {
50041 let { ifd0: e3, exif: t2, gps: i3, interop: n3 } = this;
50042 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;
50044 this[e4].finalizeFilters();
50047 return !V.map((e3) => this[e3].enabled).some((e3) => true === e3) && this.tiff.enabled;
50049 checkLoadedPlugins() {
50051 this[e3].enabled && !T.has(e3) && P("segment parser", e3);
50054 function Q(e3, t2) {
50055 let i3, n3, s2, r2, a2 = [];
50057 for (r2 of (i3 = E.get(s2), n3 = [], i3))
50058 (e3.includes(r2[0]) || e3.includes(r2[1])) && n3.push(r2[0]);
50059 n3.length && a2.push([s2, n3]);
50063 function Z(e3, t2) {
50064 return void 0 !== e3 ? e3 : void 0 !== t2 ? t2 : void 0;
50066 function ee(e3, t2) {
50070 c(q, "default", $2);
50073 c(this, "parsers", {}), c(this, "output", {}), c(this, "errors", []), c(this, "pushToErrors", (e4) => this.errors.push(e4)), this.options = q.useCached(e3);
50076 this.file = await D(e3, this.options);
50079 if (this.fileParser)
50081 let { file: e3 } = this, t2 = e3.getUint16(0);
50082 for (let [i3, n3] of w)
50083 if (n3.canHandle(e3, t2))
50084 return this.fileParser = new n3(this.options, this.file, this.parsers), e3[i3] = true;
50085 this.file.close && this.file.close(), g2("Unknown file format");
50088 let { output: e3, errors: t2 } = this;
50089 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);
50091 async executeParsers() {
50092 let { output: e3 } = this;
50093 await this.fileParser.parse();
50094 let t2 = Object.values(this.parsers).map(async (t3) => {
50095 let i3 = await t3.parse();
50096 t3.assignToOutput(e3, i3);
50098 this.options.silentErrors && (t2 = t2.map((e4) => e4.catch(this.pushToErrors))), await Promise.all(t2);
50100 async extractThumbnail() {
50102 let { options: e3, file: t2 } = this, i3 = T.get("tiff", e3);
50104 if (t2.tiff ? n3 = { start: 0, type: "tiff" } : t2.jpeg && (n3 = await this.fileParser.getOrFindSegment("tiff")), void 0 === n3)
50106 let s2 = await this.fileParser.ensureSegmentChunk(n3), r2 = this.parsers.tiff = new i3(s2, e3, t2), a2 = await r2.extractThumbnail();
50107 return t2.close && t2.close(), a2;
50110 async function ie(e3, t2) {
50111 let i3 = new te(t2);
50112 return await i3.read(e3), i3.parse();
50114 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 });
50116 constructor(e3, t2, i3) {
50117 c(this, "errors", []), c(this, "ensureSegmentChunk", async (e4) => {
50118 let t3 = e4.start, i4 = e4.size || 65536;
50119 if (this.file.chunked)
50120 if (this.file.available(t3, i4))
50121 e4.chunk = this.file.subarray(t3, i4);
50124 e4.chunk = await this.file.readChunk(t3, i4);
50126 g2(`Couldn't read segment: ${JSON.stringify(e4)}. ${t4.message}`);
50129 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));
50131 }), this.extendOptions && this.extendOptions(e3), this.options = e3, this.file = t2, this.parsers = i3;
50133 injectSegment(e3, t2) {
50134 this.options[e3].enabled && this.createParser(e3, t2);
50136 createParser(e3, t2) {
50137 let i3 = new (T.get(e3))(t2, this.options, this.file);
50138 return this.parsers[e3] = i3;
50140 createParsers(e3) {
50141 for (let t2 of e3) {
50142 let { type: e4, chunk: i3 } = t2, n3 = this.options[e4];
50143 if (n3 && n3.enabled) {
50144 let t3 = this.parsers[e4];
50145 t3 && t3.append || t3 || this.createParser(e4, i3);
50149 async readSegments(e3) {
50150 let t2 = e3.map(this.ensureSegmentChunk);
50151 await Promise.all(t2);
50155 static findPosition(e3, t2) {
50156 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;
50157 return { offset: t2, length: i3, headerLength: n3, start: s2, size: r2, end: s2 + r2 };
50159 static parse(e3, t2 = {}) {
50160 return new this(e3, new q({ [this.type]: t2 }), e3).parse();
50162 normalizeInput(e3) {
50163 return e3 instanceof I ? e3 : new I(e3);
50165 constructor(e3, t2 = {}, i3) {
50166 c(this, "errors", []), c(this, "raw", /* @__PURE__ */ new Map()), c(this, "handleError", (e4) => {
50167 if (!this.options.silentErrors)
50169 this.errors.push(e4.message);
50170 }), 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;
50173 this.canTranslate && (this.translated = this.translateBlock(this.raw, this.type));
50176 return this.translated ? this.translated : this.raw ? Object.fromEntries(this.raw) : void 0;
50178 translateBlock(e3, t2) {
50179 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 = {};
50180 for (let [t3, r3] of e3)
50181 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;
50184 translateValue(e3, t2) {
50185 return t2[e3] || t2.DEFAULT || e3;
50187 assignToOutput(e3, t2) {
50188 this.assignObjectToOutput(e3, this.constructor.type, t2);
50190 assignObjectToOutput(e3, t2, i3) {
50191 if (this.globalOptions.mergeOutput)
50192 return Object.assign(e3, i3);
50193 e3[t2] ? Object.assign(e3[t2], i3) : e3[t2] = i3;
50196 c(re2, "headerLength", 4), c(re2, "type", void 0), c(re2, "multiSegment", false), c(re2, "canHandle", () => false);
50198 return 192 === e3 || 194 === e3 || 196 === e3 || 219 === e3 || 221 === e3 || 218 === e3 || 254 === e3;
50201 return e3 >= 224 && e3 <= 239;
50203 function le(e3, t2, i3) {
50204 for (let [n3, s2] of T)
50205 if (s2.canHandle(e3, t2, i3))
50208 var he = class extends se {
50209 constructor(...e3) {
50210 super(...e3), c(this, "appSegments", []), c(this, "jpegSegments", []), c(this, "unknownSegments", []);
50212 static canHandle(e3, t2) {
50213 return 65496 === t2;
50216 await this.findAppSegments(), await this.readSegments(this.appSegments), this.mergeMultiSegments(), this.createParsers(this.mergedAppSegments || this.appSegments);
50218 setupSegmentFinderArgs(e3) {
50219 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;
50221 async findAppSegments(e3 = 0, t2) {
50222 this.setupSegmentFinderArgs(t2);
50223 let { file: i3, findAll: n3, wanted: s2, remaining: r2 } = this;
50224 if (!n3 && this.file.chunked && (n3 = Array.from(s2).some((e4) => {
50225 let t3 = T.get(e4), i4 = this.options[e4];
50226 return t3.multiSegment && i4.multiSegment;
50227 }), n3 && await this.file.readWhole()), e3 = this.findAppSegmentsInRange(e3, i3.byteLength), !this.options.onlyTiff && i3.chunked) {
50229 for (; r2.size > 0 && !t3 && (i3.canReadNextChunk || this.unfinishedMultiSegment); ) {
50230 let { nextChunkOffset: n4 } = i3, s3 = this.appSegments.some((e4) => !this.file.available(e4.offset || e4.start, e4.length || e4.size));
50231 if (t3 = e3 > n4 && !s3 ? !await i3.readNextChunk(e3) : !await i3.readNextChunk(n4), void 0 === (e3 = this.findAppSegmentsInRange(e3, i3.byteLength)))
50236 findAppSegmentsInRange(e3, t2) {
50238 let i3, n3, s2, r2, a2, o2, { file: l2, findAll: h2, wanted: u2, remaining: c2, options: f3 } = this;
50239 for (; e3 < t2; e3++)
50240 if (255 === l2.getUint8(e3)) {
50241 if (i3 = l2.getUint8(e3 + 1), oe(i3)) {
50242 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)))
50244 f3.recordUnknownSegments && (a2 = re2.findPosition(l2, e3), a2.marker = i3, this.unknownSegments.push(a2)), e3 += n3 + 1;
50245 } else if (ae(i3)) {
50246 if (n3 = l2.getUint16(e3 + 2), 218 === i3 && false !== f3.stopAfterSos)
50248 f3.recordJpegSegments && this.jpegSegments.push({ offset: e3, length: n3, marker: i3 }), e3 += n3 + 1;
50253 mergeMultiSegments() {
50254 if (!this.appSegments.some((e4) => e4.multiSegment))
50256 let e3 = function(e4, t2) {
50257 let i3, n3, s2, r2 = /* @__PURE__ */ new Map();
50258 for (let a2 = 0; a2 < e4.length; a2++)
50259 i3 = e4[a2], n3 = i3[t2], r2.has(n3) ? s2 = r2.get(n3) : r2.set(n3, s2 = []), s2.push(i3);
50260 return Array.from(r2);
50261 }(this.appSegments, "type");
50262 this.mergedAppSegments = e3.map(([e4, t2]) => {
50263 let i3 = T.get(e4, this.options);
50264 if (i3.handleMultiSegments) {
50265 return { type: e4, chunk: i3.handleMultiSegments(t2) };
50271 return this.appSegments.find((t2) => t2.type === e3);
50273 async getOrFindSegment(e3) {
50274 let t2 = this.getSegment(e3);
50275 return void 0 === t2 && (await this.findAppSegments(0, [e3]), t2 = this.getSegment(e3)), t2;
50278 c(he, "type", "jpeg"), w.set("jpeg", he);
50279 var ue = [void 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4];
50280 var ce = class extends re2 {
50282 var e3 = this.chunk.getUint16();
50283 18761 === e3 ? this.le = true : 19789 === e3 && (this.le = false), this.chunk.le = this.le, this.headerParsed = true;
50285 parseTags(e3, t2, i3 = /* @__PURE__ */ new Map()) {
50286 let { pick: n3, skip: s2 } = this.options[t2];
50288 let r2 = n3.size > 0, a2 = 0 === s2.size, o2 = this.chunk.getUint16(e3);
50290 for (let l2 = 0; l2 < o2; l2++) {
50291 let o3 = this.chunk.getUint16(e3);
50293 if (n3.has(o3) && (i3.set(o3, this.parseTag(e3, o3, t2)), n3.delete(o3), 0 === n3.size))
50296 !a2 && s2.has(o3) || i3.set(o3, this.parseTag(e3, o3, t2));
50301 parseTag(e3, t2, i3) {
50302 let { chunk: n3 } = this, s2 = n3.getUint16(e3 + 2), r2 = n3.getUint32(e3 + 4), a2 = ue[s2];
50303 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)
50304 return n3.getUint8Array(e3, r2);
50306 return m(n3.getString(e3, r2));
50308 return n3.getUint8Array(e3, r2);
50310 return this.parseTagValue(s2, e3);
50312 let t3 = new (function(e4) {
50317 return Uint16Array;
50319 return Uint32Array;
50331 return Float32Array;
50333 return Float64Array;
50337 }(s2))(r2), i4 = a2;
50338 for (let n4 = 0; n4 < r2; n4++)
50339 t3[n4] = this.parseTagValue(s2, e3), e3 += i4;
50343 parseTagValue(e3, t2) {
50344 let { chunk: i3 } = this;
50347 return i3.getUint8(t2);
50349 return i3.getUint16(t2);
50351 return i3.getUint32(t2);
50353 return i3.getUint32(t2) / i3.getUint32(t2 + 4);
50355 return i3.getInt8(t2);
50357 return i3.getInt16(t2);
50359 return i3.getInt32(t2);
50361 return i3.getInt32(t2) / i3.getInt32(t2 + 4);
50363 return i3.getFloat(t2);
50365 return i3.getDouble(t2);
50367 return i3.getUint32(t2);
50369 g2(`Invalid tiff type ${e3}`);
50373 var fe = class extends ce {
50374 static canHandle(e3, t2) {
50375 return 225 === e3.getUint8(t2 + 1) && 1165519206 === e3.getUint32(t2 + 4) && 0 === e3.getUint16(t2 + 8);
50378 this.parseHeader();
50379 let { options: e3 } = this;
50380 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();
50383 let t2 = this[e3]();
50384 return void 0 !== t2.catch && (t2 = t2.catch(this.handleError)), t2;
50387 void 0 === this.ifd0Offset && (this.ifd0Offset = this.chunk.getUint32(4));
50390 if (void 0 === this.ifd1Offset) {
50391 this.findIfd0Offset();
50392 let e3 = this.chunk.getUint16(this.ifd0Offset), t2 = this.ifd0Offset + 2 + 12 * e3;
50393 this.ifd1Offset = this.chunk.getUint32(t2);
50396 parseBlock(e3, t2) {
50397 let i3 = /* @__PURE__ */ new Map();
50398 return this[t2] = i3, this.parseTags(e3, t2, i3), i3;
50400 async parseIfd0Block() {
50403 let { file: e3 } = this;
50404 this.findIfd0Offset(), this.ifd0Offset < 8 && g2("Malformed EXIF data"), !e3.chunked && this.ifd0Offset > e3.byteLength && g2(`IFD0 offset points to outside of file.
50405 this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tiff && await e3.ensureChunk(this.ifd0Offset, S(this.options));
50406 let t2 = this.parseBlock(this.ifd0Offset, "ifd0");
50407 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;
50409 async parseExifBlock() {
50412 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.exifOffset)
50414 this.file.tiff && await this.file.ensureChunk(this.exifOffset, S(this.options));
50415 let e3 = this.parseBlock(this.exifOffset, "exif");
50416 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;
50419 let i3 = e3.get(t2);
50420 i3 && 1 === i3.length && e3.set(t2, i3[0]);
50422 async parseGpsBlock() {
50425 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.gpsOffset)
50427 let e3 = this.parseBlock(this.gpsOffset, "gps");
50428 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;
50430 async parseInteropBlock() {
50431 if (!this.interop && (this.ifd0 || await this.parseIfd0Block(), void 0 !== this.interopOffset || this.exif || await this.parseExifBlock(), void 0 !== this.interopOffset))
50432 return this.parseBlock(this.interopOffset, "interop");
50434 async parseThumbnailBlock(e3 = false) {
50435 if (!this.ifd1 && !this.ifd1Parsed && (!this.options.mergeOutput || e3))
50436 return this.findIfd1Offset(), this.ifd1Offset > 0 && (this.parseBlock(this.ifd1Offset, "ifd1"), this.ifd1Parsed = true), this.ifd1;
50438 async extractThumbnail() {
50439 if (this.headerParsed || this.parseHeader(), this.ifd1Parsed || await this.parseThumbnailBlock(true), void 0 === this.ifd1)
50441 let e3 = this.ifd1.get(513), t2 = this.ifd1.get(514);
50442 return this.chunk.getUint8Array(e3, t2);
50451 let e3, t2, i3, n3 = {};
50453 if (e3 = this[t2], !p(e3))
50454 if (i3 = this.canTranslate ? this.translateBlock(e3, t2) : Object.fromEntries(e3), this.options.mergeOutput) {
50457 Object.assign(n3, i3);
50460 return this.makerNote && (n3.makerNote = this.makerNote), this.userComment && (n3.userComment = this.userComment), n3;
50462 assignToOutput(e3, t2) {
50463 if (this.globalOptions.mergeOutput)
50464 Object.assign(e3, t2);
50466 for (let [i3, n3] of Object.entries(t2))
50467 this.assignObjectToOutput(e3, i3, n3);
50470 function de(e3, t2, i3, n3) {
50471 var s2 = e3 + t2 / 60 + i3 / 3600;
50472 return "S" !== n3 && "W" !== n3 || (s2 *= -1), s2;
50474 c(fe, "type", "tiff"), c(fe, "headerLength", 10), T.set("tiff", fe);
50475 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 });
50476 var ge = { ifd0: false, ifd1: false, exif: false, gps: false, interop: false, sanitize: false, reviveValues: true, translateKeys: false, translateValues: false, mergeOutput: false };
50477 var me = Object.assign({}, ge, { firstChunkSize: 4e4, gps: [1, 2, 3, 4] });
50478 async function Se(e3) {
50479 let t2 = new te(me);
50481 let i3 = await t2.parse();
50482 if (i3 && i3.gps) {
50483 let { latitude: e4, longitude: t3 } = i3.gps;
50484 return { latitude: e4, longitude: t3 };
50487 var Ce = Object.assign({}, ge, { tiff: false, ifd1: true, mergeOutput: false });
50488 async function ye(e3) {
50489 let t2 = new te(Ce);
50491 let i3 = await t2.extractThumbnail();
50492 return i3 && a ? s.from(i3) : i3;
50494 async function be(e3) {
50495 let t2 = await this.thumbnail(e3);
50496 if (void 0 !== t2) {
50497 let e4 = new Blob([t2]);
50498 return URL.createObjectURL(e4);
50501 var Ie = Object.assign({}, ge, { firstChunkSize: 4e4, ifd0: [274] });
50502 async function Pe(e3) {
50503 let t2 = new te(Ie);
50505 let i3 = await t2.parse();
50507 return i3.ifd0[274];
50509 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 } });
50512 if ("object" == typeof navigator) {
50513 let e3 = navigator.userAgent;
50514 if (e3.includes("iPad") || e3.includes("iPhone")) {
50515 let t2 = e3.match(/OS (\d+)_(\d+)/);
50517 let [, e4, i3] = t2, n3 = Number(e4) + 0.1 * Number(i3);
50518 we = n3 < 13.4, Te = false;
50520 } else if (e3.includes("OS X 10")) {
50521 let [, t2] = e3.match(/OS X 10[_.](\d+)/);
50522 we = Te = Number(t2) < 15;
50524 if (e3.includes("Chrome/")) {
50525 let [, t2] = e3.match(/Chrome\/(\d+)/);
50526 we = Te = Number(t2) < 81;
50527 } else if (e3.includes("Firefox/")) {
50528 let [, t2] = e3.match(/Firefox\/(\d+)/);
50529 we = Te = Number(t2) < 77;
50532 async function Ae(e3) {
50533 let t2 = await Pe(e3);
50534 return Object.assign({ canvas: we, css: Te }, ke[t2]);
50536 var De = class extends I {
50537 constructor(...e3) {
50538 super(...e3), c(this, "ranges", new Oe()), 0 !== this.byteLength && this.ranges.add(0, this.byteLength);
50540 _tryExtend(e3, t2, i3) {
50541 if (0 === e3 && 0 === this.byteLength && i3) {
50542 let e4 = new DataView(i3.buffer || i3, i3.byteOffset, i3.byteLength);
50543 this._swapDataView(e4);
50546 if (i4 > this.byteLength) {
50547 let { dataView: e4 } = this._extend(i4);
50548 this._swapDataView(e4);
50554 t2 = a ? s.allocUnsafe(e3) : new Uint8Array(e3);
50555 let i3 = new DataView(t2.buffer, t2.byteOffset, t2.byteLength);
50556 return t2.set(new Uint8Array(this.buffer, this.byteOffset, this.byteLength), 0), { uintView: t2, dataView: i3 };
50558 subarray(e3, t2, i3 = false) {
50559 return t2 = t2 || this._lengthToEnd(e3), i3 && this._tryExtend(e3, t2), this.ranges.add(e3, t2), super.subarray(e3, t2);
50561 set(e3, t2, i3 = false) {
50562 i3 && this._tryExtend(t2, e3.byteLength, e3);
50563 let n3 = super.set(e3, t2);
50564 return this.ranges.add(t2, n3.byteLength), n3;
50566 async ensureChunk(e3, t2) {
50567 this.chunked && (this.ranges.available(e3, t2) || await this.readChunk(e3, t2));
50569 available(e3, t2) {
50570 return this.ranges.available(e3, t2);
50575 c(this, "list", []);
50578 return this.list.length;
50580 add(e3, t2, i3 = 0) {
50581 let n3 = e3 + t2, s2 = this.list.filter((t3) => xe(e3, t3.offset, n3) || xe(e3, t3.end, n3));
50582 if (s2.length > 0) {
50583 e3 = Math.min(e3, ...s2.map((e4) => e4.offset)), n3 = Math.max(n3, ...s2.map((e4) => e4.end)), t2 = n3 - e3;
50584 let i4 = s2.shift();
50585 i4.offset = e3, i4.length = t2, i4.end = n3, this.list = this.list.filter((e4) => !s2.includes(e4));
50587 this.list.push({ offset: e3, length: t2, end: n3 });
50589 available(e3, t2) {
50591 return this.list.some((t3) => t3.offset <= e3 && i3 <= t3.end);
50594 function xe(e3, t2, i3) {
50595 return e3 <= t2 && t2 <= i3;
50597 var ve = class extends De {
50598 constructor(e3, t2) {
50599 super(0), c(this, "chunksRead", 0), this.input = e3, this.options = t2;
50601 async readWhole() {
50602 this.chunked = false, await this.readChunk(this.nextChunkOffset);
50604 async readChunked() {
50605 this.chunked = true, await this.readChunk(0, this.options.firstChunkSize);
50607 async readNextChunk(e3 = this.nextChunkOffset) {
50608 if (this.fullyRead)
50609 return this.chunksRead++, false;
50610 let t2 = this.options.chunkSize, i3 = await this.readChunk(e3, t2);
50611 return !!i3 && i3.byteLength === t2;
50613 async readChunk(e3, t2) {
50614 if (this.chunksRead++, 0 !== (t2 = this.safeWrapAddress(e3, t2)))
50615 return this._readChunk(e3, t2);
50617 safeWrapAddress(e3, t2) {
50618 return void 0 !== this.size && e3 + t2 > this.size ? Math.max(0, this.size - e3) : t2;
50620 get nextChunkOffset() {
50621 if (0 !== this.ranges.list.length)
50622 return this.ranges.list[0].length;
50624 get canReadNextChunk() {
50625 return this.chunksRead < this.options.chunkLimit;
50628 return void 0 !== this.size && this.nextChunkOffset === this.size;
50631 return this.options.chunked ? this.readChunked() : this.readWhole();
50636 A.set("blob", class extends ve {
50637 async readWhole() {
50638 this.chunked = false;
50639 let e3 = await R(this.input);
50640 this._swapArrayBuffer(e3);
50643 return this.chunked = true, this.size = this.input.size, super.readChunked();
50645 async _readChunk(e3, t2) {
50646 let i3 = t2 ? e3 + t2 : void 0, n3 = this.input.slice(e3, i3), s2 = await R(n3);
50647 return this.set(s2, e3, true);
50650 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() {
50652 }, get rotateCss() {
50654 }, rotation: Ae });
50655 A.set("url", class extends ve {
50656 async readWhole() {
50657 this.chunked = false;
50658 let e3 = await M(this.input);
50659 e3 instanceof ArrayBuffer ? this._swapArrayBuffer(e3) : e3 instanceof Uint8Array && this._swapBuffer(e3);
50661 async _readChunk(e3, t2) {
50662 let i3 = t2 ? e3 + t2 - 1 : void 0, n3 = this.options.httpHeaders || {};
50663 (e3 || i3) && (n3.range = `bytes=${[e3, i3].join("-")}`);
50664 let s2 = await h(this.input, { headers: n3 }), r2 = await s2.arrayBuffer(), a2 = r2.byteLength;
50665 if (416 !== s2.status)
50666 return a2 !== t2 && (this.size = e3 + a2), this.set(r2, e3, true);
50669 I.prototype.getUint64 = function(e3) {
50670 let t2 = this.getUint32(e3), i3 = this.getUint32(e3 + 4);
50671 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.");
50673 var Re = class extends se {
50674 parseBoxes(e3 = 0) {
50676 for (; e3 < this.file.byteLength - 4; ) {
50677 let i3 = this.parseBoxHead(e3);
50678 if (t2.push(i3), 0 === i3.length)
50684 parseSubBoxes(e3) {
50685 e3.boxes = this.parseBoxes(e3.start);
50688 return void 0 === e3.boxes && this.parseSubBoxes(e3), e3.boxes.find((e4) => e4.kind === t2);
50691 let t2 = this.file.getUint32(e3), i3 = this.file.getString(e3 + 4, 4), n3 = e3 + 8;
50692 return 1 === t2 && (t2 = this.file.getUint64(e3 + 8), n3 += 8), { offset: e3, length: t2, kind: i3, start: n3 };
50694 parseBoxFullHead(e3) {
50695 if (void 0 !== e3.version)
50697 let t2 = this.file.getUint32(e3.start);
50698 e3.version = t2 >> 24, e3.start += 4;
50701 var Le = class extends Re {
50702 static canHandle(e3, t2) {
50705 let i3 = e3.getUint16(2);
50708 let n3 = 16, s2 = [];
50710 s2.push(e3.getString(n3, 4)), n3 += 4;
50711 return s2.includes(this.type);
50714 let e3 = this.file.getUint32(0), t2 = this.parseBoxHead(e3);
50715 for (; "meta" !== t2.kind; )
50716 e3 += t2.length, await this.file.ensureChunk(e3, 16), t2 = this.parseBoxHead(e3);
50717 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);
50719 async registerSegment(e3, t2, i3) {
50720 await this.file.ensureChunk(t2, i3);
50721 let n3 = this.file.subarray(t2, i3);
50722 this.createParser(e3, n3);
50724 async findIcc(e3) {
50725 let t2 = this.findBox(e3, "iprp");
50728 let i3 = this.findBox(t2, "ipco");
50731 let n3 = this.findBox(i3, "colr");
50732 void 0 !== n3 && await this.registerSegment("icc", n3.offset + 12, n3.length);
50734 async findExif(e3) {
50735 let t2 = this.findBox(e3, "iinf");
50738 let i3 = this.findBox(e3, "iloc");
50741 let n3 = this.findExifLocIdInIinf(t2), s2 = this.findExtentInIloc(i3, n3);
50745 await this.file.ensureChunk(r2, a2);
50746 let o2 = 4 + this.file.getUint32(r2);
50747 r2 += o2, a2 -= o2, await this.registerSegment("tiff", r2, a2);
50749 findExifLocIdInIinf(e3) {
50750 this.parseBoxFullHead(e3);
50751 let t2, i3, n3, s2, r2 = e3.start, a2 = this.file.getUint16(r2);
50752 for (r2 += 2; a2--; ) {
50753 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))
50754 return this.file.getUintBytes(i3, n3);
50759 let t2 = this.file.getUint8(e3);
50760 return [t2 >> 4, 15 & t2];
50762 findExtentInIloc(e3, t2) {
50763 this.parseBoxFullHead(e3);
50764 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);
50765 for (i3 += u2; c2--; ) {
50766 let e4 = this.file.getUintBytes(i3, o2);
50767 i3 += o2 + l2 + 2 + r2;
50768 let u3 = this.file.getUint16(i3);
50769 if (i3 += 2, e4 === t2)
50770 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)];
50775 var Ue = class extends Le {
50777 c(Ue, "type", "heic");
50778 var Fe = class extends Le {
50780 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" }]]);
50781 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" }]]);
50782 var Be = { 1: "No absolute unit of measurement", 2: "Inch", 3: "Centimeter" };
50783 Ee.set(37392, Be), Ee.set(41488, Be);
50784 var Ne = { 0: "Normal", 1: "Low", 2: "High" };
50786 return "object" == typeof e3 && void 0 !== e3.length ? e3[0] : e3;
50789 let t2 = Array.from(e3).slice(1);
50790 return t2[1] > 15 && (t2 = t2.map((e4) => String.fromCharCode(e4))), "0" !== t2[2] && 0 !== t2[2] || t2.pop(), t2.join(".");
50793 if ("string" == typeof e3) {
50794 var [t2, i3, n3, s2, r2, a2] = e3.trim().split(/[-: ]/g).map(Number), o2 = new Date(t2, i3 - 1, n3);
50795 return Number.isNaN(s2) || Number.isNaN(r2) || Number.isNaN(a2) || (o2.setHours(s2), o2.setMinutes(r2), o2.setSeconds(a2)), Number.isNaN(+o2) ? e3 : o2;
50799 if ("string" == typeof e3)
50802 if (0 === e3[1] && 0 === e3[e3.length - 1])
50803 for (let i3 = 0; i3 < e3.length; i3 += 2)
50804 t2.push(je(e3[i3 + 1], e3[i3]));
50806 for (let i3 = 0; i3 < e3.length; i3 += 2)
50807 t2.push(je(e3[i3], e3[i3 + 1]));
50808 return m(String.fromCodePoint(...t2));
50810 function je(e3, t2) {
50811 return e3 << 8 | t2;
50813 Ee.set(41992, Ne), Ee.set(41993, Ne), Ee.set(41994, Ne), U(N, ["ifd0", "ifd1"], [[50827, function(e3) {
50814 return "string" != typeof e3 ? b(e3) : e3;
50815 }], [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(":")]]);
50816 var We = class extends re2 {
50817 static canHandle(e3, t2) {
50818 return 225 === e3.getUint8(t2 + 1) && 1752462448 === e3.getUint32(t2 + 4) && "http://ns.adobe.com/" === e3.getString(t2 + 4, "http://ns.adobe.com/".length);
50820 static headerLength(e3, t2) {
50821 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;
50823 static findPosition(e3, t2) {
50824 let i3 = super.findPosition(e3, t2);
50825 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;
50827 static handleMultiSegments(e3) {
50828 return e3.map((e4) => e4.chunk.getString()).join("");
50830 normalizeInput(e3) {
50831 return "string" == typeof e3 ? e3 : I.from(e3).getString();
50833 parse(e3 = this.chunk) {
50834 if (!this.localOptions.parse)
50836 e3 = function(e4) {
50837 let t3 = {}, i4 = {};
50839 t3[e6] = [], i4[e6] = 0;
50840 return e4.replace(et, (e6, n4, s2) => {
50843 return t3[s2].push(n5), `${e6}#${n5}`;
50845 return `${e6}#${t3[s2].pop()}`;
50848 let t2 = Xe.findAll(e3, "rdf", "Description");
50849 0 === t2.length && t2.push(new Xe("rdf", "Description", void 0, e3));
50852 for (let t3 of e4.properties)
50853 i3 = Je(t3.ns, n3), _e(t3, i3);
50854 return function(e4) {
50857 t3 = e4[i4] = f2(e4[i4]), void 0 === t3 && delete e4[i4];
50861 assignToOutput(e3, t2) {
50862 if (this.localOptions.parse)
50863 for (let [i3, n3] of Object.entries(t2))
50866 this.assignObjectToOutput(e3, "ifd0", n3);
50869 this.assignObjectToOutput(e3, "exif", n3);
50874 this.assignObjectToOutput(e3, i3, n3);
50880 c(We, "type", "xmp"), c(We, "multiSegment", true), T.set("xmp", We);
50881 var Ke = class _Ke {
50882 static findAll(e3) {
50883 return qe(e3, /([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(_Ke.unpackMatch);
50885 static unpackMatch(e3) {
50886 let t2 = e3[1], i3 = e3[2], n3 = e3[3].slice(1, -1);
50887 return n3 = Qe(n3), new _Ke(t2, i3, n3);
50889 constructor(e3, t2, i3) {
50890 this.ns = e3, this.name = t2, this.value = i3;
50896 var Xe = class _Xe {
50897 static findAll(e3, t2, i3) {
50898 if (void 0 !== t2 || void 0 !== i3) {
50899 t2 = t2 || "[\\w\\d-]+", i3 = i3 || "[\\w\\d-]+";
50900 var n3 = new RegExp(`<(${t2}):(${i3})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`, "gm");
50902 n3 = /<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;
50903 return qe(e3, n3).map(_Xe.unpackMatch);
50905 static unpackMatch(e3) {
50906 let t2 = e3[1], i3 = e3[2], n3 = e3[4], s2 = e3[8];
50907 return new _Xe(t2, i3, n3, s2);
50909 constructor(e3, t2, i3, n3) {
50910 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];
50912 get isPrimitive() {
50913 return void 0 !== this.value && 0 === this.attrs.length && 0 === this.children.length;
50915 get isListContainer() {
50916 return 1 === this.children.length && this.children[0].isList;
50919 let { ns: e3, name: t2 } = this;
50920 return "rdf" === e3 && ("Seq" === t2 || "Bag" === t2 || "Alt" === t2);
50923 return "rdf" === this.ns && "li" === this.name;
50926 if (0 === this.properties.length && void 0 === this.value)
50928 if (this.isPrimitive)
50930 if (this.isListContainer)
50931 return this.children[0].serialize();
50933 return $e(this.children.map(Ye));
50934 if (this.isListItem && 1 === this.children.length && 0 === this.attrs.length)
50935 return this.children[0].serialize();
50937 for (let t2 of this.properties)
50939 return void 0 !== this.value && (e3.value = this.value), f2(e3);
50942 function _e(e3, t2) {
50943 let i3 = e3.serialize();
50944 void 0 !== i3 && (t2[e3.name] = i3);
50946 var Ye = (e3) => e3.serialize();
50947 var $e = (e3) => 1 === e3.length ? e3[0] : e3;
50948 var Je = (e3, t2) => t2[e3] ? t2[e3] : t2[e3] = {};
50949 function qe(e3, t2) {
50953 for (; null !== (i3 = t2.exec(e3)); )
50959 return null == e4 || "null" === e4 || "undefined" === e4 || "" === e4 || "" === e4.trim();
50962 let t2 = Number(e3);
50963 if (!Number.isNaN(t2))
50965 let i3 = e3.toLowerCase();
50966 return "true" === i3 || "false" !== i3 && e3.trim();
50968 var Ze = ["rdf:li", "rdf:Seq", "rdf:Bag", "rdf:Alt", "rdf:Description"];
50969 var et = new RegExp(`(<|\\/)(${Ze.join("|")})`, "g");
50970 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() {
50972 }, get rotateCss() {
50974 }, rotation: Ae });
50975 var at = l("fs", (e3) => e3.promises);
50976 A.set("fs", class extends ve {
50977 async readWhole() {
50978 this.chunked = false, this.fs = await at;
50979 let e3 = await this.fs.readFile(this.input);
50980 this._swapBuffer(e3);
50982 async readChunked() {
50983 this.chunked = true, this.fs = await at, await this.open(), await this.readChunk(0, this.options.firstChunkSize);
50986 void 0 === this.fh && (this.fh = await this.fs.open(this.input, "r"), this.size = (await this.fh.stat(this.input)).size);
50988 async _readChunk(e3, t2) {
50989 void 0 === this.fh && await this.open(), e3 + t2 > this.size && (t2 = this.size - e3);
50990 var i3 = this.subarray(e3, t2, true);
50991 return await this.fh.read(i3.dataView, 0, t2, e3), i3;
50996 this.fh = void 0, await e3.close();
51000 A.set("base64", class extends ve {
51001 constructor(...e3) {
51002 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);
51004 async _readChunk(e3, t2) {
51005 let i3, n3, r2 = this.input;
51006 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);
51007 let o2 = e3 + t2, l2 = i3 + 4 * Math.ceil(o2 / 3);
51008 r2 = r2.slice(i3, l2);
51009 let h2 = Math.min(t2, this.size - e3);
51011 let t3 = s.from(r2, "base64").slice(n3, n3 + h2);
51012 return this.set(t3, e3, true);
51015 let t3 = this.subarray(e3, h2, true), i4 = atob(r2), s2 = t3.toUint8();
51016 for (let e4 = 0; e4 < h2; e4++)
51017 s2[e4] = i4.charCodeAt(n3 + e4);
51022 var ot = class extends se {
51023 static canHandle(e3, t2) {
51024 return 18761 === t2 || 19789 === t2;
51026 extendOptions(e3) {
51027 let { ifd0: t2, xmp: i3, iptc: n3, icc: s2 } = e3;
51028 i3.enabled && t2.deps.add(700), n3.enabled && t2.deps.add(33723), s2.enabled && t2.deps.add(34675), t2.finalizeFilters();
51031 let { tiff: e3, xmp: t2, iptc: i3, icc: n3 } = this.options;
51032 if (e3.enabled || t2.enabled || i3.enabled || n3.enabled) {
51033 let e4 = Math.max(S(this.options), this.options.chunkSize);
51034 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");
51037 adaptTiffPropAsSegment(e3) {
51038 if (this.parsers.tiff[e3]) {
51039 let t2 = this.parsers.tiff[e3];
51040 this.injectSegment(e3, t2);
51044 c(ot, "type", "tiff"), w.set("tiff", ot);
51045 var lt = l("zlib");
51046 var ht = ["ihdr", "iccp", "text", "itxt", "exif"];
51047 var ut = class extends se {
51048 constructor(...e3) {
51049 super(...e3), c(this, "catchError", (e4) => this.errors.push(e4)), c(this, "metaChunks", []), c(this, "unknownChunks", []);
51051 static canHandle(e3, t2) {
51052 return 35152 === t2 && 2303741511 === e3.getUint32(0) && 218765834 === e3.getUint32(4);
51055 let { file: e3 } = this;
51056 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);
51058 async findPngChunksInRange(e3, t2) {
51059 let { file: i3 } = this;
51060 for (; e3 < t2; ) {
51061 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 };
51062 ht.includes(s2) ? this.metaChunks.push(a2) : this.unknownChunks.push(a2), e3 += r2;
51065 parseTextChunks() {
51066 let e3 = this.metaChunks.filter((e4) => "text" === e4.type);
51067 for (let t2 of e3) {
51068 let [e4, i3] = this.file.getString(t2.start, t2.size).split("\0");
51069 this.injectKeyValToIhdr(e4, i3);
51072 injectKeyValToIhdr(e3, t2) {
51073 let i3 = this.parsers.ihdr;
51074 i3 && i3.raw.set(e3, t2);
51077 let e3 = this.metaChunks.find((e4) => "ihdr" === e4.type);
51078 e3 && false !== this.options.ihdr.enabled && this.createParser("ihdr", e3.chunk);
51081 let e3 = this.metaChunks.find((e4) => "exif" === e4.type);
51082 e3 && this.injectSegment("tiff", e3.chunk);
51085 let e3 = this.metaChunks.filter((e4) => "itxt" === e4.type);
51086 for (let t2 of e3) {
51087 "XML:com.adobe.xmp" === t2.chunk.getString(0, "XML:com.adobe.xmp".length) && this.injectSegment("xmp", t2.chunk);
51091 let e3 = this.metaChunks.find((e4) => "iccp" === e4.type);
51094 let { chunk: t2 } = e3, i3 = t2.getUint8Array(0, 81), s2 = 0;
51095 for (; s2 < 80 && 0 !== i3[s2]; )
51097 let r2 = s2 + 2, a2 = t2.getString(0, s2);
51098 if (this.injectKeyValToIhdr("ProfileName", a2), n2) {
51099 let e4 = await lt, i4 = t2.getUint8Array(r2);
51100 i4 = e4.inflateSync(i4), this.injectSegment("icc", i4);
51104 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"]]);
51105 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"]];
51106 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" }]]);
51107 var ft = class extends re2 {
51108 static canHandle(e3, t2) {
51109 return 224 === e3.getUint8(t2 + 1) && 1246120262 === e3.getUint32(t2 + 4) && 0 === e3.getUint8(t2 + 8);
51112 return this.parseTags(), this.translate(), this.output;
51115 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)]]);
51118 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"]]);
51119 var dt = class extends re2 {
51121 return this.parseTags(), this.translate(), this.output;
51124 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)]);
51127 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" }]]);
51128 var pt = class extends re2 {
51129 static canHandle(e3, t2) {
51130 return 226 === e3.getUint8(t2 + 1) && 1229144927 === e3.getUint32(t2 + 4);
51132 static findPosition(e3, t2) {
51133 let i3 = super.findPosition(e3, t2);
51134 return i3.chunkNumber = e3.getUint8(t2 + 16), i3.chunkCount = e3.getUint8(t2 + 17), i3.multiSegment = i3.chunkCount > 1, i3;
51136 static handleMultiSegments(e3) {
51137 return function(e4) {
51138 let t2 = function(e6) {
51139 let t3 = e6[0].constructor, i3 = 0;
51142 let n3 = new t3(i3), s2 = 0;
51144 n3.set(t4, s2), s2 += t4.length;
51146 }(e4.map((e6) => e6.chunk.toUint8()));
51151 return this.raw = /* @__PURE__ */ new Map(), this.parseHeader(), this.parseTags(), this.translate(), this.output;
51154 let { raw: e3 } = this;
51155 this.chunk.byteLength < 84 && g2("ICC header is too short");
51156 for (let [t2, i3] of Object.entries(gt)) {
51157 t2 = parseInt(t2, 10);
51158 let n3 = i3(this.chunk, t2);
51159 "\0\0\0\0" !== n3 && e3.set(t2, n3);
51163 let e3, t2, i3, n3, s2, { raw: r2 } = this, a2 = this.chunk.getUint32(128), o2 = 132, l2 = this.chunk.byteLength;
51165 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)
51166 return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");
51167 s2 = this.parseTag(n3, t2, i3), void 0 !== s2 && "\0\0\0\0" !== s2 && r2.set(e3, s2), o2 += 12;
51170 parseTag(e3, t2, i3) {
51173 return this.parseDesc(t2);
51175 return this.parseMluc(t2);
51177 return this.parseText(t2, i3);
51179 return this.parseSig(t2);
51181 if (!(t2 + i3 > this.chunk.byteLength))
51182 return this.chunk.getUint8Array(t2, i3);
51185 let t2 = this.chunk.getUint32(e3 + 8) - 1;
51186 return m(this.chunk.getString(e3 + 12, t2));
51188 parseText(e3, t2) {
51189 return m(this.chunk.getString(e3 + 8, t2 - 8));
51192 return m(this.chunk.getString(e3 + 8, 4));
51195 let { chunk: t2 } = this, i3 = t2.getUint32(e3 + 8), n3 = t2.getUint32(e3 + 12), s2 = e3 + 16, r2 = [];
51196 for (let a2 = 0; a2 < i3; a2++) {
51197 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));
51198 r2.push({ lang: i4, country: a3, text: h2 }), s2 += n3;
51200 return 1 === i3 ? r2[0].text : r2;
51202 translateValue(e3, t2) {
51203 return "string" == typeof e3 ? t2[e3] || t2[e3.toLowerCase()] || e3 : t2[e3] || e3;
51206 c(pt, "type", "icc"), c(pt, "multiSegment", true), c(pt, "headerLength", 18);
51207 var gt = { 4: mt, 8: function(e3, t2) {
51208 return [e3.getUint8(t2), e3.getUint8(t2 + 1) >> 4, e3.getUint8(t2 + 1) % 16].map((e4) => e4.toString(10)).join(".");
51209 }, 12: mt, 16: mt, 20: mt, 24: function(e3, t2) {
51210 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);
51211 return new Date(Date.UTC(i3, n3, s2, r2, a2, o2));
51212 }, 36: mt, 40: mt, 48: mt, 52: mt, 64: (e3, t2) => e3.getUint32(t2), 80: mt };
51213 function mt(e3, t2) {
51214 return m(e3.getString(t2, 4));
51216 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"]]);
51217 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" };
51218 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!)" };
51219 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" }]]);
51220 var yt = class extends re2 {
51221 static canHandle(e3, t2, i3) {
51222 return 237 === e3.getUint8(t2 + 1) && "Photoshop" === e3.getString(t2 + 4, 9) && void 0 !== this.containsIptc8bim(e3, t2, i3);
51224 static headerLength(e3, t2, i3) {
51225 let n3, s2 = this.containsIptc8bim(e3, t2, i3);
51227 return n3 = e3.getUint8(t2 + s2 + 7), n3 % 2 != 0 && (n3 += 1), 0 === n3 && (n3 = 4), s2 + 8 + n3;
51229 static containsIptc8bim(e3, t2, i3) {
51230 for (let n3 = 0; n3 < i3; n3++)
51231 if (this.isIptcSegmentHead(e3, t2 + n3))
51234 static isIptcSegmentHead(e3, t2) {
51235 return 56 === e3.getUint8(t2) && 943868237 === e3.getUint32(t2) && 1028 === e3.getUint16(t2 + 4);
51238 let { raw: e3 } = this, t2 = this.chunk.byteLength - 1, i3 = false;
51239 for (let n3 = 0; n3 < t2; n3++)
51240 if (28 === this.chunk.getUint8(n3) && 2 === this.chunk.getUint8(n3 + 1)) {
51242 let t3 = this.chunk.getUint16(n3 + 3), s2 = this.chunk.getUint8(n3 + 2), r2 = this.chunk.getLatin1String(n3 + 5, t3);
51243 e3.set(s2, this.pluralizeValue(e3.get(s2), r2)), n3 += 4 + t3;
51246 return this.translate(), this.output;
51248 pluralizeValue(e3, t2) {
51249 return void 0 !== e3 ? e3 instanceof Array ? (e3.push(t2), e3) : [e3, t2] : t2;
51252 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" }]]);
51253 var full_esm_default = tt;
51255 // modules/services/plane_photo.js
51256 var dispatch6 = dispatch_default("viewerChanged");
51260 var _widthOverflow;
51261 function zoomPan(d3_event) {
51262 let t2 = d3_event.transform;
51263 _photo.call(utilSetTransform, t2.x, t2.y, t2.k);
51265 function zoomBeahvior() {
51266 const { width: wrapperWidth, height: wrapperHeight } = _wrapper.node().getBoundingClientRect();
51267 const { naturalHeight, naturalWidth } = _photo.node();
51268 const intrinsicRatio = naturalWidth / naturalHeight;
51269 _widthOverflow = wrapperHeight * intrinsicRatio - wrapperWidth;
51270 return zoom_default2().extent([[0, 0], [wrapperWidth, wrapperHeight]]).translateExtent([[0, 0], [wrapperWidth + _widthOverflow, wrapperHeight]]).scaleExtent([1, 15]).on("zoom", zoomPan);
51272 function loadImage(selection2, path) {
51273 return new Promise((resolve) => {
51274 selection2.attr("src", path);
51275 selection2.on("load", () => {
51276 resolve(selection2);
51280 var plane_photo_default = {
51281 init: async function(context, selection2) {
51282 this.event = utilRebind(this, dispatch6, "on");
51283 _wrapper = selection2.append("div").attr("class", "photo-frame plane-frame").classed("hide", true);
51284 _photo = _wrapper.append("img").attr("class", "plane-photo");
51285 context.ui().photoviewer.on("resize.plane", () => {
51286 imgZoom = zoomBeahvior();
51287 _wrapper.call(imgZoom);
51289 await Promise.resolve();
51292 showPhotoFrame: function(context) {
51293 const isHidden = context.selectAll(".photo-frame.plane-frame.hide").size();
51295 context.selectAll(".photo-frame:not(.plane-frame)").classed("hide", true);
51296 context.selectAll(".photo-frame.plane-frame").classed("hide", false);
51300 hidePhotoFrame: function(context) {
51301 context.select("photo-frame.plane-frame").classed("hide", false);
51304 selectPhoto: function(data, keepOrientation) {
51305 dispatch6.call("viewerChanged");
51306 loadImage(_photo, "");
51307 loadImage(_photo, data.image_path).then(() => {
51308 if (!keepOrientation) {
51309 imgZoom = zoomBeahvior();
51310 _wrapper.call(imgZoom);
51311 _wrapper.call(imgZoom.transform, identity2.translate(-_widthOverflow / 2, 0));
51316 getYaw: function() {
51321 // modules/svg/local_photos.js
51322 var _initialized2 = false;
51323 var _enabled2 = false;
51324 var minViewfieldZoom = 16;
51325 function svgLocalPhotos(projection2, context, dispatch14) {
51326 const detected = utilDetect();
51327 let layer = select_default2(null);
51330 let _idAutoinc = 0;
51336 function over(d3_event) {
51337 d3_event.stopPropagation();
51338 d3_event.preventDefault();
51339 d3_event.dataTransfer.dropEffect = "copy";
51341 context.container().attr("dropzone", "copy").on("drop.svgLocalPhotos", function(d3_event) {
51342 d3_event.stopPropagation();
51343 d3_event.preventDefault();
51344 if (!detected.filedrop)
51346 drawPhotos.fileList(d3_event.dataTransfer.files, (loaded) => {
51347 if (loaded.length > 0) {
51348 drawPhotos.fitZoom(false);
51351 }).on("dragenter.svgLocalPhotos", over).on("dragexit.svgLocalPhotos", over).on("dragover.svgLocalPhotos", over);
51352 _initialized2 = true;
51354 function ensureViewerLoaded(context2) {
51356 return Promise.resolve(_photoFrame);
51358 const viewer = context2.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]);
51359 const viewerEnter = viewer.enter().append("div").attr("class", "photo-wrapper local-photos-wrapper").classed("hide", true);
51360 viewerEnter.append("div").attr("class", "photo-attribution fillD");
51361 return plane_photo_default.init(context2, viewerEnter).then((planePhotoFrame) => {
51362 _photoFrame = planePhotoFrame;
51365 function click(d3_event, image, zoomTo) {
51366 ensureViewerLoaded(context).then(() => {
51367 const viewer = context.container().select(".photoviewer").datum(image).classed("hide", false);
51368 const viewerWrap = viewer.select(".local-photos-wrapper").classed("hide", false);
51369 const attribution = viewerWrap.selectAll(".photo-attribution").text("");
51371 attribution.append("span").classed("filename", true).text(image.name);
51373 _photoFrame.selectPhoto({ image_path: "" });
51374 image.getSrc().then((src) => {
51375 _photoFrame.selectPhoto({ image_path: src }).showPhotoFrame(viewerWrap);
51380 context.map().centerEase(image.loc);
51383 function transform2(d2) {
51384 var svgpoint = projection2(d2.loc);
51385 return "translate(" + svgpoint[0] + "," + svgpoint[1] + ")";
51387 function setStyles(hovered) {
51388 const viewer = context.container().select(".photoviewer");
51389 const selected = viewer.empty() ? void 0 : viewer.datum();
51390 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);
51392 function display_markers(imageList) {
51393 imageList = imageList.filter((image) => isArray_default(image.loc) && isNumber_default(image.loc[0]) && isNumber_default(image.loc[1]));
51394 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(imageList, function(d2) {
51397 groups.exit().remove();
51398 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", (d3_event, d2) => setStyles(d2)).on("mouseleave", () => setStyles(null)).on("click", click);
51399 groupsEnter.append("g").attr("class", "viewfield-scale");
51400 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
51401 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
51402 const showViewfields = context.map().zoom() >= minViewfieldZoom;
51403 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
51404 viewfields.exit().remove();
51405 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", function() {
51406 const d2 = this.parentNode.__data__;
51407 return `rotate(${Math.round(d2.direction ?? 0)},0,0),scale(1.5,1.5),translate(-8,-13)`;
51408 }).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() {
51409 const d2 = this.parentNode.__data__;
51410 return isNumber_default(d2.direction) ? "visible" : "hidden";
51413 function drawPhotos(selection2) {
51414 layer = selection2.selectAll(".layer-local-photos").data(_photos ? [0] : []);
51415 layer.exit().remove();
51416 const layerEnter = layer.enter().append("g").attr("class", "layer-local-photos");
51417 layerEnter.append("g").attr("class", "markers");
51418 layer = layerEnter.merge(layer);
51419 if (_photos && _photos.length !== 0) {
51420 display_markers(_photos);
51423 function readFileAsDataURL(file) {
51424 return new Promise((resolve, reject) => {
51425 const reader = new FileReader();
51426 reader.onload = () => resolve(reader.result);
51427 reader.onerror = (error) => reject(error);
51428 reader.readAsDataURL(file);
51431 async function readmultifiles(files, callback) {
51433 for (const file of files) {
51435 const exifData = await full_esm_default.parse(file);
51439 getSrc: () => readFileAsDataURL(file),
51441 loc: [exifData.longitude, exifData.latitude],
51442 direction: exifData.GPSImgDirection
51444 loaded.push(photo);
51445 const sameName = _photos.filter((i3) => i3.name === photo.name);
51446 if (sameName.length === 0) {
51447 _photos.push(photo);
51449 const thisContent = await photo.getSrc();
51450 const sameNameContent = await Promise.allSettled(sameName.map((i3) => i3.getSrc()));
51451 if (!sameNameContent.some((i3) => i3.value === thisContent)) {
51452 _photos.push(photo);
51458 if (typeof callback === "function")
51460 dispatch14.call("change");
51462 drawPhotos.setFiles = function(fileList, callback) {
51463 readmultifiles(Array.from(fileList), callback);
51466 drawPhotos.fileList = function(fileList, callback) {
51467 if (!arguments.length)
51469 _fileList = fileList;
51470 if (!fileList || !fileList.length)
51472 drawPhotos.setFiles(_fileList, callback);
51475 drawPhotos.getPhotos = function() {
51478 drawPhotos.removePhoto = function(id2) {
51479 _photos = _photos.filter((i3) => i3.id !== id2);
51480 dispatch14.call("change");
51483 drawPhotos.openPhoto = click;
51484 drawPhotos.fitZoom = function(force) {
51485 const coords = _photos.map((image) => image.loc).filter((l2) => isArray_default(l2) && isNumber_default(l2[0]) && isNumber_default(l2[1]));
51486 if (coords.length === 0)
51488 const extent = coords.map((l2) => geoExtent(l2, l2)).reduce((a2, b2) => a2.extend(b2));
51489 const map2 = context.map();
51490 var viewport = map2.trimmedExtent().polygon();
51491 if (force !== false || !geoPolygonIntersectsPolygon(viewport, coords, true)) {
51492 map2.centerZoom(extent.center(), Math.min(18, map2.trimmedExtentZoom(extent)));
51495 function showLayer() {
51496 layer.style("display", "block");
51497 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
51498 dispatch14.call("change");
51501 function hideLayer() {
51502 layer.transition().duration(250).style("opacity", 0).on("end", () => {
51503 layer.selectAll(".viewfield-group").remove();
51504 layer.style("display", "none");
51507 drawPhotos.enabled = function(val) {
51508 if (!arguments.length)
51516 dispatch14.call("change");
51519 drawPhotos.hasData = function() {
51520 return isArray_default(_photos) && _photos.length > 0;
51526 // modules/svg/improveOSM.js
51527 var _layerEnabled2 = false;
51529 function svgImproveOSM(projection2, context, dispatch14) {
51530 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51531 const minZoom4 = 12;
51532 let touchLayer = select_default2(null);
51533 let drawLayer = select_default2(null);
51534 let layerVisible = false;
51535 function markerPath(selection2, klass) {
51536 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");
51538 function getService() {
51539 if (services.improveOSM && !_qaService2) {
51540 _qaService2 = services.improveOSM;
51541 _qaService2.on("loaded", throttledRedraw);
51542 } else if (!services.improveOSM && _qaService2) {
51543 _qaService2 = null;
51545 return _qaService2;
51547 function editOn() {
51548 if (!layerVisible) {
51549 layerVisible = true;
51550 drawLayer.style("display", "block");
51553 function editOff() {
51554 if (layerVisible) {
51555 layerVisible = false;
51556 drawLayer.style("display", "none");
51557 drawLayer.selectAll(".qaItem.improveOSM").remove();
51558 touchLayer.selectAll(".qaItem.improveOSM").remove();
51561 function layerOn() {
51563 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
51565 function layerOff() {
51566 throttledRedraw.cancel();
51567 drawLayer.interrupt();
51568 touchLayer.selectAll(".qaItem.improveOSM").remove();
51569 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
51571 dispatch14.call("change");
51574 function updateMarkers() {
51575 if (!layerVisible || !_layerEnabled2)
51577 const service = getService();
51578 const selectedID = context.selectedErrorID();
51579 const data = service ? service.getItems(projection2) : [];
51580 const getTransform = svgPointTransform(projection2);
51581 const markers = drawLayer.selectAll(".qaItem.improveOSM").data(data, (d2) => d2.id);
51582 markers.exit().remove();
51583 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
51584 markersEnter.append("polygon").call(markerPath, "shadow");
51585 markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
51586 markersEnter.append("polygon").attr("fill", "currentColor").call(markerPath, "qaItem-fill");
51587 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 : "");
51588 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
51589 if (touchLayer.empty())
51591 const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
51592 const targets = touchLayer.selectAll(".qaItem.improveOSM").data(data, (d2) => d2.id);
51593 targets.exit().remove();
51594 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);
51595 function sortY(a2, b2) {
51596 return a2.id === selectedID ? 1 : b2.id === selectedID ? -1 : b2.loc[1] - a2.loc[1];
51599 function drawImproveOSM(selection2) {
51600 const service = getService();
51601 const surface = context.surface();
51602 if (surface && !surface.empty()) {
51603 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
51605 drawLayer = selection2.selectAll(".layer-improveOSM").data(service ? [0] : []);
51606 drawLayer.exit().remove();
51607 drawLayer = drawLayer.enter().append("g").attr("class", "layer-improveOSM").style("display", _layerEnabled2 ? "block" : "none").merge(drawLayer);
51608 if (_layerEnabled2) {
51609 if (service && ~~context.map().zoom() >= minZoom4) {
51611 service.loadIssues(projection2);
51618 drawImproveOSM.enabled = function(val) {
51619 if (!arguments.length)
51620 return _layerEnabled2;
51621 _layerEnabled2 = val;
51622 if (_layerEnabled2) {
51626 if (context.selectedErrorID()) {
51627 context.enter(modeBrowse(context));
51630 dispatch14.call("change");
51633 drawImproveOSM.supported = () => !!getService();
51634 return drawImproveOSM;
51637 // modules/svg/osmose.js
51638 var _layerEnabled3 = false;
51640 function svgOsmose(projection2, context, dispatch14) {
51641 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51642 const minZoom4 = 12;
51643 let touchLayer = select_default2(null);
51644 let drawLayer = select_default2(null);
51645 let layerVisible = false;
51646 function markerPath(selection2, klass) {
51647 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");
51649 function getService() {
51650 if (services.osmose && !_qaService3) {
51651 _qaService3 = services.osmose;
51652 _qaService3.on("loaded", throttledRedraw);
51653 } else if (!services.osmose && _qaService3) {
51654 _qaService3 = null;
51656 return _qaService3;
51658 function editOn() {
51659 if (!layerVisible) {
51660 layerVisible = true;
51661 drawLayer.style("display", "block");
51664 function editOff() {
51665 if (layerVisible) {
51666 layerVisible = false;
51667 drawLayer.style("display", "none");
51668 drawLayer.selectAll(".qaItem.osmose").remove();
51669 touchLayer.selectAll(".qaItem.osmose").remove();
51672 function layerOn() {
51674 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
51676 function layerOff() {
51677 throttledRedraw.cancel();
51678 drawLayer.interrupt();
51679 touchLayer.selectAll(".qaItem.osmose").remove();
51680 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
51682 dispatch14.call("change");
51685 function updateMarkers() {
51686 if (!layerVisible || !_layerEnabled3)
51688 const service = getService();
51689 const selectedID = context.selectedErrorID();
51690 const data = service ? service.getItems(projection2) : [];
51691 const getTransform = svgPointTransform(projection2);
51692 const markers = drawLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
51693 markers.exit().remove();
51694 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
51695 markersEnter.append("polygon").call(markerPath, "shadow");
51696 markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
51697 markersEnter.append("polygon").attr("fill", (d2) => service.getColor(d2.item)).call(markerPath, "qaItem-fill");
51698 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 : "");
51699 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
51700 if (touchLayer.empty())
51702 const fillClass = context.getDebug("target") ? "pink" : "nocolor";
51703 const targets = touchLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
51704 targets.exit().remove();
51705 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);
51706 function sortY(a2, b2) {
51707 return a2.id === selectedID ? 1 : b2.id === selectedID ? -1 : b2.loc[1] - a2.loc[1];
51710 function drawOsmose(selection2) {
51711 const service = getService();
51712 const surface = context.surface();
51713 if (surface && !surface.empty()) {
51714 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
51716 drawLayer = selection2.selectAll(".layer-osmose").data(service ? [0] : []);
51717 drawLayer.exit().remove();
51718 drawLayer = drawLayer.enter().append("g").attr("class", "layer-osmose").style("display", _layerEnabled3 ? "block" : "none").merge(drawLayer);
51719 if (_layerEnabled3) {
51720 if (service && ~~context.map().zoom() >= minZoom4) {
51722 service.loadIssues(projection2);
51729 drawOsmose.enabled = function(val) {
51730 if (!arguments.length)
51731 return _layerEnabled3;
51732 _layerEnabled3 = val;
51733 if (_layerEnabled3) {
51734 getService().loadStrings().then(layerOn).catch((err) => {
51739 if (context.selectedErrorID()) {
51740 context.enter(modeBrowse(context));
51743 dispatch14.call("change");
51746 drawOsmose.supported = () => !!getService();
51750 // modules/svg/streetside.js
51751 function svgStreetside(projection2, context, dispatch14) {
51752 var throttledRedraw = throttle_default(function() {
51753 dispatch14.call("change");
51756 var minMarkerZoom = 16;
51757 var minViewfieldZoom2 = 18;
51758 var layer = select_default2(null);
51759 var _viewerYaw = 0;
51760 var _selectedSequence = null;
51763 if (svgStreetside.initialized)
51765 svgStreetside.enabled = false;
51766 svgStreetside.initialized = true;
51768 function getService() {
51769 if (services.streetside && !_streetside) {
51770 _streetside = services.streetside;
51771 _streetside.event.on("viewerChanged.svgStreetside", viewerChanged).on("loadedImages.svgStreetside", throttledRedraw);
51772 } else if (!services.streetside && _streetside) {
51773 _streetside = null;
51775 return _streetside;
51777 function showLayer() {
51778 var service = getService();
51782 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
51783 dispatch14.call("change");
51786 function hideLayer() {
51787 throttledRedraw.cancel();
51788 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
51790 function editOn() {
51791 layer.style("display", "block");
51793 function editOff() {
51794 layer.selectAll(".viewfield-group").remove();
51795 layer.style("display", "none");
51797 function click(d3_event, d2) {
51798 var service = getService();
51801 if (d2.sequenceKey !== _selectedSequence) {
51804 _selectedSequence = d2.sequenceKey;
51805 service.ensureViewerLoaded(context).then(function() {
51806 service.selectImage(context, d2.key).yaw(_viewerYaw).showViewer(context);
51808 context.map().centerEase(d2.loc);
51810 function mouseover(d3_event, d2) {
51811 var service = getService();
51813 service.setStyles(context, d2);
51815 function mouseout() {
51816 var service = getService();
51818 service.setStyles(context, null);
51820 function transform2(d2) {
51821 var t2 = svgPointTransform(projection2)(d2);
51822 var rot = d2.ca + _viewerYaw;
51824 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
51828 function viewerChanged() {
51829 var service = getService();
51832 var viewer = service.viewer();
51835 _viewerYaw = viewer.getYaw();
51836 if (context.map().isTransformed())
51838 layer.selectAll(".viewfield-group.currentView").attr("transform", transform2);
51840 function filterBubbles(bubbles) {
51841 var fromDate = context.photos().fromDate();
51842 var toDate = context.photos().toDate();
51843 var usernames = context.photos().usernames();
51845 var fromTimestamp = new Date(fromDate).getTime();
51846 bubbles = bubbles.filter(function(bubble) {
51847 return new Date(bubble.captured_at).getTime() >= fromTimestamp;
51851 var toTimestamp = new Date(toDate).getTime();
51852 bubbles = bubbles.filter(function(bubble) {
51853 return new Date(bubble.captured_at).getTime() <= toTimestamp;
51857 bubbles = bubbles.filter(function(bubble) {
51858 return usernames.indexOf(bubble.captured_by) !== -1;
51863 function filterSequences(sequences) {
51864 var fromDate = context.photos().fromDate();
51865 var toDate = context.photos().toDate();
51866 var usernames = context.photos().usernames();
51868 var fromTimestamp = new Date(fromDate).getTime();
51869 sequences = sequences.filter(function(sequences2) {
51870 return new Date(sequences2.properties.captured_at).getTime() >= fromTimestamp;
51874 var toTimestamp = new Date(toDate).getTime();
51875 sequences = sequences.filter(function(sequences2) {
51876 return new Date(sequences2.properties.captured_at).getTime() <= toTimestamp;
51880 sequences = sequences.filter(function(sequences2) {
51881 return usernames.indexOf(sequences2.properties.captured_by) !== -1;
51886 function update() {
51887 var viewer = context.container().select(".photoviewer");
51888 var selected = viewer.empty() ? void 0 : viewer.datum();
51889 var z2 = ~~context.map().zoom();
51890 var showMarkers = z2 >= minMarkerZoom;
51891 var showViewfields = z2 >= minViewfieldZoom2;
51892 var service = getService();
51893 var sequences = [];
51895 if (context.photos().showsPanoramic()) {
51896 sequences = service ? service.sequences(projection2) : [];
51897 bubbles = service && showMarkers ? service.bubbles(projection2) : [];
51898 sequences = filterSequences(sequences);
51899 bubbles = filterBubbles(bubbles);
51901 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
51902 return d2.properties.key;
51904 traces.exit().remove();
51905 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
51906 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(bubbles, function(d2) {
51907 return d2.key + (d2.sequenceKey ? "v1" : "v0");
51909 groups.exit().remove();
51910 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
51911 groupsEnter.append("g").attr("class", "viewfield-scale");
51912 var markers = groups.merge(groupsEnter).sort(function(a2, b2) {
51913 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
51914 }).attr("transform", transform2).select(".viewfield-scale");
51915 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
51916 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
51917 viewfields.exit().remove();
51918 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
51919 function viewfieldPath() {
51920 var d2 = this.parentNode.__data__;
51922 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
51924 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
51928 function drawImages(selection2) {
51929 var enabled = svgStreetside.enabled;
51930 var service = getService();
51931 layer = selection2.selectAll(".layer-streetside-images").data(service ? [0] : []);
51932 layer.exit().remove();
51933 var layerEnter = layer.enter().append("g").attr("class", "layer-streetside-images").style("display", enabled ? "block" : "none");
51934 layerEnter.append("g").attr("class", "sequences");
51935 layerEnter.append("g").attr("class", "markers");
51936 layer = layerEnter.merge(layer);
51938 if (service && ~~context.map().zoom() >= minZoom4) {
51941 service.loadBubbles(projection2);
51947 drawImages.enabled = function(_2) {
51948 if (!arguments.length)
51949 return svgStreetside.enabled;
51950 svgStreetside.enabled = _2;
51951 if (svgStreetside.enabled) {
51953 context.photos().on("change.streetside", update);
51956 context.photos().on("change.streetside", null);
51958 dispatch14.call("change");
51961 drawImages.supported = function() {
51962 return !!getService();
51964 drawImages.rendered = function(zoom) {
51965 return zoom >= minZoom4;
51971 // modules/svg/vegbilder.js
51972 function svgVegbilder(projection2, context, dispatch14) {
51973 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51974 const minZoom4 = 14;
51975 const minMarkerZoom = 16;
51976 const minViewfieldZoom2 = 18;
51977 let layer = select_default2(null);
51978 let _viewerYaw = 0;
51981 if (svgVegbilder.initialized)
51983 svgVegbilder.enabled = false;
51984 svgVegbilder.initialized = true;
51986 function getService() {
51987 if (services.vegbilder && !_vegbilder) {
51988 _vegbilder = services.vegbilder;
51989 _vegbilder.event.on("viewerChanged.svgVegbilder", viewerChanged).on("loadedImages.svgVegbilder", throttledRedraw);
51990 } else if (!services.vegbilder && _vegbilder) {
51995 function showLayer() {
51996 const service = getService();
52000 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", () => dispatch14.call("change"));
52002 function hideLayer() {
52003 throttledRedraw.cancel();
52004 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52006 function editOn() {
52007 layer.style("display", "block");
52009 function editOff() {
52010 layer.selectAll(".viewfield-group").remove();
52011 layer.style("display", "none");
52013 function click(d3_event, d2) {
52014 const service = getService();
52017 service.ensureViewerLoaded(context).then(() => {
52018 service.selectImage(context, d2.key).showViewer(context);
52020 context.map().centerEase(d2.loc);
52022 function mouseover(d3_event, d2) {
52023 const service = getService();
52025 service.setStyles(context, d2);
52027 function mouseout() {
52028 const service = getService();
52030 service.setStyles(context, null);
52032 function transform2(d2, selected) {
52033 let t2 = svgPointTransform(projection2)(d2);
52035 if (d2 === selected) {
52039 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
52043 function viewerChanged() {
52044 const service = getService();
52047 const frame2 = service.photoFrame();
52048 _viewerYaw = frame2.getYaw();
52049 if (context.map().isTransformed())
52051 layer.selectAll(".viewfield-group.currentView").attr("transform", (d2) => transform2(d2, d2));
52053 function filterImages(images) {
52054 const photoContext = context.photos();
52055 const fromDateString = photoContext.fromDate();
52056 const toDateString = photoContext.toDate();
52057 const showsFlat = photoContext.showsFlat();
52058 const showsPano = photoContext.showsPanoramic();
52059 if (fromDateString) {
52060 const fromDate = new Date(fromDateString);
52061 images = images.filter((image) => image.captured_at.getTime() >= fromDate.getTime());
52063 if (toDateString) {
52064 const toDate = new Date(toDateString);
52065 images = images.filter((image) => image.captured_at.getTime() <= toDate.getTime());
52068 images = images.filter((image) => !image.is_sphere);
52071 images = images.filter((image) => image.is_sphere);
52075 function filterSequences(sequences) {
52076 const photoContext = context.photos();
52077 const fromDateString = photoContext.fromDate();
52078 const toDateString = photoContext.toDate();
52079 const showsFlat = photoContext.showsFlat();
52080 const showsPano = photoContext.showsPanoramic();
52081 if (fromDateString) {
52082 const fromDate = new Date(fromDateString);
52083 sequences = sequences.filter(({ images }) => images[0].captured_at.getTime() >= fromDate.getTime());
52085 if (toDateString) {
52086 const toDate = new Date(toDateString);
52087 sequences = sequences.filter(({ images }) => images[images.length - 1].captured_at.getTime() <= toDate.getTime());
52090 sequences = sequences.filter(({ images }) => !images[0].is_sphere);
52093 sequences = sequences.filter(({ images }) => images[0].is_sphere);
52097 function update() {
52098 const viewer = context.container().select(".photoviewer");
52099 const selected = viewer.empty() ? void 0 : viewer.datum();
52100 const z2 = ~~context.map().zoom();
52101 const showMarkers = z2 >= minMarkerZoom;
52102 const showViewfields = z2 >= minViewfieldZoom2;
52103 const service = getService();
52104 let sequences = [];
52107 service.loadImages(context);
52108 sequences = service.sequences(projection2);
52109 images = showMarkers ? service.images(projection2) : [];
52110 images = filterImages(images);
52111 sequences = filterSequences(sequences);
52113 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, (d2) => d2.key);
52114 traces.exit().remove();
52115 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52116 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, (d2) => d2.key);
52117 groups.exit().remove();
52118 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52119 groupsEnter.append("g").attr("class", "viewfield-scale");
52120 const markers = groups.merge(groupsEnter).sort((a2, b2) => {
52121 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
52122 }).attr("transform", (d2) => transform2(d2, selected)).select(".viewfield-scale");
52123 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52124 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52125 viewfields.exit().remove();
52126 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
52127 function viewfieldPath() {
52128 const d2 = this.parentNode.__data__;
52129 if (d2.is_sphere) {
52130 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
52132 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
52136 function drawImages(selection2) {
52137 const enabled = svgVegbilder.enabled;
52138 const service = getService();
52139 layer = selection2.selectAll(".layer-vegbilder").data(service ? [0] : []);
52140 layer.exit().remove();
52141 const layerEnter = layer.enter().append("g").attr("class", "layer-vegbilder").style("display", enabled ? "block" : "none");
52142 layerEnter.append("g").attr("class", "sequences");
52143 layerEnter.append("g").attr("class", "markers");
52144 layer = layerEnter.merge(layer);
52146 if (service && ~~context.map().zoom() >= minZoom4) {
52149 service.loadImages(context);
52155 drawImages.enabled = function(_2) {
52156 if (!arguments.length)
52157 return svgVegbilder.enabled;
52158 svgVegbilder.enabled = _2;
52159 if (svgVegbilder.enabled) {
52161 context.photos().on("change.vegbilder", update);
52164 context.photos().on("change.vegbilder", null);
52166 dispatch14.call("change");
52169 drawImages.supported = function() {
52170 return !!getService();
52172 drawImages.rendered = function(zoom) {
52173 return zoom >= minZoom4;
52175 drawImages.validHere = function(extent, zoom) {
52176 return zoom >= minZoom4 - 2 && getService().validHere(extent);
52182 // modules/svg/mapillary_images.js
52183 function svgMapillaryImages(projection2, context, dispatch14) {
52184 const throttledRedraw = throttle_default(function() {
52185 dispatch14.call("change");
52187 const minZoom4 = 12;
52188 const minMarkerZoom = 16;
52189 const minViewfieldZoom2 = 18;
52190 let layer = select_default2(null);
52193 if (svgMapillaryImages.initialized)
52195 svgMapillaryImages.enabled = false;
52196 svgMapillaryImages.initialized = true;
52198 function getService() {
52199 if (services.mapillary && !_mapillary) {
52200 _mapillary = services.mapillary;
52201 _mapillary.event.on("loadedImages", throttledRedraw);
52202 } else if (!services.mapillary && _mapillary) {
52207 function showLayer() {
52208 const service = getService();
52212 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52213 dispatch14.call("change");
52216 function hideLayer() {
52217 throttledRedraw.cancel();
52218 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52220 function editOn() {
52221 layer.style("display", "block");
52223 function editOff() {
52224 layer.selectAll(".viewfield-group").remove();
52225 layer.style("display", "none");
52227 function click(d3_event, image) {
52228 const service = getService();
52231 service.ensureViewerLoaded(context).then(function() {
52232 service.selectImage(context, image.id).showViewer(context);
52234 context.map().centerEase(image.loc);
52236 function mouseover(d3_event, image) {
52237 const service = getService();
52239 service.setStyles(context, image);
52241 function mouseout() {
52242 const service = getService();
52244 service.setStyles(context, null);
52246 function transform2(d2) {
52247 let t2 = svgPointTransform(projection2)(d2);
52249 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52253 function filterImages(images) {
52254 const showsPano = context.photos().showsPanoramic();
52255 const showsFlat = context.photos().showsFlat();
52256 const fromDate = context.photos().fromDate();
52257 const toDate = context.photos().toDate();
52258 if (!showsPano || !showsFlat) {
52259 images = images.filter(function(image) {
52266 images = images.filter(function(image) {
52267 return new Date(image.captured_at).getTime() >= new Date(fromDate).getTime();
52271 images = images.filter(function(image) {
52272 return new Date(image.captured_at).getTime() <= new Date(toDate).getTime();
52277 function filterSequences(sequences) {
52278 const showsPano = context.photos().showsPanoramic();
52279 const showsFlat = context.photos().showsFlat();
52280 const fromDate = context.photos().fromDate();
52281 const toDate = context.photos().toDate();
52282 if (!showsPano || !showsFlat) {
52283 sequences = sequences.filter(function(sequence) {
52284 if (sequence.properties.hasOwnProperty("is_pano")) {
52285 if (sequence.properties.is_pano)
52293 sequences = sequences.filter(function(sequence) {
52294 return new Date(sequence.properties.captured_at).getTime() >= new Date(fromDate).getTime().toString();
52298 sequences = sequences.filter(function(sequence) {
52299 return new Date(sequence.properties.captured_at).getTime() <= new Date(toDate).getTime().toString();
52304 function update() {
52305 const z2 = ~~context.map().zoom();
52306 const showMarkers = z2 >= minMarkerZoom;
52307 const showViewfields = z2 >= minViewfieldZoom2;
52308 const service = getService();
52309 let sequences = service ? service.sequences(projection2) : [];
52310 let images = service && showMarkers ? service.images(projection2) : [];
52311 images = filterImages(images);
52312 sequences = filterSequences(sequences, service);
52313 service.filterViewer(context);
52314 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
52315 return d2.properties.id;
52317 traces.exit().remove();
52318 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52319 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
52322 groups.exit().remove();
52323 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52324 groupsEnter.append("g").attr("class", "viewfield-scale");
52325 const markers = groups.merge(groupsEnter).sort(function(a2, b2) {
52326 return b2.loc[1] - a2.loc[1];
52327 }).attr("transform", transform2).select(".viewfield-scale");
52328 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52329 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52330 viewfields.exit().remove();
52331 viewfields.enter().insert("path", "circle").attr("class", "viewfield").classed("pano", function() {
52332 return this.parentNode.__data__.is_pano;
52333 }).attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
52334 function viewfieldPath() {
52335 if (this.parentNode.__data__.is_pano) {
52336 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
52338 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
52342 function drawImages(selection2) {
52343 const enabled = svgMapillaryImages.enabled;
52344 const service = getService();
52345 layer = selection2.selectAll(".layer-mapillary").data(service ? [0] : []);
52346 layer.exit().remove();
52347 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary").style("display", enabled ? "block" : "none");
52348 layerEnter.append("g").attr("class", "sequences");
52349 layerEnter.append("g").attr("class", "markers");
52350 layer = layerEnter.merge(layer);
52352 if (service && ~~context.map().zoom() >= minZoom4) {
52355 service.loadImages(projection2);
52361 drawImages.enabled = function(_2) {
52362 if (!arguments.length)
52363 return svgMapillaryImages.enabled;
52364 svgMapillaryImages.enabled = _2;
52365 if (svgMapillaryImages.enabled) {
52367 context.photos().on("change.mapillary_images", update);
52370 context.photos().on("change.mapillary_images", null);
52372 dispatch14.call("change");
52375 drawImages.supported = function() {
52376 return !!getService();
52378 drawImages.rendered = function(zoom) {
52379 return zoom >= minZoom4;
52385 // modules/svg/mapillary_position.js
52386 function svgMapillaryPosition(projection2, context) {
52387 const throttledRedraw = throttle_default(function() {
52390 const minZoom4 = 12;
52391 const minViewfieldZoom2 = 18;
52392 let layer = select_default2(null);
52394 let viewerCompassAngle;
52396 if (svgMapillaryPosition.initialized)
52398 svgMapillaryPosition.initialized = true;
52400 function getService() {
52401 if (services.mapillary && !_mapillary) {
52402 _mapillary = services.mapillary;
52403 _mapillary.event.on("imageChanged", throttledRedraw);
52404 _mapillary.event.on("bearingChanged", function(e3) {
52405 viewerCompassAngle = e3.bearing;
52406 if (context.map().isTransformed())
52408 layer.selectAll(".viewfield-group.currentView").filter(function(d2) {
52410 }).attr("transform", transform2);
52412 } else if (!services.mapillary && _mapillary) {
52417 function editOn() {
52418 layer.style("display", "block");
52420 function editOff() {
52421 layer.selectAll(".viewfield-group").remove();
52422 layer.style("display", "none");
52424 function transform2(d2) {
52425 let t2 = svgPointTransform(projection2)(d2);
52426 if (d2.is_pano && viewerCompassAngle !== null && isFinite(viewerCompassAngle)) {
52427 t2 += " rotate(" + Math.floor(viewerCompassAngle) + ",0,0)";
52428 } else if (d2.ca) {
52429 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52433 function update() {
52434 const z2 = ~~context.map().zoom();
52435 const showViewfields = z2 >= minViewfieldZoom2;
52436 const service = getService();
52437 const image = service && service.getActiveImage();
52438 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(image ? [image] : [], function(d2) {
52441 groups.exit().remove();
52442 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group currentView highlighted");
52443 groupsEnter.append("g").attr("class", "viewfield-scale");
52444 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
52445 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52446 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52447 viewfields.exit().remove();
52448 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");
52450 function drawImages(selection2) {
52451 const service = getService();
52452 layer = selection2.selectAll(".layer-mapillary-position").data(service ? [0] : []);
52453 layer.exit().remove();
52454 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary-position");
52455 layerEnter.append("g").attr("class", "markers");
52456 layer = layerEnter.merge(layer);
52457 if (service && ~~context.map().zoom() >= minZoom4) {
52464 drawImages.enabled = function() {
52468 drawImages.supported = function() {
52469 return !!getService();
52471 drawImages.rendered = function(zoom) {
52472 return zoom >= minZoom4;
52478 // modules/svg/mapillary_signs.js
52479 function svgMapillarySigns(projection2, context, dispatch14) {
52480 const throttledRedraw = throttle_default(function() {
52481 dispatch14.call("change");
52483 const minZoom4 = 12;
52484 let layer = select_default2(null);
52487 if (svgMapillarySigns.initialized)
52489 svgMapillarySigns.enabled = false;
52490 svgMapillarySigns.initialized = true;
52492 function getService() {
52493 if (services.mapillary && !_mapillary) {
52494 _mapillary = services.mapillary;
52495 _mapillary.event.on("loadedSigns", throttledRedraw);
52496 } else if (!services.mapillary && _mapillary) {
52501 function showLayer() {
52502 const service = getService();
52505 service.loadSignResources(context);
52508 function hideLayer() {
52509 throttledRedraw.cancel();
52512 function editOn() {
52513 layer.style("display", "block");
52515 function editOff() {
52516 layer.selectAll(".icon-sign").remove();
52517 layer.style("display", "none");
52519 function click(d3_event, d2) {
52520 const service = getService();
52523 context.map().centerEase(d2.loc);
52524 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
52525 service.getDetections(d2.id).then((detections) => {
52526 if (detections.length) {
52527 const imageId = detections[0].image.id;
52528 if (imageId === selectedImageId) {
52529 service.highlightDetection(detections[0]).selectImage(context, imageId);
52531 service.ensureViewerLoaded(context).then(function() {
52532 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
52538 function filterData(detectedFeatures) {
52539 var fromDate = context.photos().fromDate();
52540 var toDate = context.photos().toDate();
52542 var fromTimestamp = new Date(fromDate).getTime();
52543 detectedFeatures = detectedFeatures.filter(function(feature3) {
52544 return new Date(feature3.last_seen_at).getTime() >= fromTimestamp;
52548 var toTimestamp = new Date(toDate).getTime();
52549 detectedFeatures = detectedFeatures.filter(function(feature3) {
52550 return new Date(feature3.first_seen_at).getTime() <= toTimestamp;
52553 return detectedFeatures;
52555 function update() {
52556 const service = getService();
52557 let data = service ? service.signs(projection2) : [];
52558 data = filterData(data);
52559 const transform2 = svgPointTransform(projection2);
52560 const signs = layer.selectAll(".icon-sign").data(data, function(d2) {
52563 signs.exit().remove();
52564 const enter = signs.enter().append("g").attr("class", "icon-sign icon-detected").on("click", click);
52565 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
52566 return "#" + d2.value;
52568 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
52569 signs.merge(enter).attr("transform", transform2);
52571 function drawSigns(selection2) {
52572 const enabled = svgMapillarySigns.enabled;
52573 const service = getService();
52574 layer = selection2.selectAll(".layer-mapillary-signs").data(service ? [0] : []);
52575 layer.exit().remove();
52576 layer = layer.enter().append("g").attr("class", "layer-mapillary-signs layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
52578 if (service && ~~context.map().zoom() >= minZoom4) {
52581 service.loadSigns(projection2);
52582 service.showSignDetections(true);
52586 } else if (service) {
52587 service.showSignDetections(false);
52590 drawSigns.enabled = function(_2) {
52591 if (!arguments.length)
52592 return svgMapillarySigns.enabled;
52593 svgMapillarySigns.enabled = _2;
52594 if (svgMapillarySigns.enabled) {
52596 context.photos().on("change.mapillary_signs", update);
52599 context.photos().on("change.mapillary_signs", null);
52601 dispatch14.call("change");
52604 drawSigns.supported = function() {
52605 return !!getService();
52607 drawSigns.rendered = function(zoom) {
52608 return zoom >= minZoom4;
52614 // modules/svg/mapillary_map_features.js
52615 function svgMapillaryMapFeatures(projection2, context, dispatch14) {
52616 const throttledRedraw = throttle_default(function() {
52617 dispatch14.call("change");
52619 const minZoom4 = 12;
52620 let layer = select_default2(null);
52623 if (svgMapillaryMapFeatures.initialized)
52625 svgMapillaryMapFeatures.enabled = false;
52626 svgMapillaryMapFeatures.initialized = true;
52628 function getService() {
52629 if (services.mapillary && !_mapillary) {
52630 _mapillary = services.mapillary;
52631 _mapillary.event.on("loadedMapFeatures", throttledRedraw);
52632 } else if (!services.mapillary && _mapillary) {
52637 function showLayer() {
52638 const service = getService();
52641 service.loadObjectResources(context);
52644 function hideLayer() {
52645 throttledRedraw.cancel();
52648 function editOn() {
52649 layer.style("display", "block");
52651 function editOff() {
52652 layer.selectAll(".icon-map-feature").remove();
52653 layer.style("display", "none");
52655 function click(d3_event, d2) {
52656 const service = getService();
52659 context.map().centerEase(d2.loc);
52660 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
52661 service.getDetections(d2.id).then((detections) => {
52662 if (detections.length) {
52663 const imageId = detections[0].image.id;
52664 if (imageId === selectedImageId) {
52665 service.highlightDetection(detections[0]).selectImage(context, imageId);
52667 service.ensureViewerLoaded(context).then(function() {
52668 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
52674 function filterData(detectedFeatures) {
52675 const fromDate = context.photos().fromDate();
52676 const toDate = context.photos().toDate();
52678 detectedFeatures = detectedFeatures.filter(function(feature3) {
52679 return new Date(feature3.last_seen_at).getTime() >= new Date(fromDate).getTime();
52683 detectedFeatures = detectedFeatures.filter(function(feature3) {
52684 return new Date(feature3.first_seen_at).getTime() <= new Date(toDate).getTime();
52687 return detectedFeatures;
52689 function update() {
52690 const service = getService();
52691 let data = service ? service.mapFeatures(projection2) : [];
52692 data = filterData(data);
52693 const transform2 = svgPointTransform(projection2);
52694 const mapFeatures = layer.selectAll(".icon-map-feature").data(data, function(d2) {
52697 mapFeatures.exit().remove();
52698 const enter = mapFeatures.enter().append("g").attr("class", "icon-map-feature icon-detected").on("click", click);
52699 enter.append("title").text(function(d2) {
52700 var id2 = d2.value.replace(/--/g, ".").replace(/-/g, "_");
52701 return _t("mapillary_map_features." + id2);
52703 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
52704 if (d2.value === "object--billboard") {
52705 return "#object--sign--advertisement";
52707 return "#" + d2.value;
52709 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
52710 mapFeatures.merge(enter).attr("transform", transform2);
52712 function drawMapFeatures(selection2) {
52713 const enabled = svgMapillaryMapFeatures.enabled;
52714 const service = getService();
52715 layer = selection2.selectAll(".layer-mapillary-map-features").data(service ? [0] : []);
52716 layer.exit().remove();
52717 layer = layer.enter().append("g").attr("class", "layer-mapillary-map-features layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
52719 if (service && ~~context.map().zoom() >= minZoom4) {
52722 service.loadMapFeatures(projection2);
52723 service.showFeatureDetections(true);
52727 } else if (service) {
52728 service.showFeatureDetections(false);
52731 drawMapFeatures.enabled = function(_2) {
52732 if (!arguments.length)
52733 return svgMapillaryMapFeatures.enabled;
52734 svgMapillaryMapFeatures.enabled = _2;
52735 if (svgMapillaryMapFeatures.enabled) {
52737 context.photos().on("change.mapillary_map_features", update);
52740 context.photos().on("change.mapillary_map_features", null);
52742 dispatch14.call("change");
52745 drawMapFeatures.supported = function() {
52746 return !!getService();
52748 drawMapFeatures.rendered = function(zoom) {
52749 return zoom >= minZoom4;
52752 return drawMapFeatures;
52755 // modules/svg/kartaview_images.js
52756 function svgKartaviewImages(projection2, context, dispatch14) {
52757 var throttledRedraw = throttle_default(function() {
52758 dispatch14.call("change");
52761 var minMarkerZoom = 16;
52762 var minViewfieldZoom2 = 18;
52763 var layer = select_default2(null);
52766 if (svgKartaviewImages.initialized)
52768 svgKartaviewImages.enabled = false;
52769 svgKartaviewImages.initialized = true;
52771 function getService() {
52772 if (services.kartaview && !_kartaview) {
52773 _kartaview = services.kartaview;
52774 _kartaview.event.on("loadedImages", throttledRedraw);
52775 } else if (!services.kartaview && _kartaview) {
52780 function showLayer() {
52781 var service = getService();
52785 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52786 dispatch14.call("change");
52789 function hideLayer() {
52790 throttledRedraw.cancel();
52791 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52793 function editOn() {
52794 layer.style("display", "block");
52796 function editOff() {
52797 layer.selectAll(".viewfield-group").remove();
52798 layer.style("display", "none");
52800 function click(d3_event, d2) {
52801 var service = getService();
52804 service.ensureViewerLoaded(context).then(function() {
52805 service.selectImage(context, d2.key).showViewer(context);
52807 context.map().centerEase(d2.loc);
52809 function mouseover(d3_event, d2) {
52810 var service = getService();
52812 service.setStyles(context, d2);
52814 function mouseout() {
52815 var service = getService();
52817 service.setStyles(context, null);
52819 function transform2(d2) {
52820 var t2 = svgPointTransform(projection2)(d2);
52822 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52826 function filterImages(images) {
52827 var fromDate = context.photos().fromDate();
52828 var toDate = context.photos().toDate();
52829 var usernames = context.photos().usernames();
52831 var fromTimestamp = new Date(fromDate).getTime();
52832 images = images.filter(function(item) {
52833 return new Date(item.captured_at).getTime() >= fromTimestamp;
52837 var toTimestamp = new Date(toDate).getTime();
52838 images = images.filter(function(item) {
52839 return new Date(item.captured_at).getTime() <= toTimestamp;
52843 images = images.filter(function(item) {
52844 return usernames.indexOf(item.captured_by) !== -1;
52849 function filterSequences(sequences) {
52850 var fromDate = context.photos().fromDate();
52851 var toDate = context.photos().toDate();
52852 var usernames = context.photos().usernames();
52854 var fromTimestamp = new Date(fromDate).getTime();
52855 sequences = sequences.filter(function(image) {
52856 return new Date(image.properties.captured_at).getTime() >= fromTimestamp;
52860 var toTimestamp = new Date(toDate).getTime();
52861 sequences = sequences.filter(function(image) {
52862 return new Date(image.properties.captured_at).getTime() <= toTimestamp;
52866 sequences = sequences.filter(function(image) {
52867 return usernames.indexOf(image.properties.captured_by) !== -1;
52872 function update() {
52873 var viewer = context.container().select(".photoviewer");
52874 var selected = viewer.empty() ? void 0 : viewer.datum();
52875 var z2 = ~~context.map().zoom();
52876 var showMarkers = z2 >= minMarkerZoom;
52877 var showViewfields = z2 >= minViewfieldZoom2;
52878 var service = getService();
52879 var sequences = [];
52881 if (context.photos().showsFlat()) {
52882 sequences = service ? service.sequences(projection2) : [];
52883 images = service && showMarkers ? service.images(projection2) : [];
52884 sequences = filterSequences(sequences);
52885 images = filterImages(images);
52887 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
52888 return d2.properties.key;
52890 traces.exit().remove();
52891 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52892 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
52895 groups.exit().remove();
52896 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52897 groupsEnter.append("g").attr("class", "viewfield-scale");
52898 var markers = groups.merge(groupsEnter).sort(function(a2, b2) {
52899 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
52900 }).attr("transform", transform2).select(".viewfield-scale");
52901 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52902 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52903 viewfields.exit().remove();
52904 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");
52906 function drawImages(selection2) {
52907 var enabled = svgKartaviewImages.enabled, service = getService();
52908 layer = selection2.selectAll(".layer-kartaview").data(service ? [0] : []);
52909 layer.exit().remove();
52910 var layerEnter = layer.enter().append("g").attr("class", "layer-kartaview").style("display", enabled ? "block" : "none");
52911 layerEnter.append("g").attr("class", "sequences");
52912 layerEnter.append("g").attr("class", "markers");
52913 layer = layerEnter.merge(layer);
52915 if (service && ~~context.map().zoom() >= minZoom4) {
52918 service.loadImages(projection2);
52924 drawImages.enabled = function(_2) {
52925 if (!arguments.length)
52926 return svgKartaviewImages.enabled;
52927 svgKartaviewImages.enabled = _2;
52928 if (svgKartaviewImages.enabled) {
52930 context.photos().on("change.kartaview_images", update);
52933 context.photos().on("change.kartaview_images", null);
52935 dispatch14.call("change");
52938 drawImages.supported = function() {
52939 return !!getService();
52941 drawImages.rendered = function(zoom) {
52942 return zoom >= minZoom4;
52948 // modules/svg/mapilio_images.js
52949 function svgMapilioImages(projection2, context, dispatch14) {
52950 const throttledRedraw = throttle_default(function() {
52951 dispatch14.call("change");
52953 const minZoom4 = 12;
52954 let layer = select_default2(null);
52956 const viewFieldZoomLevel = 18;
52958 if (svgMapilioImages.initialized)
52960 svgMapilioImages.enabled = false;
52961 svgMapilioImages.initialized = true;
52963 function getService() {
52964 if (services.mapilio && !_mapilio) {
52965 _mapilio = services.mapilio;
52966 _mapilio.event.on("loadedImages", throttledRedraw);
52967 } else if (!services.mapilio && _mapilio) {
52972 function showLayer() {
52973 const service = getService();
52977 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52978 dispatch14.call("change");
52981 function hideLayer() {
52982 throttledRedraw.cancel();
52983 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52985 function transform2(d2) {
52986 let t2 = svgPointTransform(projection2)(d2);
52988 t2 += " rotate(" + Math.floor(d2.heading) + ",0,0)";
52992 function editOn() {
52993 layer.style("display", "block");
52995 function editOff() {
52996 layer.selectAll(".viewfield-group").remove();
52997 layer.style("display", "none");
52999 function click(d3_event, image) {
53000 const service = getService();
53003 service.ensureViewerLoaded(context, image.id).then(function() {
53004 service.selectImage(context, image.id).showViewer(context);
53006 context.map().centerEase(image.loc);
53008 function mouseover(d3_event, image) {
53009 const service = getService();
53011 service.setStyles(context, image);
53013 function mouseout() {
53014 const service = getService();
53016 service.setStyles(context, null);
53018 function update() {
53019 const z2 = ~~context.map().zoom();
53020 const showViewfields = z2 >= viewFieldZoomLevel;
53021 const service = getService();
53022 let sequences = service ? service.sequences(projection2) : [];
53023 let images = service ? service.images(projection2) : [];
53024 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
53025 return d2.properties.id;
53027 traces.exit().remove();
53028 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
53029 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
53032 groups.exit().remove();
53033 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
53034 groupsEnter.append("g").attr("class", "viewfield-scale");
53035 const markers = groups.merge(groupsEnter).sort(function(a2, b2) {
53036 return b2.loc[1] - a2.loc[1];
53037 }).attr("transform", transform2).select(".viewfield-scale");
53038 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
53039 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
53040 viewfields.exit().remove();
53041 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
53042 function viewfieldPath() {
53043 if (this.parentNode.__data__.isPano) {
53044 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
53046 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
53050 function drawImages(selection2) {
53051 const enabled = svgMapilioImages.enabled;
53052 const service = getService();
53053 layer = selection2.selectAll(".layer-mapilio").data(service ? [0] : []);
53054 layer.exit().remove();
53055 const layerEnter = layer.enter().append("g").attr("class", "layer-mapilio").style("display", enabled ? "block" : "none");
53056 layerEnter.append("g").attr("class", "sequences");
53057 layerEnter.append("g").attr("class", "markers");
53058 layer = layerEnter.merge(layer);
53060 if (service && ~~context.map().zoom() >= minZoom4) {
53063 service.loadImages(projection2);
53064 service.loadLines(projection2);
53070 drawImages.enabled = function(_2) {
53071 if (!arguments.length)
53072 return svgMapilioImages.enabled;
53073 svgMapilioImages.enabled = _2;
53074 if (svgMapilioImages.enabled) {
53076 context.photos().on("change.mapilio_images", null);
53079 context.photos().on("change.mapilio_images", null);
53081 dispatch14.call("change");
53084 drawImages.supported = function() {
53085 return !!getService();
53087 drawImages.rendered = function(zoom) {
53088 return zoom >= minZoom4;
53094 // modules/svg/osm.js
53095 function svgOsm(projection2, context, dispatch14) {
53096 var enabled = true;
53097 function drawOsm(selection2) {
53098 selection2.selectAll(".layer-osm").data(["covered", "areas", "lines", "points", "labels"]).enter().append("g").attr("class", function(d2) {
53099 return "layer-osm " + d2;
53101 selection2.selectAll(".layer-osm.points").selectAll(".points-group").data(["points", "midpoints", "vertices", "turns"]).enter().append("g").attr("class", function(d2) {
53102 return "points-group " + d2;
53105 function showLayer() {
53106 var layer = context.surface().selectAll(".data-layer.osm");
53108 layer.classed("disabled", false).style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
53109 dispatch14.call("change");
53112 function hideLayer() {
53113 var layer = context.surface().selectAll(".data-layer.osm");
53115 layer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
53116 layer.classed("disabled", true);
53117 dispatch14.call("change");
53120 drawOsm.enabled = function(val) {
53121 if (!arguments.length)
53129 dispatch14.call("change");
53135 // modules/svg/notes.js
53136 var _notesEnabled = false;
53138 function svgNotes(projection2, context, dispatch14) {
53140 dispatch14 = dispatch_default("change");
53142 var throttledRedraw = throttle_default(function() {
53143 dispatch14.call("change");
53146 var touchLayer = select_default2(null);
53147 var drawLayer = select_default2(null);
53148 var _notesVisible = false;
53149 function markerPath(selection2, klass) {
53150 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");
53152 function getService() {
53153 if (services.osm && !_osmService) {
53154 _osmService = services.osm;
53155 _osmService.on("loadedNotes", throttledRedraw);
53156 } else if (!services.osm && _osmService) {
53157 _osmService = null;
53159 return _osmService;
53161 function editOn() {
53162 if (!_notesVisible) {
53163 _notesVisible = true;
53164 drawLayer.style("display", "block");
53167 function editOff() {
53168 if (_notesVisible) {
53169 _notesVisible = false;
53170 drawLayer.style("display", "none");
53171 drawLayer.selectAll(".note").remove();
53172 touchLayer.selectAll(".note").remove();
53175 function layerOn() {
53177 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
53178 dispatch14.call("change");
53181 function layerOff() {
53182 throttledRedraw.cancel();
53183 drawLayer.interrupt();
53184 touchLayer.selectAll(".note").remove();
53185 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
53187 dispatch14.call("change");
53190 function updateMarkers() {
53191 if (!_notesVisible || !_notesEnabled)
53193 var service = getService();
53194 var selectedID = context.selectedNoteID();
53195 var data = service ? service.notes(projection2) : [];
53196 var getTransform = svgPointTransform(projection2);
53197 var notes = drawLayer.selectAll(".note").data(data, function(d2) {
53198 return d2.status + d2.id;
53200 notes.exit().remove();
53201 var notesEnter = notes.enter().append("g").attr("class", function(d2) {
53202 return "note note-" + d2.id + " " + d2.status;
53203 }).classed("new", function(d2) {
53206 notesEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
53207 notesEnter.append("path").call(markerPath, "shadow");
53208 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");
53209 notesEnter.selectAll(".icon-annotation").data(function(d2) {
53211 }).enter().append("use").attr("class", "icon-annotation").attr("width", "10px").attr("height", "10px").attr("x", "-3px").attr("y", "-19px").attr("xlink:href", function(d2) {
53213 return "#iD-icon-plus";
53214 if (d2.status === "open")
53215 return "#iD-icon-close";
53216 return "#iD-icon-apply";
53218 notes.merge(notesEnter).sort(sortY).classed("selected", function(d2) {
53219 var mode = context.mode();
53220 var isMoving = mode && mode.id === "drag-note";
53221 return !isMoving && d2.id === selectedID;
53222 }).attr("transform", getTransform);
53223 if (touchLayer.empty())
53225 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53226 var targets = touchLayer.selectAll(".note").data(data, function(d2) {
53229 targets.exit().remove();
53230 targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", function(d2) {
53231 var newClass = d2.id < 0 ? "new" : "";
53232 return "note target note-" + d2.id + " " + fillClass + newClass;
53233 }).attr("transform", getTransform);
53234 function sortY(a2, b2) {
53235 if (a2.id === selectedID)
53237 if (b2.id === selectedID)
53239 return b2.loc[1] - a2.loc[1];
53242 function drawNotes(selection2) {
53243 var service = getService();
53244 var surface = context.surface();
53245 if (surface && !surface.empty()) {
53246 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
53248 drawLayer = selection2.selectAll(".layer-notes").data(service ? [0] : []);
53249 drawLayer.exit().remove();
53250 drawLayer = drawLayer.enter().append("g").attr("class", "layer-notes").style("display", _notesEnabled ? "block" : "none").merge(drawLayer);
53251 if (_notesEnabled) {
53252 if (service && ~~context.map().zoom() >= minZoom4) {
53254 service.loadNotes(projection2);
53261 drawNotes.enabled = function(val) {
53262 if (!arguments.length)
53263 return _notesEnabled;
53264 _notesEnabled = val;
53265 if (_notesEnabled) {
53269 if (context.selectedNoteID()) {
53270 context.enter(modeBrowse(context));
53273 dispatch14.call("change");
53279 // modules/svg/touch.js
53280 function svgTouch() {
53281 function drawTouch(selection2) {
53282 selection2.selectAll(".layer-touch").data(["areas", "lines", "points", "turns", "markers"]).enter().append("g").attr("class", function(d2) {
53283 return "layer-touch " + d2;
53289 // modules/util/dimensions.js
53290 function refresh(selection2, node) {
53291 var cr = node.getBoundingClientRect();
53292 var prop = [cr.width, cr.height];
53293 selection2.property("__dimensions__", prop);
53296 function utilGetDimensions(selection2, force) {
53297 if (!selection2 || selection2.empty()) {
53300 var node = selection2.node(), cached = selection2.property("__dimensions__");
53301 return !cached || force ? refresh(selection2, node) : cached;
53303 function utilSetDimensions(selection2, dimensions) {
53304 if (!selection2 || selection2.empty()) {
53307 var node = selection2.node();
53308 if (dimensions === null) {
53309 refresh(selection2, node);
53312 return selection2.property("__dimensions__", [dimensions[0], dimensions[1]]).attr("width", dimensions[0]).attr("height", dimensions[1]);
53315 // modules/svg/layers.js
53316 function svgLayers(projection2, context) {
53317 var dispatch14 = dispatch_default("change");
53318 var svg2 = select_default2(null);
53320 { id: "osm", layer: svgOsm(projection2, context, dispatch14) },
53321 { id: "notes", layer: svgNotes(projection2, context, dispatch14) },
53322 { id: "data", layer: svgData(projection2, context, dispatch14) },
53323 { id: "keepRight", layer: svgKeepRight(projection2, context, dispatch14) },
53324 { id: "improveOSM", layer: svgImproveOSM(projection2, context, dispatch14) },
53325 { id: "osmose", layer: svgOsmose(projection2, context, dispatch14) },
53326 { id: "streetside", layer: svgStreetside(projection2, context, dispatch14) },
53327 { id: "mapillary", layer: svgMapillaryImages(projection2, context, dispatch14) },
53328 { id: "mapillary-position", layer: svgMapillaryPosition(projection2, context, dispatch14) },
53329 { id: "mapillary-map-features", layer: svgMapillaryMapFeatures(projection2, context, dispatch14) },
53330 { id: "mapillary-signs", layer: svgMapillarySigns(projection2, context, dispatch14) },
53331 { id: "kartaview", layer: svgKartaviewImages(projection2, context, dispatch14) },
53332 { id: "mapilio", layer: svgMapilioImages(projection2, context, dispatch14) },
53333 { id: "vegbilder", layer: svgVegbilder(projection2, context, dispatch14) },
53334 { id: "local-photos", layer: svgLocalPhotos(projection2, context, dispatch14) },
53335 { id: "debug", layer: svgDebug(projection2, context, dispatch14) },
53336 { id: "geolocate", layer: svgGeolocate(projection2, context, dispatch14) },
53337 { id: "touch", layer: svgTouch(projection2, context, dispatch14) }
53339 function drawLayers(selection2) {
53340 svg2 = selection2.selectAll(".surface").data([0]);
53341 svg2 = svg2.enter().append("svg").attr("class", "surface").merge(svg2);
53342 var defs = svg2.selectAll(".surface-defs").data([0]);
53343 defs.enter().append("defs").attr("class", "surface-defs");
53344 var groups = svg2.selectAll(".data-layer").data(_layers);
53345 groups.exit().remove();
53346 groups.enter().append("g").attr("class", function(d2) {
53347 return "data-layer " + d2.id;
53348 }).merge(groups).each(function(d2) {
53349 select_default2(this).call(d2.layer);
53352 drawLayers.all = function() {
53355 drawLayers.layer = function(id2) {
53356 var obj = _layers.find(function(o2) {
53357 return o2.id === id2;
53359 return obj && obj.layer;
53361 drawLayers.only = function(what) {
53362 var arr = [].concat(what);
53363 var all = _layers.map(function(layer) {
53366 return drawLayers.remove(utilArrayDifference(all, arr));
53368 drawLayers.remove = function(what) {
53369 var arr = [].concat(what);
53370 arr.forEach(function(id2) {
53371 _layers = _layers.filter(function(o2) {
53372 return o2.id !== id2;
53375 dispatch14.call("change");
53378 drawLayers.add = function(what) {
53379 var arr = [].concat(what);
53380 arr.forEach(function(obj) {
53381 if ("id" in obj && "layer" in obj) {
53385 dispatch14.call("change");
53388 drawLayers.dimensions = function(val) {
53389 if (!arguments.length)
53390 return utilGetDimensions(svg2);
53391 utilSetDimensions(svg2, val);
53394 return utilRebind(drawLayers, dispatch14, "on");
53397 // modules/svg/lines.js
53398 var import_fast_deep_equal6 = __toESM(require_fast_deep_equal());
53399 function svgLines(projection2, context) {
53400 var detected = utilDetect();
53401 var highway_stack = {
53415 function drawTargets(selection2, graph, entities, filter2) {
53416 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
53417 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
53418 var getPath = svgPath(projection2).geojson;
53419 var activeID = context.activeID();
53420 var base = context.history().base();
53421 var data = { targets: [], nopes: [] };
53422 entities.forEach(function(way) {
53423 var features = svgSegmentWay(way, graph, activeID);
53424 data.targets.push.apply(data.targets, features.passive);
53425 data.nopes.push.apply(data.nopes, features.active);
53427 var targetData = data.targets.filter(getPath);
53428 var targets = selection2.selectAll(".line.target-allowed").filter(function(d2) {
53429 return filter2(d2.properties.entity);
53430 }).data(targetData, function key(d2) {
53433 targets.exit().remove();
53434 var segmentWasEdited = function(d2) {
53435 var wayID = d2.properties.entity.id;
53436 if (!base.entities[wayID] || !(0, import_fast_deep_equal6.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
53439 return d2.properties.nodes.some(function(n3) {
53440 return !base.entities[n3.id] || !(0, import_fast_deep_equal6.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
53443 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
53444 return "way line target target-allowed " + targetClass + d2.id;
53445 }).classed("segment-edited", segmentWasEdited);
53446 var nopeData = data.nopes.filter(getPath);
53447 var nopes = selection2.selectAll(".line.target-nope").filter(function(d2) {
53448 return filter2(d2.properties.entity);
53449 }).data(nopeData, function key(d2) {
53452 nopes.exit().remove();
53453 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
53454 return "way line target target-nope " + nopeClass + d2.id;
53455 }).classed("segment-edited", segmentWasEdited);
53457 function drawLines(selection2, graph, entities, filter2) {
53458 var base = context.history().base();
53459 function waystack(a2, b2) {
53460 var selected = context.selectedIDs();
53461 var scoreA = selected.indexOf(a2.id) !== -1 ? 20 : 0;
53462 var scoreB = selected.indexOf(b2.id) !== -1 ? 20 : 0;
53463 if (a2.tags.highway) {
53464 scoreA -= highway_stack[a2.tags.highway];
53466 if (b2.tags.highway) {
53467 scoreB -= highway_stack[b2.tags.highway];
53469 return scoreA - scoreB;
53471 function drawLineGroup(selection3, klass, isSelected) {
53472 var mode = context.mode();
53473 var isDrawing = mode && /^draw/.test(mode.id);
53474 var selectedClass = !isDrawing && isSelected ? "selected " : "";
53475 var lines = selection3.selectAll("path").filter(filter2).data(getPathData(isSelected), osmEntity.key);
53476 lines.exit().remove();
53477 lines.enter().append("path").attr("class", function(d2) {
53478 var prefix = "way line";
53479 if (!d2.hasInterestingTags()) {
53480 var parentRelations = graph.parentRelations(d2);
53481 var parentMultipolygons = parentRelations.filter(function(relation) {
53482 return relation.isMultipolygon();
53484 if (parentMultipolygons.length > 0 && // and only multipolygon relations
53485 parentRelations.length === parentMultipolygons.length) {
53486 prefix = "relation area";
53489 var oldMPClass = oldMultiPolygonOuters[d2.id] ? "old-multipolygon " : "";
53490 return prefix + " " + klass + " " + selectedClass + oldMPClass + d2.id;
53491 }).classed("added", function(d2) {
53492 return !base.entities[d2.id];
53493 }).classed("geometry-edited", function(d2) {
53494 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);
53495 }).classed("retagged", function(d2) {
53496 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);
53497 }).call(svgTagClasses()).merge(lines).sort(waystack).attr("d", getPath).call(svgTagClasses().tags(svgRelationMemberTags(graph)));
53500 function getPathData(isSelected) {
53501 return function() {
53502 var layer = this.parentNode.__data__;
53503 var data = pathdata[layer] || [];
53504 return data.filter(function(d2) {
53506 return context.selectedIDs().indexOf(d2.id) !== -1;
53508 return context.selectedIDs().indexOf(d2.id) === -1;
53513 function addMarkers(layergroup, pathclass, groupclass, groupdata, marker) {
53514 var markergroup = layergroup.selectAll("g." + groupclass).data([pathclass]);
53515 markergroup = markergroup.enter().append("g").attr("class", groupclass).merge(markergroup);
53516 var markers = markergroup.selectAll("path").filter(filter2).data(
53518 return groupdata[this.parentNode.__data__] || [];
53521 return [d2.id, d2.index];
53524 markers.exit().remove();
53525 markers = markers.enter().append("path").attr("class", pathclass).merge(markers).attr("marker-mid", marker).attr("d", function(d2) {
53529 markers.each(function() {
53530 this.parentNode.insertBefore(this, this);
53534 var getPath = svgPath(projection2, graph);
53536 var onewaydata = {};
53537 var sideddata = {};
53538 var oldMultiPolygonOuters = {};
53539 for (var i3 = 0; i3 < entities.length; i3++) {
53540 var entity = entities[i3];
53541 var outer = osmOldMultipolygonOuterMember(entity, graph);
53543 ways.push(entity.mergeTags(outer.tags));
53544 oldMultiPolygonOuters[outer.id] = true;
53545 } else if (entity.geometry(graph) === "line" || entity.geometry(graph) === "area" && entity.sidednessIdentifier && entity.sidednessIdentifier() === "coastline") {
53549 ways = ways.filter(getPath);
53550 var pathdata = utilArrayGroupBy(ways, function(way) {
53551 return way.layer();
53553 Object.keys(pathdata).forEach(function(k2) {
53554 var v2 = pathdata[k2];
53555 var onewayArr = v2.filter(function(d2) {
53556 return d2.isOneWay();
53558 var onewaySegments = svgMarkerSegments(
53562 function shouldReverse(entity2) {
53563 return entity2.tags.oneway === "-1";
53565 function bothDirections(entity2) {
53566 return entity2.tags.oneway === "reversible" || entity2.tags.oneway === "alternating";
53569 onewaydata[k2] = utilArrayFlatten(onewayArr.map(onewaySegments));
53570 var sidedArr = v2.filter(function(d2) {
53571 return d2.isSided();
53573 var sidedSegments = svgMarkerSegments(
53577 function shouldReverse() {
53580 function bothDirections() {
53584 sideddata[k2] = utilArrayFlatten(sidedArr.map(sidedSegments));
53586 var covered = selection2.selectAll(".layer-osm.covered");
53587 var uncovered = selection2.selectAll(".layer-osm.lines");
53588 var touchLayer = selection2.selectAll(".layer-touch.lines");
53589 [covered, uncovered].forEach(function(selection3) {
53590 var range3 = selection3 === covered ? range(-10, 0) : range(0, 11);
53591 var layergroup = selection3.selectAll("g.layergroup").data(range3);
53592 layergroup = layergroup.enter().append("g").attr("class", function(d2) {
53593 return "layergroup layer" + String(d2);
53594 }).merge(layergroup);
53595 layergroup.selectAll("g.linegroup").data(["shadow", "casing", "stroke", "shadow-highlighted", "casing-highlighted", "stroke-highlighted"]).enter().append("g").attr("class", function(d2) {
53596 return "linegroup line-" + d2;
53598 layergroup.selectAll("g.line-shadow").call(drawLineGroup, "shadow", false);
53599 layergroup.selectAll("g.line-casing").call(drawLineGroup, "casing", false);
53600 layergroup.selectAll("g.line-stroke").call(drawLineGroup, "stroke", false);
53601 layergroup.selectAll("g.line-shadow-highlighted").call(drawLineGroup, "shadow", true);
53602 layergroup.selectAll("g.line-casing-highlighted").call(drawLineGroup, "casing", true);
53603 layergroup.selectAll("g.line-stroke-highlighted").call(drawLineGroup, "stroke", true);
53604 addMarkers(layergroup, "oneway", "onewaygroup", onewaydata, "url(#ideditor-oneway-marker)");
53610 function marker(d2) {
53611 var category = graph.entity(d2.id).sidednessIdentifier();
53612 return "url(#ideditor-sided-marker-" + category + ")";
53616 touchLayer.call(drawTargets, graph, ways, filter2);
53621 // modules/svg/midpoints.js
53622 function svgMidpoints(projection2, context) {
53623 var targetRadius = 8;
53624 function drawTargets(selection2, graph, entities, filter2) {
53625 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53626 var getTransform = svgPointTransform(projection2).geojson;
53627 var data = entities.map(function(midpoint) {
53637 coordinates: midpoint.loc
53641 var targets = selection2.selectAll(".midpoint.target").filter(function(d2) {
53642 return filter2(d2.properties.entity);
53643 }).data(data, function key(d2) {
53646 targets.exit().remove();
53647 targets.enter().append("circle").attr("r", targetRadius).merge(targets).attr("class", function(d2) {
53648 return "node midpoint target " + fillClass + d2.id;
53649 }).attr("transform", getTransform);
53651 function drawMidpoints(selection2, graph, entities, filter2, extent) {
53652 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.midpoints");
53653 var touchLayer = selection2.selectAll(".layer-touch.points");
53654 var mode = context.mode();
53655 if (mode && mode.id !== "select" || !context.map().withinEditableZoom()) {
53656 drawLayer.selectAll(".midpoint").remove();
53657 touchLayer.selectAll(".midpoint.target").remove();
53660 var poly = extent.polygon();
53661 var midpoints = {};
53662 for (var i3 = 0; i3 < entities.length; i3++) {
53663 var entity = entities[i3];
53664 if (entity.type !== "way")
53666 if (!filter2(entity))
53668 if (context.selectedIDs().indexOf(entity.id) < 0)
53670 var nodes = graph.childNodes(entity);
53671 for (var j3 = 0; j3 < nodes.length - 1; j3++) {
53672 var a2 = nodes[j3];
53673 var b2 = nodes[j3 + 1];
53674 var id2 = [a2.id, b2.id].sort().join("-");
53675 if (midpoints[id2]) {
53676 midpoints[id2].parents.push(entity);
53677 } else if (geoVecLength(projection2(a2.loc), projection2(b2.loc)) > 40) {
53678 var point2 = geoVecInterp(a2.loc, b2.loc, 0.5);
53680 if (extent.intersects(point2)) {
53683 for (var k2 = 0; k2 < 4; k2++) {
53684 point2 = geoLineIntersection([a2.loc, b2.loc], [poly[k2], poly[k2 + 1]]);
53685 if (point2 && geoVecLength(projection2(a2.loc), projection2(point2)) > 20 && geoVecLength(projection2(b2.loc), projection2(point2)) > 20) {
53696 edge: [a2.id, b2.id],
53703 function midpointFilter(d2) {
53704 if (midpoints[d2.id])
53706 for (var i4 = 0; i4 < d2.parents.length; i4++) {
53707 if (filter2(d2.parents[i4])) {
53713 var groups = drawLayer.selectAll(".midpoint").filter(midpointFilter).data(Object.values(midpoints), function(d2) {
53716 groups.exit().remove();
53717 var enter = groups.enter().insert("g", ":first-child").attr("class", "midpoint");
53718 enter.append("polygon").attr("points", "-6,8 10,0 -6,-8").attr("class", "shadow");
53719 enter.append("polygon").attr("points", "-3,4 5,0 -3,-4").attr("class", "fill");
53720 groups = groups.merge(enter).attr("transform", function(d2) {
53721 var translate = svgPointTransform(projection2);
53722 var a3 = graph.entity(d2.edge[0]);
53723 var b3 = graph.entity(d2.edge[1]);
53724 var angle2 = geoAngle(a3, b3, projection2) * (180 / Math.PI);
53725 return translate(d2) + " rotate(" + angle2 + ")";
53726 }).call(svgTagClasses().tags(
53728 return d2.parents[0].tags;
53731 groups.select("polygon.shadow");
53732 groups.select("polygon.fill");
53733 touchLayer.call(drawTargets, graph, Object.values(midpoints), midpointFilter);
53735 return drawMidpoints;
53738 // modules/svg/points.js
53739 var import_fast_deep_equal7 = __toESM(require_fast_deep_equal());
53740 function svgPoints(projection2, context) {
53741 function markerPath(selection2, klass) {
53742 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");
53744 function sortY(a2, b2) {
53745 return b2.loc[1] - a2.loc[1];
53747 function fastEntityKey(d2) {
53748 var mode = context.mode();
53749 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
53750 return isMoving ? d2.id : osmEntity.key(d2);
53752 function drawTargets(selection2, graph, entities, filter2) {
53753 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53754 var getTransform = svgPointTransform(projection2).geojson;
53755 var activeID = context.activeID();
53757 entities.forEach(function(node) {
53758 if (activeID === node.id)
53767 geometry: node.asGeoJSON()
53770 var targets = selection2.selectAll(".point.target").filter(function(d2) {
53771 return filter2(d2.properties.entity);
53772 }).data(data, function key(d2) {
53775 targets.exit().remove();
53776 targets.enter().append("rect").attr("x", -10).attr("y", -26).attr("width", 20).attr("height", 30).merge(targets).attr("class", function(d2) {
53777 return "node point target " + fillClass + d2.id;
53778 }).attr("transform", getTransform);
53780 function drawPoints(selection2, graph, entities, filter2) {
53781 var wireframe = context.surface().classed("fill-wireframe");
53782 var zoom = geoScaleToZoom(projection2.scale());
53783 var base = context.history().base();
53784 function renderAsPoint(entity) {
53785 return entity.geometry(graph) === "point" && !(zoom >= 18 && entity.directions(graph, projection2).length);
53787 var points = wireframe ? [] : entities.filter(renderAsPoint);
53788 points.sort(sortY);
53789 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.points");
53790 var touchLayer = selection2.selectAll(".layer-touch.points");
53791 var groups = drawLayer.selectAll("g.point").filter(filter2).data(points, fastEntityKey);
53792 groups.exit().remove();
53793 var enter = groups.enter().append("g").attr("class", function(d2) {
53794 return "node point " + d2.id;
53796 enter.append("path").call(markerPath, "shadow");
53797 enter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
53798 enter.append("path").call(markerPath, "stroke");
53799 enter.append("use").attr("transform", "translate(-5.5, -20)").attr("class", "icon").attr("width", "12px").attr("height", "12px");
53800 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("added", function(d2) {
53801 return !base.entities[d2.id];
53802 }).classed("moved", function(d2) {
53803 return base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
53804 }).classed("retagged", function(d2) {
53805 return base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
53806 }).call(svgTagClasses());
53807 groups.select(".shadow");
53808 groups.select(".stroke");
53809 groups.select(".icon").attr("xlink:href", function(entity) {
53810 var preset = _mainPresetIndex.match(entity, graph);
53811 var picon = preset && preset.icon;
53812 return picon ? "#" + picon : "";
53814 touchLayer.call(drawTargets, graph, points, filter2);
53819 // modules/svg/turns.js
53820 function svgTurns(projection2, context) {
53821 function icon2(turn) {
53822 var u2 = turn.u ? "-u" : "";
53824 return "#iD-turn-no" + u2;
53826 return "#iD-turn-only" + u2;
53827 return "#iD-turn-yes" + u2;
53829 function drawTurns(selection2, graph, turns) {
53830 function turnTransform(d2) {
53832 var toWay = graph.entity(d2.to.way);
53833 var toPoints = graph.childNodes(toWay).map(function(n3) {
53835 }).map(projection2);
53836 var toLength = geoPathLength(toPoints);
53837 var mid = toLength / 2;
53838 var toNode = graph.entity(d2.to.node);
53839 var toVertex = graph.entity(d2.to.vertex);
53840 var a2 = geoAngle(toVertex, toNode, projection2);
53841 var o2 = projection2(toVertex.loc);
53842 var r2 = d2.u ? 0 : !toWay.__via ? pxRadius : Math.min(mid, pxRadius);
53843 return "translate(" + (r2 * Math.cos(a2) + o2[0]) + "," + (r2 * Math.sin(a2) + o2[1]) + ") rotate(" + a2 * 180 / Math.PI + ")";
53845 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.turns");
53846 var touchLayer = selection2.selectAll(".layer-touch.turns");
53847 var groups = drawLayer.selectAll("g.turn").data(turns, function(d2) {
53850 groups.exit().remove();
53851 var groupsEnter = groups.enter().append("g").attr("class", function(d2) {
53852 return "turn " + d2.key;
53854 var turnsEnter = groupsEnter.filter(function(d2) {
53857 turnsEnter.append("rect").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53858 turnsEnter.append("use").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53859 var uEnter = groupsEnter.filter(function(d2) {
53862 uEnter.append("circle").attr("r", "16");
53863 uEnter.append("use").attr("transform", "translate(-16, -16)").attr("width", "32").attr("height", "32");
53864 groups = groups.merge(groupsEnter).attr("opacity", function(d2) {
53865 return d2.direct === false ? "0.7" : null;
53866 }).attr("transform", turnTransform);
53867 groups.select("use").attr("xlink:href", icon2);
53868 groups.select("rect");
53869 groups.select("circle");
53870 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53871 groups = touchLayer.selectAll("g.turn").data(turns, function(d2) {
53874 groups.exit().remove();
53875 groupsEnter = groups.enter().append("g").attr("class", function(d2) {
53876 return "turn " + d2.key;
53878 turnsEnter = groupsEnter.filter(function(d2) {
53881 turnsEnter.append("rect").attr("class", "target " + fillClass).attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53882 uEnter = groupsEnter.filter(function(d2) {
53885 uEnter.append("circle").attr("class", "target " + fillClass).attr("r", "16");
53886 groups = groups.merge(groupsEnter).attr("transform", turnTransform);
53887 groups.select("rect");
53888 groups.select("circle");
53894 // modules/svg/vertices.js
53895 var import_fast_deep_equal8 = __toESM(require_fast_deep_equal());
53896 function svgVertices(projection2, context) {
53898 // z16-, z17, z18+, w/icon
53899 shadow: [6, 7.5, 7.5, 12],
53900 stroke: [2.5, 3.5, 3.5, 8],
53901 fill: [1, 1.5, 1.5, 1.5]
53903 var _currHoverTarget;
53904 var _currPersistent = {};
53905 var _currHover = {};
53906 var _prevHover = {};
53907 var _currSelected = {};
53908 var _prevSelected = {};
53910 function sortY(a2, b2) {
53911 return b2.loc[1] - a2.loc[1];
53913 function fastEntityKey(d2) {
53914 var mode = context.mode();
53915 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
53916 return isMoving ? d2.id : osmEntity.key(d2);
53918 function draw(selection2, graph, vertices, sets2, filter2) {
53919 sets2 = sets2 || { selected: {}, important: {}, hovered: {} };
53921 var directions = {};
53922 var wireframe = context.surface().classed("fill-wireframe");
53923 var zoom = geoScaleToZoom(projection2.scale());
53924 var z2 = zoom < 17 ? 0 : zoom < 18 ? 1 : 2;
53925 var activeID = context.activeID();
53926 var base = context.history().base();
53927 function getIcon(d2) {
53928 var entity = graph.entity(d2.id);
53929 if (entity.id in icons)
53930 return icons[entity.id];
53931 icons[entity.id] = entity.hasInterestingTags() && _mainPresetIndex.match(entity, graph).icon;
53932 return icons[entity.id];
53934 function getDirections(entity) {
53935 if (entity.id in directions)
53936 return directions[entity.id];
53937 var angles = entity.directions(graph, projection2);
53938 directions[entity.id] = angles.length ? angles : false;
53941 function updateAttributes(selection3) {
53942 ["shadow", "stroke", "fill"].forEach(function(klass) {
53943 var rads = radiuses[klass];
53944 selection3.selectAll("." + klass).each(function(entity) {
53945 var i3 = z2 && getIcon(entity);
53946 var r2 = rads[i3 ? 3 : z2];
53947 if (entity.id !== activeID && entity.isEndpoint(graph) && !entity.isConnected(graph)) {
53950 if (klass === "shadow") {
53951 _radii[entity.id] = r2;
53953 select_default2(this).attr("r", r2).attr("visibility", i3 && klass === "fill" ? "hidden" : null);
53957 vertices.sort(sortY);
53958 var groups = selection2.selectAll("g.vertex").filter(filter2).data(vertices, fastEntityKey);
53959 groups.exit().remove();
53960 var enter = groups.enter().append("g").attr("class", function(d2) {
53961 return "node vertex " + d2.id;
53963 enter.append("circle").attr("class", "shadow");
53964 enter.append("circle").attr("class", "stroke");
53965 enter.filter(function(d2) {
53966 return d2.hasInterestingTags();
53967 }).append("circle").attr("class", "fill");
53968 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("sibling", function(d2) {
53969 return d2.id in sets2.selected;
53970 }).classed("shared", function(d2) {
53971 return graph.isShared(d2);
53972 }).classed("endpoint", function(d2) {
53973 return d2.isEndpoint(graph);
53974 }).classed("added", function(d2) {
53975 return !base.entities[d2.id];
53976 }).classed("moved", function(d2) {
53977 return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
53978 }).classed("retagged", function(d2) {
53979 return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
53980 }).call(updateAttributes);
53981 var iconUse = groups.selectAll(".icon").data(function data(d2) {
53982 return zoom >= 17 && getIcon(d2) ? [d2] : [];
53984 iconUse.exit().remove();
53985 iconUse.enter().append("use").attr("class", "icon").attr("width", "12px").attr("height", "12px").attr("transform", "translate(-6, -6)").attr("xlink:href", function(d2) {
53986 var picon = getIcon(d2);
53987 return picon ? "#" + picon : "";
53989 var dgroups = groups.selectAll(".viewfieldgroup").data(function data(d2) {
53990 return zoom >= 18 && getDirections(d2) ? [d2] : [];
53992 dgroups.exit().remove();
53993 dgroups = dgroups.enter().insert("g", ".shadow").attr("class", "viewfieldgroup").merge(dgroups);
53994 var viewfields = dgroups.selectAll(".viewfield").data(getDirections, function key(d2) {
53995 return osmEntity.key(d2);
53997 viewfields.exit().remove();
53998 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) {
53999 return "rotate(" + d2 + ")";
54002 function drawTargets(selection2, graph, entities, filter2) {
54003 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
54004 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
54005 var getTransform = svgPointTransform(projection2).geojson;
54006 var activeID = context.activeID();
54007 var data = { targets: [], nopes: [] };
54008 entities.forEach(function(node) {
54009 if (activeID === node.id)
54011 var vertexType = svgPassiveVertex(node, graph, activeID);
54012 if (vertexType !== 0) {
54013 data.targets.push({
54020 geometry: node.asGeoJSON()
54025 id: node.id + "-nope",
54031 geometry: node.asGeoJSON()
54035 var targets = selection2.selectAll(".vertex.target-allowed").filter(function(d2) {
54036 return filter2(d2.properties.entity);
54037 }).data(data.targets, function key(d2) {
54040 targets.exit().remove();
54041 targets.enter().append("circle").attr("r", function(d2) {
54042 return _radii[d2.id] || radiuses.shadow[3];
54043 }).merge(targets).attr("class", function(d2) {
54044 return "node vertex target target-allowed " + targetClass + d2.id;
54045 }).attr("transform", getTransform);
54046 var nopes = selection2.selectAll(".vertex.target-nope").filter(function(d2) {
54047 return filter2(d2.properties.entity);
54048 }).data(data.nopes, function key(d2) {
54051 nopes.exit().remove();
54052 nopes.enter().append("circle").attr("r", function(d2) {
54053 return _radii[d2.properties.entity.id] || radiuses.shadow[3];
54054 }).merge(nopes).attr("class", function(d2) {
54055 return "node vertex target target-nope " + nopeClass + d2.id;
54056 }).attr("transform", getTransform);
54058 function renderAsVertex(entity, graph, wireframe, zoom) {
54059 var geometry = entity.geometry(graph);
54060 return geometry === "vertex" || geometry === "point" && (wireframe || zoom >= 18 && entity.directions(graph, projection2).length);
54062 function isEditedNode(node, base, head) {
54063 var baseNode = base.entities[node.id];
54064 var headNode = head.entities[node.id];
54065 return !headNode || !baseNode || !(0, import_fast_deep_equal8.default)(headNode.tags, baseNode.tags) || !(0, import_fast_deep_equal8.default)(headNode.loc, baseNode.loc);
54067 function getSiblingAndChildVertices(ids, graph, wireframe, zoom) {
54070 function addChildVertices(entity) {
54071 if (seenIds[entity.id])
54073 seenIds[entity.id] = true;
54074 var geometry = entity.geometry(graph);
54075 if (!context.features().isHiddenFeature(entity, graph, geometry)) {
54077 if (entity.type === "way") {
54078 for (i3 = 0; i3 < entity.nodes.length; i3++) {
54079 var child = graph.hasEntity(entity.nodes[i3]);
54081 addChildVertices(child);
54084 } else if (entity.type === "relation") {
54085 for (i3 = 0; i3 < entity.members.length; i3++) {
54086 var member = graph.hasEntity(entity.members[i3].id);
54088 addChildVertices(member);
54091 } else if (renderAsVertex(entity, graph, wireframe, zoom)) {
54092 results[entity.id] = entity;
54096 ids.forEach(function(id2) {
54097 var entity = graph.hasEntity(id2);
54100 if (entity.type === "node") {
54101 if (renderAsVertex(entity, graph, wireframe, zoom)) {
54102 results[entity.id] = entity;
54103 graph.parentWays(entity).forEach(function(entity2) {
54104 addChildVertices(entity2);
54108 addChildVertices(entity);
54113 function drawVertices(selection2, graph, entities, filter2, extent, fullRedraw) {
54114 var wireframe = context.surface().classed("fill-wireframe");
54115 var visualDiff = context.surface().classed("highlight-edited");
54116 var zoom = geoScaleToZoom(projection2.scale());
54117 var mode = context.mode();
54118 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
54119 var base = context.history().base();
54120 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.vertices");
54121 var touchLayer = selection2.selectAll(".layer-touch.points");
54123 _currPersistent = {};
54126 for (var i3 = 0; i3 < entities.length; i3++) {
54127 var entity = entities[i3];
54128 var geometry = entity.geometry(graph);
54130 if (geometry === "point" && renderAsVertex(entity, graph, wireframe, zoom)) {
54131 _currPersistent[entity.id] = entity;
54133 } else if (geometry === "vertex" && (entity.hasInterestingTags() || entity.isEndpoint(graph) || entity.isConnected(graph) || visualDiff && isEditedNode(entity, base, graph))) {
54134 _currPersistent[entity.id] = entity;
54137 if (!keep && !fullRedraw) {
54138 delete _currPersistent[entity.id];
54142 persistent: _currPersistent,
54143 // persistent = important vertices (render always)
54144 selected: _currSelected,
54145 // selected + siblings of selected (render always)
54146 hovered: _currHover
54147 // hovered + siblings of hovered (render only in draw modes)
54149 var all = Object.assign({}, isMoving ? _currHover : {}, _currSelected, _currPersistent);
54150 var filterRendered = function(d2) {
54151 return d2.id in _currPersistent || d2.id in _currSelected || d2.id in _currHover || filter2(d2);
54153 drawLayer.call(draw, graph, currentVisible(all), sets2, filterRendered);
54154 var filterTouch = function(d2) {
54155 return isMoving ? true : filterRendered(d2);
54157 touchLayer.call(drawTargets, graph, currentVisible(all), filterTouch);
54158 function currentVisible(which) {
54159 return Object.keys(which).map(graph.hasEntity, graph).filter(function(entity2) {
54160 return entity2 && entity2.intersects(extent, graph);
54164 drawVertices.drawSelected = function(selection2, graph, extent) {
54165 var wireframe = context.surface().classed("fill-wireframe");
54166 var zoom = geoScaleToZoom(projection2.scale());
54167 _prevSelected = _currSelected || {};
54168 if (context.map().isInWideSelection()) {
54169 _currSelected = {};
54170 context.selectedIDs().forEach(function(id2) {
54171 var entity = graph.hasEntity(id2);
54174 if (entity.type === "node") {
54175 if (renderAsVertex(entity, graph, wireframe, zoom)) {
54176 _currSelected[entity.id] = entity;
54181 _currSelected = getSiblingAndChildVertices(context.selectedIDs(), graph, wireframe, zoom);
54183 var filter2 = function(d2) {
54184 return d2.id in _prevSelected;
54186 drawVertices(selection2, graph, Object.values(_prevSelected), filter2, extent, false);
54188 drawVertices.drawHover = function(selection2, graph, target, extent) {
54189 if (target === _currHoverTarget)
54191 var wireframe = context.surface().classed("fill-wireframe");
54192 var zoom = geoScaleToZoom(projection2.scale());
54193 _prevHover = _currHover || {};
54194 _currHoverTarget = target;
54195 var entity = target && target.properties && target.properties.entity;
54197 _currHover = getSiblingAndChildVertices([entity.id], graph, wireframe, zoom);
54201 var filter2 = function(d2) {
54202 return d2.id in _prevHover;
54204 drawVertices(selection2, graph, Object.values(_prevHover), filter2, extent, false);
54206 return drawVertices;
54209 // modules/util/bind_once.js
54210 function utilBindOnce(target, type2, listener, capture) {
54211 var typeOnce = type2 + ".once";
54213 target.on(typeOnce, null);
54214 listener.apply(this, arguments);
54216 target.on(typeOnce, one2, capture);
54220 // modules/util/zoom_pan.js
54221 function defaultFilter3(d3_event) {
54222 return !d3_event.ctrlKey && !d3_event.button;
54224 function defaultExtent2() {
54226 if (e3 instanceof SVGElement) {
54227 e3 = e3.ownerSVGElement || e3;
54228 if (e3.hasAttribute("viewBox")) {
54229 e3 = e3.viewBox.baseVal;
54230 return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
54232 return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
54234 return [[0, 0], [e3.clientWidth, e3.clientHeight]];
54236 function defaultWheelDelta2(d3_event) {
54237 return -d3_event.deltaY * (d3_event.deltaMode === 1 ? 0.05 : d3_event.deltaMode ? 1 : 2e-3);
54239 function defaultConstrain2(transform2, extent, translateExtent) {
54240 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];
54241 return transform2.translate(
54242 dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
54243 dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
54246 function utilZoomPan() {
54247 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;
54248 function zoom(selection2) {
54249 selection2.on("pointerdown.zoom", pointerdown).on("wheel.zoom", wheeled).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
54250 select_default2(window).on("pointermove.zoompan", pointermove).on("pointerup.zoompan pointercancel.zoompan", pointerup);
54252 zoom.transform = function(collection, transform2, point2) {
54253 var selection2 = collection.selection ? collection.selection() : collection;
54254 if (collection !== selection2) {
54255 schedule(collection, transform2, point2);
54257 selection2.interrupt().each(function() {
54258 gesture(this, arguments).start(null).zoom(null, null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end(null);
54262 zoom.scaleBy = function(selection2, k2, p2) {
54263 zoom.scaleTo(selection2, function() {
54264 var k0 = _transform.k, k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
54268 zoom.scaleTo = function(selection2, k2, p2) {
54269 zoom.transform(selection2, function() {
54270 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;
54271 return constrain(translate(scale(t0, k1), p02, p1), e3, translateExtent);
54274 zoom.translateBy = function(selection2, x2, y2) {
54275 zoom.transform(selection2, function() {
54276 return constrain(_transform.translate(
54277 typeof x2 === "function" ? x2.apply(this, arguments) : x2,
54278 typeof y2 === "function" ? y2.apply(this, arguments) : y2
54279 ), extent.apply(this, arguments), translateExtent);
54282 zoom.translateTo = function(selection2, x2, y2, p2) {
54283 zoom.transform(selection2, function() {
54284 var e3 = extent.apply(this, arguments), t2 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
54285 return constrain(identity2.translate(p02[0], p02[1]).scale(t2.k).translate(
54286 typeof x2 === "function" ? -x2.apply(this, arguments) : -x2,
54287 typeof y2 === "function" ? -y2.apply(this, arguments) : -y2
54288 ), e3, translateExtent);
54291 function scale(transform2, k2) {
54292 k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k2));
54293 return k2 === transform2.k ? transform2 : new Transform(k2, transform2.x, transform2.y);
54295 function translate(transform2, p02, p1) {
54296 var x2 = p02[0] - p1[0] * transform2.k, y2 = p02[1] - p1[1] * transform2.k;
54297 return x2 === transform2.x && y2 === transform2.y ? transform2 : new Transform(transform2.k, x2, y2);
54299 function centroid(extent2) {
54300 return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
54302 function schedule(transition2, transform2, point2) {
54303 transition2.on("start.zoom", function() {
54304 gesture(this, arguments).start(null);
54305 }).on("interrupt.zoom end.zoom", function() {
54306 gesture(this, arguments).end(null);
54307 }).tween("zoom", function() {
54308 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));
54309 return function(t2) {
54314 var k2 = w2 / l2[2];
54315 t2 = new Transform(k2, p2[0] - l2[0] * k2, p2[1] - l2[1] * k2);
54317 g3.zoom(null, null, t2);
54321 function gesture(that, args, clean2) {
54322 return !clean2 && _activeGesture || new Gesture(that, args);
54324 function Gesture(that, args) {
54328 this.extent = extent.apply(that, args);
54330 Gesture.prototype = {
54331 start: function(d3_event) {
54332 if (++this.active === 1) {
54333 _activeGesture = this;
54334 dispatch14.call("start", this, d3_event);
54338 zoom: function(d3_event, key, transform2) {
54339 if (this.mouse && key !== "mouse")
54340 this.mouse[1] = transform2.invert(this.mouse[0]);
54341 if (this.pointer0 && key !== "touch")
54342 this.pointer0[1] = transform2.invert(this.pointer0[0]);
54343 if (this.pointer1 && key !== "touch")
54344 this.pointer1[1] = transform2.invert(this.pointer1[0]);
54345 _transform = transform2;
54346 dispatch14.call("zoom", this, d3_event, key, transform2);
54349 end: function(d3_event) {
54350 if (--this.active === 0) {
54351 _activeGesture = null;
54352 dispatch14.call("end", this, d3_event);
54357 function wheeled(d3_event) {
54358 if (!filter2.apply(this, arguments))
54360 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);
54362 if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
54363 g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
54365 clearTimeout(g3.wheel);
54367 g3.mouse = [p2, t2.invert(p2)];
54368 interrupt_default(this);
54369 g3.start(d3_event);
54371 d3_event.preventDefault();
54372 d3_event.stopImmediatePropagation();
54373 g3.wheel = setTimeout(wheelidled, _wheelDelay);
54374 g3.zoom(d3_event, "mouse", constrain(translate(scale(t2, k2), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
54375 function wheelidled() {
54380 var _downPointerIDs = /* @__PURE__ */ new Set();
54381 var _pointerLocGetter;
54382 function pointerdown(d3_event) {
54383 _downPointerIDs.add(d3_event.pointerId);
54384 if (!filter2.apply(this, arguments))
54386 var g3 = gesture(this, arguments, _downPointerIDs.size === 1);
54388 d3_event.stopImmediatePropagation();
54389 _pointerLocGetter = utilFastMouse(this);
54390 var loc = _pointerLocGetter(d3_event);
54391 var p2 = [loc, _transform.invert(loc), d3_event.pointerId];
54392 if (!g3.pointer0) {
54395 } else if (!g3.pointer1 && g3.pointer0[2] !== p2[2]) {
54399 interrupt_default(this);
54400 g3.start(d3_event);
54403 function pointermove(d3_event) {
54404 if (!_downPointerIDs.has(d3_event.pointerId))
54406 if (!_activeGesture || !_pointerLocGetter)
54408 var g3 = gesture(this, arguments);
54409 var isPointer0 = g3.pointer0 && g3.pointer0[2] === d3_event.pointerId;
54410 var isPointer1 = !isPointer0 && g3.pointer1 && g3.pointer1[2] === d3_event.pointerId;
54411 if ((isPointer0 || isPointer1) && "buttons" in d3_event && !d3_event.buttons) {
54413 _downPointerIDs.delete(g3.pointer0[2]);
54415 _downPointerIDs.delete(g3.pointer1[2]);
54419 d3_event.preventDefault();
54420 d3_event.stopImmediatePropagation();
54421 var loc = _pointerLocGetter(d3_event);
54424 g3.pointer0[0] = loc;
54425 else if (isPointer1)
54426 g3.pointer1[0] = loc;
54429 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;
54430 t2 = scale(t2, Math.sqrt(dp / dl));
54431 p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
54432 l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
54433 } else if (g3.pointer0) {
54434 p2 = g3.pointer0[0];
54435 l2 = g3.pointer0[1];
54439 g3.zoom(d3_event, "touch", constrain(translate(t2, p2, l2), g3.extent, translateExtent));
54441 function pointerup(d3_event) {
54442 if (!_downPointerIDs.has(d3_event.pointerId))
54444 _downPointerIDs.delete(d3_event.pointerId);
54445 if (!_activeGesture)
54447 var g3 = gesture(this, arguments);
54448 d3_event.stopImmediatePropagation();
54449 if (g3.pointer0 && g3.pointer0[2] === d3_event.pointerId)
54450 delete g3.pointer0;
54451 else if (g3.pointer1 && g3.pointer1[2] === d3_event.pointerId)
54452 delete g3.pointer1;
54453 if (g3.pointer1 && !g3.pointer0) {
54454 g3.pointer0 = g3.pointer1;
54455 delete g3.pointer1;
54458 g3.pointer0[1] = _transform.invert(g3.pointer0[0]);
54463 zoom.wheelDelta = function(_2) {
54464 return arguments.length ? (wheelDelta = utilFunctor(+_2), zoom) : wheelDelta;
54466 zoom.filter = function(_2) {
54467 return arguments.length ? (filter2 = utilFunctor(!!_2), zoom) : filter2;
54469 zoom.extent = function(_2) {
54470 return arguments.length ? (extent = utilFunctor([[+_2[0][0], +_2[0][1]], [+_2[1][0], +_2[1][1]]]), zoom) : extent;
54472 zoom.scaleExtent = function(_2) {
54473 return arguments.length ? (scaleExtent[0] = +_2[0], scaleExtent[1] = +_2[1], zoom) : [scaleExtent[0], scaleExtent[1]];
54475 zoom.translateExtent = function(_2) {
54476 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]]];
54478 zoom.constrain = function(_2) {
54479 return arguments.length ? (constrain = _2, zoom) : constrain;
54481 zoom.interpolate = function(_2) {
54482 return arguments.length ? (interpolate = _2, zoom) : interpolate;
54484 zoom._transform = function(_2) {
54485 return arguments.length ? (_transform = _2, zoom) : _transform;
54487 return utilRebind(zoom, dispatch14, "on");
54490 // modules/util/double_up.js
54491 function utilDoubleUp() {
54492 var dispatch14 = dispatch_default("doubleUp");
54493 var _maxTimespan = 500;
54494 var _maxDistance = 20;
54496 function pointerIsValidFor(loc) {
54497 return (/* @__PURE__ */ new Date()).getTime() - _pointer.startTime <= _maxTimespan && // all pointer events must occur within a small distance of the first pointerdown
54498 geoVecLength(_pointer.startLoc, loc) <= _maxDistance;
54500 function pointerdown(d3_event) {
54501 if (d3_event.ctrlKey || d3_event.button === 2)
54503 var loc = [d3_event.clientX, d3_event.clientY];
54504 if (_pointer && !pointerIsValidFor(loc)) {
54510 startTime: (/* @__PURE__ */ new Date()).getTime(),
54512 pointerId: d3_event.pointerId
54515 _pointer.pointerId = d3_event.pointerId;
54518 function pointerup(d3_event) {
54519 if (d3_event.ctrlKey || d3_event.button === 2)
54521 if (!_pointer || _pointer.pointerId !== d3_event.pointerId)
54523 _pointer.upCount += 1;
54524 if (_pointer.upCount === 2) {
54525 var loc = [d3_event.clientX, d3_event.clientY];
54526 if (pointerIsValidFor(loc)) {
54527 var locInThis = utilFastMouse(this)(d3_event);
54528 dispatch14.call("doubleUp", this, d3_event, locInThis);
54533 function doubleUp(selection2) {
54534 if ("PointerEvent" in window) {
54535 selection2.on("pointerdown.doubleUp", pointerdown).on("pointerup.doubleUp", pointerup);
54537 selection2.on("dblclick.doubleUp", function(d3_event) {
54538 dispatch14.call("doubleUp", this, d3_event, utilFastMouse(this)(d3_event));
54542 doubleUp.off = function(selection2) {
54543 selection2.on("pointerdown.doubleUp", null).on("pointerup.doubleUp", null).on("dblclick.doubleUp", null);
54545 return utilRebind(doubleUp, dispatch14, "on");
54548 // modules/renderer/map.js
54549 var TILESIZE = 256;
54552 var kMin = geoZoomToScale(minZoom2, TILESIZE);
54553 var kMax = geoZoomToScale(maxZoom, TILESIZE);
54554 function clamp(num, min3, max3) {
54555 return Math.max(min3, Math.min(num, max3));
54557 function rendererMap(context) {
54558 var dispatch14 = dispatch_default(
54561 "crossEditableZoom",
54563 "changeHighlighting",
54566 var projection2 = context.projection;
54567 var curtainProjection = context.curtainProjection;
54575 var _selection = select_default2(null);
54576 var supersurface = select_default2(null);
54577 var wrapper = select_default2(null);
54578 var surface = select_default2(null);
54579 var _dimensions = [1, 1];
54580 var _dblClickZoomEnabled = true;
54581 var _redrawEnabled = true;
54582 var _gestureTransformStart;
54583 var _transformStart = projection2.transform();
54584 var _transformLast;
54585 var _isTransformed = false;
54587 var _getMouseCoords;
54588 var _lastPointerEvent;
54589 var _lastWithinEditableZoom;
54590 var _pointerDown = false;
54591 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
54592 var _zoomerPannerFunction = "PointerEvent" in window ? utilZoomPan : zoom_default2;
54593 var _zoomerPanner = _zoomerPannerFunction().scaleExtent([kMin, kMax]).interpolate(value_default).filter(zoomEventFilter).on("zoom.map", zoomPan2).on("start.map", function(d3_event) {
54594 _pointerDown = d3_event && (d3_event.type === "pointerdown" || d3_event.sourceEvent && d3_event.sourceEvent.type === "pointerdown");
54595 }).on("end.map", function() {
54596 _pointerDown = false;
54598 var _doubleUpHandler = utilDoubleUp();
54599 var scheduleRedraw = throttle_default(redraw, 750);
54600 function cancelPendingRedraw() {
54601 scheduleRedraw.cancel();
54603 function map2(selection2) {
54604 _selection = selection2;
54605 context.on("change.map", immediateRedraw);
54606 var osm = context.connection();
54608 osm.on("change.map", immediateRedraw);
54610 function didUndoOrRedo(targetTransform) {
54611 var mode = context.mode().id;
54612 if (mode !== "browse" && mode !== "select")
54614 if (targetTransform) {
54615 map2.transformEase(targetTransform);
54618 context.history().on("merge.map", function() {
54620 }).on("change.map", immediateRedraw).on("undone.map", function(stack, fromStack) {
54621 didUndoOrRedo(fromStack.transform);
54622 }).on("redone.map", function(stack) {
54623 didUndoOrRedo(stack.transform);
54625 context.background().on("change.map", immediateRedraw);
54626 context.features().on("redraw.map", immediateRedraw);
54627 drawLayers.on("change.map", function() {
54628 context.background().updateImagery();
54631 selection2.on("wheel.map mousewheel.map", function(d3_event) {
54632 d3_event.preventDefault();
54633 }).call(_zoomerPanner).call(_zoomerPanner.transform, projection2.transform()).on("dblclick.zoom", null);
54634 map2.supersurface = supersurface = selection2.append("div").attr("class", "supersurface").call(utilSetTransform, 0, 0);
54635 wrapper = supersurface.append("div").attr("class", "layer layer-data");
54636 map2.surface = surface = wrapper.call(drawLayers).selectAll(".surface");
54637 surface.call(drawLabels.observe).call(_doubleUpHandler).on(_pointerPrefix + "down.zoom", function(d3_event) {
54638 _lastPointerEvent = d3_event;
54639 if (d3_event.button === 2) {
54640 d3_event.stopPropagation();
54642 }, true).on(_pointerPrefix + "up.zoom", function(d3_event) {
54643 _lastPointerEvent = d3_event;
54644 if (resetTransform()) {
54647 }).on(_pointerPrefix + "move.map", function(d3_event) {
54648 _lastPointerEvent = d3_event;
54649 }).on(_pointerPrefix + "over.vertices", function(d3_event) {
54650 if (map2.editableDataEnabled() && !_isTransformed) {
54651 var hover = d3_event.target.__data__;
54652 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
54653 dispatch14.call("drawn", this, { full: false });
54655 }).on(_pointerPrefix + "out.vertices", function(d3_event) {
54656 if (map2.editableDataEnabled() && !_isTransformed) {
54657 var hover = d3_event.relatedTarget && d3_event.relatedTarget.__data__;
54658 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
54659 dispatch14.call("drawn", this, { full: false });
54662 var detected = utilDetect();
54663 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
54664 // but we only need to do this on desktop Safari anyway. – #7694
54665 !detected.isMobileWebKit) {
54666 surface.on("gesturestart.surface", function(d3_event) {
54667 d3_event.preventDefault();
54668 _gestureTransformStart = projection2.transform();
54669 }).on("gesturechange.surface", gestureChange);
54672 _doubleUpHandler.on("doubleUp.map", function(d3_event, p02) {
54673 if (!_dblClickZoomEnabled)
54675 if (typeof d3_event.target.__data__ === "object" && // or area fills
54676 !select_default2(d3_event.target).classed("fill"))
54678 var zoomOut2 = d3_event.shiftKey;
54679 var t2 = projection2.transform();
54680 var p1 = t2.invert(p02);
54681 t2 = t2.scale(zoomOut2 ? 0.5 : 2);
54682 t2.x = p02[0] - p1[0] * t2.k;
54683 t2.y = p02[1] - p1[1] * t2.k;
54684 map2.transformEase(t2);
54686 context.on("enter.map", function() {
54687 if (!map2.editableDataEnabled(
54689 /* skip zoom check */
54692 if (_isTransformed)
54694 var graph = context.graph();
54695 var selectedAndParents = {};
54696 context.selectedIDs().forEach(function(id2) {
54697 var entity = graph.hasEntity(id2);
54699 selectedAndParents[entity.id] = entity;
54700 if (entity.type === "node") {
54701 graph.parentWays(entity).forEach(function(parent) {
54702 selectedAndParents[parent.id] = parent;
54707 var data = Object.values(selectedAndParents);
54708 var filter2 = function(d2) {
54709 return d2.id in selectedAndParents;
54711 data = context.features().filter(data, graph);
54712 surface.call(drawVertices.drawSelected, graph, map2.extent()).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent());
54713 dispatch14.call("drawn", this, { full: false });
54716 map2.dimensions(utilGetDimensions(selection2));
54718 function zoomEventFilter(d3_event) {
54719 if (d3_event.type === "mousedown") {
54720 var hasOrphan = false;
54721 var listeners = window.__on;
54722 for (var i3 = 0; i3 < listeners.length; i3++) {
54723 var listener = listeners[i3];
54724 if (listener.name === "zoom" && listener.type === "mouseup") {
54730 var event = window.CustomEvent;
54732 event = new event("mouseup");
54734 event = window.document.createEvent("Event");
54735 event.initEvent("mouseup", false, false);
54737 event.view = window;
54738 window.dispatchEvent(event);
54741 return d3_event.button !== 2;
54743 function pxCenter() {
54744 return [_dimensions[0] / 2, _dimensions[1] / 2];
54746 function drawEditable(difference, extent) {
54747 var mode = context.mode();
54748 var graph = context.graph();
54749 var features = context.features();
54750 var all = context.history().intersects(map2.extent());
54751 var fullRedraw = false;
54755 var applyFeatureLayerFilters = true;
54756 if (map2.isInWideSelection()) {
54758 utilEntityAndDeepMemberIDs(mode.selectedIDs(), context.graph()).forEach(function(id2) {
54759 var entity = context.hasEntity(id2);
54764 filter2 = utilFunctor(true);
54765 applyFeatureLayerFilters = false;
54766 } else if (difference) {
54767 var complete = difference.complete(map2.extent());
54768 data = Object.values(complete).filter(Boolean);
54769 set3 = new Set(Object.keys(complete));
54770 filter2 = function(d2) {
54771 return set3.has(d2.id);
54773 features.clear(data);
54775 if (features.gatherStats(all, graph, _dimensions)) {
54779 data = context.history().intersects(map2.extent().intersection(extent));
54780 set3 = new Set(data.map(function(entity) {
54783 filter2 = function(d2) {
54784 return set3.has(d2.id);
54789 filter2 = utilFunctor(true);
54792 if (applyFeatureLayerFilters) {
54793 data = features.filter(data, graph);
54795 context.features().resetStats();
54797 if (mode && mode.id === "select") {
54798 surface.call(drawVertices.drawSelected, graph, map2.extent());
54800 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);
54801 dispatch14.call("drawn", this, { full: true });
54803 map2.init = function() {
54804 drawLayers = svgLayers(projection2, context);
54805 drawPoints = svgPoints(projection2, context);
54806 drawVertices = svgVertices(projection2, context);
54807 drawLines = svgLines(projection2, context);
54808 drawAreas = svgAreas(projection2, context);
54809 drawMidpoints = svgMidpoints(projection2, context);
54810 drawLabels = svgLabels(projection2, context);
54812 function editOff() {
54813 context.features().resetStats();
54814 surface.selectAll(".layer-osm *").remove();
54815 surface.selectAll(".layer-touch:not(.markers) *").remove();
54819 "select-note": true,
54820 "select-data": true,
54821 "select-error": true
54823 var mode = context.mode();
54824 if (mode && !allowed[mode.id]) {
54825 context.enter(modeBrowse(context));
54827 dispatch14.call("drawn", this, { full: true });
54829 function gestureChange(d3_event) {
54831 e3.preventDefault();
54834 // dummy values to ignore in zoomPan
54836 // dummy values to ignore in zoomPan
54837 clientX: e3.clientX,
54838 clientY: e3.clientY,
54839 screenX: e3.screenX,
54840 screenY: e3.screenY,
54844 var e22 = new WheelEvent("wheel", props);
54845 e22._scale = e3.scale;
54846 e22._rotation = e3.rotation;
54847 _selection.node().dispatchEvent(e22);
54849 function zoomPan2(event, key, transform2) {
54850 var source = event && event.sourceEvent || event;
54851 var eventTransform = transform2 || event && event.transform;
54852 var x2 = eventTransform.x;
54853 var y2 = eventTransform.y;
54854 var k2 = eventTransform.k;
54855 if (source && source.type === "wheel") {
54858 var detected = utilDetect();
54859 var dX = source.deltaX;
54860 var dY = source.deltaY;
54865 if (source.deltaMode === 1) {
54866 var lines = Math.abs(source.deltaY);
54867 var sign2 = source.deltaY > 0 ? 1 : -1;
54868 dY = sign2 * clamp(
54869 Math.exp((lines - 1) * 0.75) * 4.000244140625,
54875 if (detected.os !== "mac") {
54878 t0 = _isTransformed ? _transformLast : _transformStart;
54879 p02 = _getMouseCoords(source);
54880 p1 = t0.invert(p02);
54881 k22 = t0.k * Math.pow(2, -dY / 500);
54882 k22 = clamp(k22, kMin, kMax);
54883 x22 = p02[0] - p1[0] * k22;
54884 y22 = p02[1] - p1[1] * k22;
54885 } else if (source._scale) {
54886 t0 = _gestureTransformStart;
54887 p02 = _getMouseCoords(source);
54888 p1 = t0.invert(p02);
54889 k22 = t0.k * source._scale;
54890 k22 = clamp(k22, kMin, kMax);
54891 x22 = p02[0] - p1[0] * k22;
54892 y22 = p02[1] - p1[1] * k22;
54893 } else if (source.ctrlKey && !isInteger(dY)) {
54895 t0 = _isTransformed ? _transformLast : _transformStart;
54896 p02 = _getMouseCoords(source);
54897 p1 = t0.invert(p02);
54898 k22 = t0.k * Math.pow(2, -dY / 500);
54899 k22 = clamp(k22, kMin, kMax);
54900 x22 = p02[0] - p1[0] * k22;
54901 y22 = p02[1] - p1[1] * k22;
54902 } else if ((source.altKey || source.shiftKey) && isInteger(dY)) {
54903 t0 = _isTransformed ? _transformLast : _transformStart;
54904 p02 = _getMouseCoords(source);
54905 p1 = t0.invert(p02);
54906 k22 = t0.k * Math.pow(2, -dY / 500);
54907 k22 = clamp(k22, kMin, kMax);
54908 x22 = p02[0] - p1[0] * k22;
54909 y22 = p02[1] - p1[1] * k22;
54910 } else if (detected.os === "mac" && detected.browser !== "Firefox" && !source.ctrlKey && isInteger(dX) && isInteger(dY)) {
54911 p1 = projection2.translate();
54914 k22 = projection2.scale();
54915 k22 = clamp(k22, kMin, kMax);
54917 if (x22 !== x2 || y22 !== y2 || k22 !== k2) {
54921 eventTransform = identity2.translate(x22, y22).scale(k22);
54922 if (_zoomerPanner._transform) {
54923 _zoomerPanner._transform(eventTransform);
54925 _selection.node().__zoom = eventTransform;
54929 if (_transformStart.x === x2 && _transformStart.y === y2 && _transformStart.k === k2) {
54932 if (geoScaleToZoom(k2, TILESIZE) < _minzoom) {
54933 surface.interrupt();
54934 dispatch14.call("hitMinZoom", this, map2);
54935 setCenterZoom(map2.center(), context.minEditableZoom(), 0, true);
54937 dispatch14.call("move", this, map2);
54940 projection2.transform(eventTransform);
54941 var withinEditableZoom = map2.withinEditableZoom();
54942 if (_lastWithinEditableZoom !== withinEditableZoom) {
54943 if (_lastWithinEditableZoom !== void 0) {
54944 dispatch14.call("crossEditableZoom", this, withinEditableZoom);
54946 _lastWithinEditableZoom = withinEditableZoom;
54948 var scale = k2 / _transformStart.k;
54949 var tX = (x2 / scale - _transformStart.x) * scale;
54950 var tY = (y2 / scale - _transformStart.y) * scale;
54951 if (context.inIntro()) {
54952 curtainProjection.transform({
54959 _lastPointerEvent = event;
54961 _isTransformed = true;
54962 _transformLast = eventTransform;
54963 utilSetTransform(supersurface, tX, tY, scale);
54965 dispatch14.call("move", this, map2);
54966 function isInteger(val) {
54967 return typeof val === "number" && isFinite(val) && Math.floor(val) === val;
54970 function resetTransform() {
54971 if (!_isTransformed)
54973 utilSetTransform(supersurface, 0, 0);
54974 _isTransformed = false;
54975 if (context.inIntro()) {
54976 curtainProjection.transform(projection2.transform());
54980 function redraw(difference, extent) {
54981 if (surface.empty() || !_redrawEnabled)
54983 if (resetTransform()) {
54984 difference = extent = void 0;
54986 var zoom = map2.zoom();
54987 var z2 = String(~~zoom);
54988 if (surface.attr("data-zoom") !== z2) {
54989 surface.attr("data-zoom", z2);
54991 var lat = map2.center()[1];
54992 var lowzoom = linear3().domain([-60, 0, 60]).range([17, 18.5, 17]).clamp(true);
54993 surface.classed("low-zoom", zoom <= lowzoom(lat));
54995 supersurface.call(context.background());
54996 wrapper.call(drawLayers);
54998 if (map2.editableDataEnabled() || map2.isInWideSelection()) {
54999 context.loadTiles(projection2);
55000 drawEditable(difference, extent);
55004 _transformStart = projection2.transform();
55007 var immediateRedraw = function(difference, extent) {
55008 if (!difference && !extent)
55009 cancelPendingRedraw();
55010 redraw(difference, extent);
55012 map2.lastPointerEvent = function() {
55013 return _lastPointerEvent;
55015 map2.mouse = function(d3_event) {
55016 var event = d3_event || _lastPointerEvent;
55019 while (s2 = event.sourceEvent) {
55022 return _getMouseCoords(event);
55026 map2.mouseCoordinates = function() {
55027 var coord2 = map2.mouse() || pxCenter();
55028 return projection2.invert(coord2);
55030 map2.dblclickZoomEnable = function(val) {
55031 if (!arguments.length)
55032 return _dblClickZoomEnabled;
55033 _dblClickZoomEnabled = val;
55036 map2.redrawEnable = function(val) {
55037 if (!arguments.length)
55038 return _redrawEnabled;
55039 _redrawEnabled = val;
55042 map2.isTransformed = function() {
55043 return _isTransformed;
55045 function setTransform(t2, duration, force) {
55046 var t3 = projection2.transform();
55047 if (!force && t2.k === t3.k && t2.x === t3.x && t2.y === t3.y)
55050 _selection.transition().duration(duration).on("start", function() {
55052 }).call(_zoomerPanner.transform, identity2.translate(t2.x, t2.y).scale(t2.k));
55054 projection2.transform(t2);
55055 _transformStart = t2;
55056 _selection.call(_zoomerPanner.transform, _transformStart);
55060 function setCenterZoom(loc2, z2, duration, force) {
55061 var c2 = map2.center();
55062 var z3 = map2.zoom();
55063 if (loc2[0] === c2[0] && loc2[1] === c2[1] && z2 === z3 && !force)
55065 var proj = geoRawMercator().transform(projection2.transform());
55066 var k2 = clamp(geoZoomToScale(z2, TILESIZE), kMin, kMax);
55068 var t2 = proj.translate();
55069 var point2 = proj(loc2);
55070 var center = pxCenter();
55071 t2[0] += center[0] - point2[0];
55072 t2[1] += center[1] - point2[1];
55073 return setTransform(identity2.translate(t2[0], t2[1]).scale(k2), duration, force);
55075 map2.pan = function(delta, duration) {
55076 var t2 = projection2.translate();
55077 var k2 = projection2.scale();
55081 _selection.transition().duration(duration).on("start", function() {
55083 }).call(_zoomerPanner.transform, identity2.translate(t2[0], t2[1]).scale(k2));
55085 projection2.translate(t2);
55086 _transformStart = projection2.transform();
55087 _selection.call(_zoomerPanner.transform, _transformStart);
55088 dispatch14.call("move", this, map2);
55093 map2.dimensions = function(val) {
55094 if (!arguments.length)
55095 return _dimensions;
55097 drawLayers.dimensions(_dimensions);
55098 context.background().dimensions(_dimensions);
55099 projection2.clipExtent([[0, 0], _dimensions]);
55100 _getMouseCoords = utilFastMouse(supersurface.node());
55104 function zoomIn(delta) {
55105 setCenterZoom(map2.center(), ~~map2.zoom() + delta, 250, true);
55107 function zoomOut(delta) {
55108 setCenterZoom(map2.center(), ~~map2.zoom() - delta, 250, true);
55110 map2.zoomIn = function() {
55113 map2.zoomInFurther = function() {
55116 map2.canZoomIn = function() {
55117 return map2.zoom() < maxZoom;
55119 map2.zoomOut = function() {
55122 map2.zoomOutFurther = function() {
55125 map2.canZoomOut = function() {
55126 return map2.zoom() > minZoom2;
55128 map2.center = function(loc2) {
55129 if (!arguments.length) {
55130 return projection2.invert(pxCenter());
55132 if (setCenterZoom(loc2, map2.zoom())) {
55133 dispatch14.call("move", this, map2);
55138 map2.unobscuredCenterZoomEase = function(loc, zoom) {
55139 var offset = map2.unobscuredOffsetPx();
55140 var proj = geoRawMercator().transform(projection2.transform());
55141 proj.scale(geoZoomToScale(zoom, TILESIZE));
55142 var locPx = proj(loc);
55143 var offsetLocPx = [locPx[0] + offset[0], locPx[1] + offset[1]];
55144 var offsetLoc = proj.invert(offsetLocPx);
55145 map2.centerZoomEase(offsetLoc, zoom);
55147 map2.unobscuredOffsetPx = function() {
55148 var openPane = context.container().select(".map-panes .map-pane.shown");
55149 if (!openPane.empty()) {
55150 return [openPane.node().offsetWidth / 2, 0];
55154 map2.zoom = function(z2) {
55155 if (!arguments.length) {
55156 return Math.max(geoScaleToZoom(projection2.scale(), TILESIZE), 0);
55158 if (z2 < _minzoom) {
55159 surface.interrupt();
55160 dispatch14.call("hitMinZoom", this, map2);
55161 z2 = context.minEditableZoom();
55163 if (setCenterZoom(map2.center(), z2)) {
55164 dispatch14.call("move", this, map2);
55169 map2.centerZoom = function(loc2, z2) {
55170 if (setCenterZoom(loc2, z2)) {
55171 dispatch14.call("move", this, map2);
55176 map2.zoomTo = function(entity) {
55177 var extent = entity.extent(context.graph());
55178 if (!isFinite(extent.area()))
55180 var z2 = clamp(map2.trimmedExtentZoom(extent), 0, 20);
55181 return map2.centerZoom(extent.center(), z2);
55183 map2.centerEase = function(loc2, duration) {
55184 duration = duration || 250;
55185 setCenterZoom(loc2, map2.zoom(), duration);
55188 map2.zoomEase = function(z2, duration) {
55189 duration = duration || 250;
55190 setCenterZoom(map2.center(), z2, duration, false);
55193 map2.centerZoomEase = function(loc2, z2, duration) {
55194 duration = duration || 250;
55195 setCenterZoom(loc2, z2, duration, false);
55198 map2.transformEase = function(t2, duration) {
55199 duration = duration || 250;
55208 map2.zoomToEase = function(obj, duration) {
55210 if (Array.isArray(obj)) {
55211 obj.forEach(function(entity) {
55212 var entityExtent = entity.extent(context.graph());
55214 extent = entityExtent;
55216 extent = extent.extend(entityExtent);
55220 extent = obj.extent(context.graph());
55222 if (!isFinite(extent.area()))
55224 var z2 = clamp(map2.trimmedExtentZoom(extent), 0, 20);
55225 return map2.centerZoomEase(extent.center(), z2, duration);
55227 map2.startEase = function() {
55228 utilBindOnce(surface, _pointerPrefix + "down.ease", function() {
55233 map2.cancelEase = function() {
55234 _selection.interrupt();
55237 map2.extent = function(val) {
55238 if (!arguments.length) {
55239 return new geoExtent(
55240 projection2.invert([0, _dimensions[1]]),
55241 projection2.invert([_dimensions[0], 0])
55244 var extent = geoExtent(val);
55245 map2.centerZoom(extent.center(), map2.extentZoom(extent));
55248 map2.trimmedExtent = function(val) {
55249 if (!arguments.length) {
55253 return new geoExtent(
55254 projection2.invert([pad2, _dimensions[1] - footerY - pad2]),
55255 projection2.invert([_dimensions[0] - pad2, headerY + pad2])
55258 var extent = geoExtent(val);
55259 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
55262 function calcExtentZoom(extent, dim) {
55263 var tl = projection2([extent[0][0], extent[1][1]]);
55264 var br = projection2([extent[1][0], extent[0][1]]);
55265 var hFactor = (br[0] - tl[0]) / dim[0];
55266 var vFactor = (br[1] - tl[1]) / dim[1];
55267 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
55268 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
55269 var newZoom = map2.zoom() - Math.max(hZoomDiff, vZoomDiff);
55272 map2.extentZoom = function(val) {
55273 return calcExtentZoom(geoExtent(val), _dimensions);
55275 map2.trimmedExtentZoom = function(val) {
55278 var trimmed = [_dimensions[0] - trimX, _dimensions[1] - trimY];
55279 return calcExtentZoom(geoExtent(val), trimmed);
55281 map2.withinEditableZoom = function() {
55282 return map2.zoom() >= context.minEditableZoom();
55284 map2.isInWideSelection = function() {
55285 return !map2.withinEditableZoom() && context.selectedIDs().length;
55287 map2.editableDataEnabled = function(skipZoomCheck) {
55288 var layer = context.layers().layer("osm");
55289 if (!layer || !layer.enabled())
55291 return skipZoomCheck || map2.withinEditableZoom();
55293 map2.notesEditable = function() {
55294 var layer = context.layers().layer("notes");
55295 if (!layer || !layer.enabled())
55297 return map2.withinEditableZoom();
55299 map2.minzoom = function(val) {
55300 if (!arguments.length)
55305 map2.toggleHighlightEdited = function() {
55306 surface.classed("highlight-edited", !surface.classed("highlight-edited"));
55308 dispatch14.call("changeHighlighting", this);
55310 map2.areaFillOptions = ["wireframe", "partial", "full"];
55311 map2.activeAreaFill = function(val) {
55312 if (!arguments.length)
55313 return corePreferences("area-fill") || "partial";
55314 corePreferences("area-fill", val);
55315 if (val !== "wireframe") {
55316 corePreferences("area-fill-toggle", val);
55320 dispatch14.call("changeAreaFill", this);
55323 map2.toggleWireframe = function() {
55324 var activeFill = map2.activeAreaFill();
55325 if (activeFill === "wireframe") {
55326 activeFill = corePreferences("area-fill-toggle") || "partial";
55328 activeFill = "wireframe";
55330 map2.activeAreaFill(activeFill);
55332 function updateAreaFill() {
55333 var activeFill = map2.activeAreaFill();
55334 map2.areaFillOptions.forEach(function(opt) {
55335 surface.classed("fill-" + opt, Boolean(opt === activeFill));
55338 map2.layers = () => drawLayers;
55339 map2.doubleUpHandler = function() {
55340 return _doubleUpHandler;
55342 return utilRebind(map2, dispatch14, "on");
55345 // modules/renderer/photos.js
55346 function rendererPhotos(context) {
55347 var dispatch14 = dispatch_default("change");
55348 var _layerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder"];
55349 var _allPhotoTypes = ["flat", "panoramic"];
55350 var _shownPhotoTypes = _allPhotoTypes.slice();
55351 var _dateFilters = ["fromDate", "toDate"];
55355 function photos() {
55357 function updateStorage() {
55360 var hash = utilStringQs(window.location.hash);
55361 var enabled = context.layers().all().filter(function(d2) {
55362 return _layerIDs.indexOf(d2.id) !== -1 && d2.layer && d2.layer.supported() && d2.layer.enabled();
55363 }).map(function(d2) {
55366 if (enabled.length) {
55367 hash.photo_overlay = enabled.join(",");
55369 delete hash.photo_overlay;
55371 window.location.replace("#" + utilQsString(hash, true));
55373 photos.overlayLayerIDs = function() {
55376 photos.allPhotoTypes = function() {
55377 return _allPhotoTypes;
55379 photos.dateFilters = function() {
55380 return _dateFilters;
55382 photos.dateFilterValue = function(val) {
55383 return val === _dateFilters[0] ? _fromDate : _toDate;
55385 photos.setDateFilter = function(type2, val, updateUrl) {
55386 var date = val && new Date(val);
55387 if (date && !isNaN(date)) {
55388 val = date.toISOString().slice(0, 10);
55392 if (type2 === _dateFilters[0]) {
55394 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
55395 _toDate = _fromDate;
55398 if (type2 === _dateFilters[1]) {
55400 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
55401 _fromDate = _toDate;
55404 dispatch14.call("change", this);
55407 if (_fromDate || _toDate) {
55408 rangeString = (_fromDate || "") + "_" + (_toDate || "");
55410 setUrlFilterValue("photo_dates", rangeString);
55413 photos.setUsernameFilter = function(val, updateUrl) {
55414 if (val && typeof val === "string")
55415 val = val.replace(/;/g, ",").split(",");
55417 val = val.map((d2) => d2.trim()).filter(Boolean);
55423 dispatch14.call("change", this);
55427 hashString = _usernames.join(",");
55429 setUrlFilterValue("photo_username", hashString);
55432 function setUrlFilterValue(property, val) {
55433 if (!window.mocha) {
55434 var hash = utilStringQs(window.location.hash);
55436 if (hash[property] === val)
55438 hash[property] = val;
55440 if (!(property in hash))
55442 delete hash[property];
55444 window.location.replace("#" + utilQsString(hash, true));
55447 function showsLayer(id2) {
55448 var layer = context.layers().layer(id2);
55449 return layer && layer.supported() && layer.enabled();
55451 photos.shouldFilterByDate = function() {
55452 return showsLayer("mapillary") || showsLayer("kartaview") || showsLayer("streetside") || showsLayer("vegbilder");
55454 photos.shouldFilterByPhotoType = function() {
55455 return showsLayer("mapillary") || showsLayer("streetside") && showsLayer("kartaview") || showsLayer("vegbilder");
55457 photos.shouldFilterByUsername = function() {
55458 return !showsLayer("mapillary") && showsLayer("kartaview") && !showsLayer("streetside");
55460 photos.showsPhotoType = function(val) {
55461 if (!photos.shouldFilterByPhotoType())
55463 return _shownPhotoTypes.indexOf(val) !== -1;
55465 photos.showsFlat = function() {
55466 return photos.showsPhotoType("flat");
55468 photos.showsPanoramic = function() {
55469 return photos.showsPhotoType("panoramic");
55471 photos.fromDate = function() {
55474 photos.toDate = function() {
55477 photos.togglePhotoType = function(val) {
55478 var index = _shownPhotoTypes.indexOf(val);
55479 if (index !== -1) {
55480 _shownPhotoTypes.splice(index, 1);
55482 _shownPhotoTypes.push(val);
55484 dispatch14.call("change", this);
55487 photos.usernames = function() {
55490 photos.init = function() {
55491 var hash = utilStringQs(window.location.hash);
55492 if (hash.photo_dates) {
55493 var parts = /^(.*)[–_](.*)$/g.exec(hash.photo_dates.trim());
55494 this.setDateFilter("fromDate", parts && parts.length >= 2 && parts[1], false);
55495 this.setDateFilter("toDate", parts && parts.length >= 3 && parts[2], false);
55497 if (hash.photo_username) {
55498 this.setUsernameFilter(hash.photo_username, false);
55500 if (hash.photo_overlay) {
55501 var hashOverlayIDs = hash.photo_overlay.replace(/;/g, ",").split(",");
55502 hashOverlayIDs.forEach(function(id2) {
55503 if (id2 === "openstreetcam")
55505 var layer2 = _layerIDs.indexOf(id2) !== -1 && context.layers().layer(id2);
55506 if (layer2 && !layer2.enabled())
55507 layer2.enabled(true);
55511 var photoIds = hash.photo.replace(/;/g, ",").split(",");
55512 var photoId = photoIds.length && photoIds[0].trim();
55513 var results = /(.*)\/(.*)/g.exec(photoId);
55514 if (results && results.length >= 3) {
55515 var serviceId = results[1];
55516 if (serviceId === "openstreetcam")
55517 serviceId = "kartaview";
55518 var photoKey = results[2];
55519 var service = services[serviceId];
55520 if (service && service.ensureViewerLoaded) {
55521 var layer = _layerIDs.indexOf(serviceId) !== -1 && context.layers().layer(serviceId);
55522 if (layer && !layer.enabled())
55523 layer.enabled(true);
55524 var baselineTime = Date.now();
55525 service.on("loadedImages.rendererPhotos", function() {
55526 if (Date.now() - baselineTime > 45e3) {
55527 service.on("loadedImages.rendererPhotos", null);
55530 if (!service.cachedImage(photoKey))
55532 service.on("loadedImages.rendererPhotos", null);
55533 service.ensureViewerLoaded(context).then(function() {
55534 service.selectImage(context, photoKey).showViewer(context);
55540 context.layers().on("change.rendererPhotos", updateStorage);
55542 return utilRebind(photos, dispatch14, "on");
55545 // modules/ui/account.js
55546 function uiAccount(context) {
55547 const osm = context.connection();
55548 function updateUserDetails(selection2) {
55551 if (!osm.authenticated()) {
55552 render(selection2, null);
55554 osm.userDetails((err, user) => render(selection2, user));
55557 function render(selection2, user) {
55558 let userInfo = selection2.select(".userInfo");
55559 let loginLogout = selection2.select(".loginLogout");
55561 userInfo.html("").classed("hide", false);
55562 let userLink = userInfo.append("a").attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
55563 if (user.image_url) {
55564 userLink.append("img").attr("class", "icon pre-text user-icon").attr("src", user.image_url);
55566 userLink.call(svgIcon("#iD-icon-avatar", "pre-text light"));
55568 userLink.append("span").attr("class", "label").html(user.display_name);
55569 loginLogout.classed("hide", false).select("a").text(_t("logout")).on("click", (e3) => {
55570 e3.preventDefault();
55575 userInfo.html("").classed("hide", true);
55576 loginLogout.classed("hide", false).select("a").text(_t("login")).on("click", (e3) => {
55577 e3.preventDefault();
55578 osm.authenticate();
55582 function tryLogout() {
55585 const url = osm.getUrlRoot() + "/logout?referer=%2Flogin";
55591 ["left", window.screen.width / 2 - w2 / 2],
55592 ["top", window.screen.height / 2 - h2 / 2]
55593 ].map((x2) => x2.join("=")).join(",");
55594 window.open(url, "_blank", settings);
55596 return function(selection2) {
55599 selection2.append("li").attr("class", "userInfo").classed("hide", true);
55600 selection2.append("li").attr("class", "loginLogout").classed("hide", true).append("a").attr("href", "#");
55601 osm.on("change.account", () => updateUserDetails(selection2));
55602 updateUserDetails(selection2);
55606 // modules/ui/attribution.js
55607 function uiAttribution(context) {
55608 let _selection = select_default2(null);
55609 function render(selection2, data, klass) {
55610 let div = selection2.selectAll(`.${klass}`).data([0]);
55611 div = div.enter().append("div").attr("class", klass).merge(div);
55612 let attributions = div.selectAll(".attribution").data(data, (d2) => d2.id);
55613 attributions.exit().remove();
55614 attributions = attributions.enter().append("span").attr("class", "attribution").each((d2, i3, nodes) => {
55615 let attribution = select_default2(nodes[i3]);
55616 if (d2.terms_html) {
55617 attribution.html(d2.terms_html);
55620 if (d2.terms_url) {
55621 attribution = attribution.append("a").attr("href", d2.terms_url).attr("target", "_blank");
55623 const sourceID = d2.id.replace(/\./g, "<TX_DOT>");
55624 const terms_text = _t(
55625 `imagery.${sourceID}.attribution.text`,
55626 { default: d2.terms_text || d2.id || d2.name() }
55628 if (d2.icon && !d2.overlay) {
55629 attribution.append("img").attr("class", "source-image").attr("src", d2.icon);
55631 attribution.append("span").attr("class", "attribution-text").text(terms_text);
55632 }).merge(attributions);
55633 let copyright = attributions.selectAll(".copyright-notice").data((d2) => {
55634 let notice = d2.copyrightNotices(context.map().zoom(), context.map().extent());
55635 return notice ? [notice] : [];
55637 copyright.exit().remove();
55638 copyright = copyright.enter().append("span").attr("class", "copyright-notice").merge(copyright);
55639 copyright.text(String);
55641 function update() {
55642 let baselayer = context.background().baseLayerSource();
55643 _selection.call(render, baselayer ? [baselayer] : [], "base-layer-attribution");
55644 const z2 = context.map().zoom();
55645 let overlays = context.background().overlayLayerSources() || [];
55646 _selection.call(render, overlays.filter((s2) => s2.validZoom(z2)), "overlay-layer-attribution");
55648 return function(selection2) {
55649 _selection = selection2;
55650 context.background().on("change.attribution", update);
55651 context.map().on("move.attribution", throttle_default(update, 400, { leading: false }));
55656 // modules/ui/contributors.js
55657 function uiContributors(context) {
55658 var osm = context.connection(), debouncedUpdate = debounce_default(function() {
55660 }, 1e3), limit = 4, hidden = false, wrap2 = select_default2(null);
55661 function update() {
55664 var users = {}, entities = context.history().intersects(context.map().extent());
55665 entities.forEach(function(entity) {
55666 if (entity && entity.user)
55667 users[entity.user] = true;
55669 var u2 = Object.keys(users), subset = u2.slice(0, u2.length > limit ? limit - 1 : limit);
55670 wrap2.html("").call(svgIcon("#iD-icon-nearby", "pre-text light"));
55671 var userList = select_default2(document.createElement("span"));
55672 userList.selectAll().data(subset).enter().append("a").attr("class", "user-link").attr("href", function(d2) {
55673 return osm.userURL(d2);
55674 }).attr("target", "_blank").text(String);
55675 if (u2.length > limit) {
55676 var count = select_default2(document.createElement("span"));
55677 var othersNum = u2.length - limit + 1;
55678 count.append("a").attr("target", "_blank").attr("href", function() {
55679 return osm.changesetsURL(context.map().center(), context.map().zoom());
55680 }).text(othersNum);
55681 wrap2.append("span").html(_t.html("contributors.truncated_list", { n: othersNum, users: { html: userList.html() }, count: { html: count.html() } }));
55683 wrap2.append("span").html(_t.html("contributors.list", { users: { html: userList.html() } }));
55687 wrap2.transition().style("opacity", 0);
55688 } else if (hidden) {
55689 wrap2.transition().style("opacity", 1);
55692 return function(selection2) {
55695 wrap2 = selection2;
55697 osm.on("loaded.contributors", debouncedUpdate);
55698 context.map().on("move.contributors", debouncedUpdate);
55702 // modules/ui/popover.js
55703 var _popoverID = 0;
55704 function uiPopover(klass) {
55705 var _id = _popoverID++;
55706 var _anchorSelection = select_default2(null);
55707 var popover = function(selection2) {
55708 _anchorSelection = selection2;
55709 selection2.each(setup);
55711 var _animation = utilFunctor(false);
55712 var _placement = utilFunctor("top");
55713 var _alignment = utilFunctor("center");
55714 var _scrollContainer = utilFunctor(select_default2(null));
55716 var _displayType = utilFunctor("");
55717 var _hasArrow = utilFunctor(true);
55718 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
55719 popover.displayType = function(val) {
55720 if (arguments.length) {
55721 _displayType = utilFunctor(val);
55724 return _displayType;
55727 popover.hasArrow = function(val) {
55728 if (arguments.length) {
55729 _hasArrow = utilFunctor(val);
55735 popover.placement = function(val) {
55736 if (arguments.length) {
55737 _placement = utilFunctor(val);
55743 popover.alignment = function(val) {
55744 if (arguments.length) {
55745 _alignment = utilFunctor(val);
55751 popover.scrollContainer = function(val) {
55752 if (arguments.length) {
55753 _scrollContainer = utilFunctor(val);
55756 return _scrollContainer;
55759 popover.content = function(val) {
55760 if (arguments.length) {
55767 popover.isShown = function() {
55768 var popoverSelection = _anchorSelection.select(".popover-" + _id);
55769 return !popoverSelection.empty() && popoverSelection.classed("in");
55771 popover.show = function() {
55772 _anchorSelection.each(show);
55774 popover.updateContent = function() {
55775 _anchorSelection.each(updateContent);
55777 popover.hide = function() {
55778 _anchorSelection.each(hide);
55780 popover.toggle = function() {
55781 _anchorSelection.each(toggle);
55783 popover.destroy = function(selection2, selector) {
55784 selector = selector || ".popover-" + _id;
55785 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() {
55786 return this.getAttribute("data-original-title") || this.getAttribute("title");
55787 }).attr("data-original-title", null).selectAll(selector).remove();
55789 popover.destroyAny = function(selection2) {
55790 selection2.call(popover.destroy, ".popover");
55793 var anchor = select_default2(this);
55794 var animate = _animation.apply(this, arguments);
55795 var popoverSelection = anchor.selectAll(".popover-" + _id).data([0]);
55796 var enter = popoverSelection.enter().append("div").attr("class", "popover popover-" + _id + " " + (klass ? klass : "")).classed("arrowed", _hasArrow.apply(this, arguments));
55797 enter.append("div").attr("class", "popover-arrow");
55798 enter.append("div").attr("class", "popover-inner");
55799 popoverSelection = enter.merge(popoverSelection);
55801 popoverSelection.classed("fade", true);
55803 var display = _displayType.apply(this, arguments);
55804 if (display === "hover") {
55805 var _lastNonMouseEnterTime;
55806 anchor.on(_pointerPrefix + "enter.popover", function(d3_event) {
55807 if (d3_event.pointerType) {
55808 if (d3_event.pointerType !== "mouse") {
55809 _lastNonMouseEnterTime = d3_event.timeStamp;
55811 } else if (_lastNonMouseEnterTime && d3_event.timeStamp - _lastNonMouseEnterTime < 1500) {
55815 if (d3_event.buttons !== 0)
55817 show.apply(this, arguments);
55818 }).on(_pointerPrefix + "leave.popover", function() {
55819 hide.apply(this, arguments);
55820 }).on("focus.popover", function() {
55821 show.apply(this, arguments);
55822 }).on("blur.popover", function() {
55823 hide.apply(this, arguments);
55825 } else if (display === "clickFocus") {
55826 anchor.on(_pointerPrefix + "down.popover", function(d3_event) {
55827 d3_event.preventDefault();
55828 d3_event.stopPropagation();
55829 }).on(_pointerPrefix + "up.popover", function(d3_event) {
55830 d3_event.preventDefault();
55831 d3_event.stopPropagation();
55832 }).on("click.popover", toggle);
55833 popoverSelection.attr("tabindex", 0).on("blur.popover", function() {
55834 anchor.each(function() {
55835 hide.apply(this, arguments);
55841 var anchor = select_default2(this);
55842 var popoverSelection = anchor.selectAll(".popover-" + _id);
55843 if (popoverSelection.empty()) {
55844 anchor.call(popover.destroy);
55845 anchor.each(setup);
55846 popoverSelection = anchor.selectAll(".popover-" + _id);
55848 popoverSelection.classed("in", true);
55849 var displayType = _displayType.apply(this, arguments);
55850 if (displayType === "clickFocus") {
55851 anchor.classed("active", true);
55852 popoverSelection.node().focus();
55854 anchor.each(updateContent);
55856 function updateContent() {
55857 var anchor = select_default2(this);
55859 anchor.selectAll(".popover-" + _id + " > .popover-inner").call(_content.apply(this, arguments));
55861 updatePosition.apply(this, arguments);
55862 updatePosition.apply(this, arguments);
55863 updatePosition.apply(this, arguments);
55865 function updatePosition() {
55866 var anchor = select_default2(this);
55867 var popoverSelection = anchor.selectAll(".popover-" + _id);
55868 var scrollContainer = _scrollContainer && _scrollContainer.apply(this, arguments);
55869 var scrollNode = scrollContainer && !scrollContainer.empty() && scrollContainer.node();
55870 var scrollLeft = scrollNode ? scrollNode.scrollLeft : 0;
55871 var scrollTop = scrollNode ? scrollNode.scrollTop : 0;
55872 var placement = _placement.apply(this, arguments);
55873 popoverSelection.classed("left", false).classed("right", false).classed("top", false).classed("bottom", false).classed(placement, true);
55874 var alignment = _alignment.apply(this, arguments);
55875 var alignFactor = 0.5;
55876 if (alignment === "leading") {
55878 } else if (alignment === "trailing") {
55881 var anchorFrame = getFrame(anchor.node());
55882 var popoverFrame = getFrame(popoverSelection.node());
55884 switch (placement) {
55887 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
55888 y: anchorFrame.y - popoverFrame.h
55893 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
55894 y: anchorFrame.y + anchorFrame.h
55899 x: anchorFrame.x - popoverFrame.w,
55900 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
55905 x: anchorFrame.x + anchorFrame.w,
55906 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
55911 if (scrollNode && (placement === "top" || placement === "bottom")) {
55912 var initialPosX = position.x;
55913 if (position.x + popoverFrame.w > scrollNode.offsetWidth - 10) {
55914 position.x = scrollNode.offsetWidth - 10 - popoverFrame.w;
55915 } else if (position.x < 10) {
55918 var arrow = anchor.selectAll(".popover-" + _id + " > .popover-arrow");
55919 var arrowPosX = Math.min(Math.max(popoverFrame.w / 2 - (position.x - initialPosX), 10), popoverFrame.w - 10);
55920 arrow.style("left", ~~arrowPosX + "px");
55922 popoverSelection.style("left", ~~position.x + "px").style("top", ~~position.y + "px");
55924 popoverSelection.style("left", null).style("top", null);
55926 function getFrame(node) {
55927 var positionStyle = select_default2(node).style("position");
55928 if (positionStyle === "absolute" || positionStyle === "static") {
55930 x: node.offsetLeft - scrollLeft,
55931 y: node.offsetTop - scrollTop,
55932 w: node.offsetWidth,
55933 h: node.offsetHeight
55939 w: node.offsetWidth,
55940 h: node.offsetHeight
55946 var anchor = select_default2(this);
55947 if (_displayType.apply(this, arguments) === "clickFocus") {
55948 anchor.classed("active", false);
55950 anchor.selectAll(".popover-" + _id).classed("in", false);
55952 function toggle() {
55953 if (select_default2(this).select(".popover-" + _id).classed("in")) {
55954 hide.apply(this, arguments);
55956 show.apply(this, arguments);
55962 // modules/ui/tooltip.js
55963 function uiTooltip(klass) {
55964 var tooltip = uiPopover((klass || "") + " tooltip").displayType("hover");
55965 var _title = function() {
55966 var title = this.getAttribute("data-original-title");
55970 title = this.getAttribute("title");
55971 this.removeAttribute("title");
55972 this.setAttribute("data-original-title", title);
55976 var _heading = utilFunctor(null);
55977 var _keys = utilFunctor(null);
55978 tooltip.title = function(val) {
55979 if (!arguments.length)
55981 _title = utilFunctor(val);
55984 tooltip.heading = function(val) {
55985 if (!arguments.length)
55987 _heading = utilFunctor(val);
55990 tooltip.keys = function(val) {
55991 if (!arguments.length)
55993 _keys = utilFunctor(val);
55996 tooltip.content(function() {
55997 var heading = _heading.apply(this, arguments);
55998 var text2 = _title.apply(this, arguments);
55999 var keys2 = _keys.apply(this, arguments);
56000 var headingCallback = typeof heading === "function" ? heading : (s2) => s2.text(heading);
56001 var textCallback = typeof text2 === "function" ? text2 : (s2) => s2.text(text2);
56002 return function(selection2) {
56003 var headingSelect = selection2.selectAll(".tooltip-heading").data(heading ? [heading] : []);
56004 headingSelect.exit().remove();
56005 headingSelect.enter().append("div").attr("class", "tooltip-heading").merge(headingSelect).text("").call(headingCallback);
56006 var textSelect = selection2.selectAll(".tooltip-text").data(text2 ? [text2] : []);
56007 textSelect.exit().remove();
56008 textSelect.enter().append("div").attr("class", "tooltip-text").merge(textSelect).text("").call(textCallback);
56009 var keyhintWrap = selection2.selectAll(".keyhint-wrap").data(keys2 && keys2.length ? [0] : []);
56010 keyhintWrap.exit().remove();
56011 var keyhintWrapEnter = keyhintWrap.enter().append("div").attr("class", "keyhint-wrap");
56012 keyhintWrapEnter.append("span").call(_t.append("tooltip_keyhint"));
56013 keyhintWrap = keyhintWrapEnter.merge(keyhintWrap);
56014 keyhintWrap.selectAll("kbd.shortcut").data(keys2 && keys2.length ? keys2 : []).enter().append("kbd").attr("class", "shortcut").text(function(d2) {
56022 // modules/ui/edit_menu.js
56023 function uiEditMenu(context) {
56024 var dispatch14 = dispatch_default("toggled");
56025 var _menu = select_default2(null);
56026 var _operations = [];
56027 var _anchorLoc = [0, 0];
56028 var _anchorLocLonLat = [0, 0];
56029 var _triggerType = "";
56030 var _vpTopMargin = 85;
56031 var _vpBottomMargin = 45;
56032 var _vpSideMargin = 35;
56033 var _menuTop = false;
56036 var _verticalPadding = 4;
56037 var _tooltipWidth = 210;
56038 var _menuSideMargin = 10;
56039 var _tooltips = [];
56040 var editMenu = function(selection2) {
56041 var isTouchMenu = _triggerType.includes("touch") || _triggerType.includes("pen");
56042 var ops = _operations.filter(function(op) {
56043 return !isTouchMenu || !op.mouseOnly;
56048 _menuTop = isTouchMenu;
56049 var showLabels = isTouchMenu;
56050 var buttonHeight = showLabels ? 32 : 34;
56052 _menuWidth = 52 + Math.min(120, 6 * Math.max.apply(Math, ops.map(function(op) {
56053 return op.title.length;
56058 _menuHeight = _verticalPadding * 2 + ops.length * buttonHeight;
56059 _menu = selection2.append("div").attr("class", "edit-menu").classed("touch-menu", isTouchMenu).style("padding", _verticalPadding + "px 0");
56060 var buttons = _menu.selectAll(".edit-menu-item").data(ops);
56061 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
56062 return "edit-menu-item edit-menu-item-" + d2.id;
56063 }).style("height", buttonHeight + "px").on("click", click).on("pointerup", pointerup).on("pointerdown mousedown", function pointerdown(d3_event) {
56064 d3_event.stopPropagation();
56065 }).on("mouseenter.highlight", function(d3_event, d2) {
56066 if (!d2.relatedEntityIds || select_default2(this).classed("disabled"))
56068 utilHighlightEntities(d2.relatedEntityIds(), true, context);
56069 }).on("mouseleave.highlight", function(d3_event, d2) {
56070 if (!d2.relatedEntityIds)
56072 utilHighlightEntities(d2.relatedEntityIds(), false, context);
56074 buttonsEnter.each(function(d2) {
56075 var tooltip = uiTooltip().heading(() => d2.title).title(d2.tooltip).keys([d2.keys[0]]);
56076 _tooltips.push(tooltip);
56077 select_default2(this).call(tooltip).append("div").attr("class", "icon-wrap").call(svgIcon(d2.icon && d2.icon() || "#iD-operation-" + d2.id, "operation"));
56080 buttonsEnter.append("span").attr("class", "label").each(function(d2) {
56081 select_default2(this).call(d2.title);
56084 buttonsEnter.merge(buttons).classed("disabled", function(d2) {
56085 return d2.disabled();
56088 var initialScale = context.projection.scale();
56089 context.map().on("move.edit-menu", function() {
56090 if (initialScale !== context.projection.scale()) {
56093 }).on("drawn.edit-menu", function(info) {
56097 var lastPointerUpType;
56098 function pointerup(d3_event) {
56099 lastPointerUpType = d3_event.pointerType;
56101 function click(d3_event, operation) {
56102 d3_event.stopPropagation();
56103 if (operation.relatedEntityIds) {
56104 utilHighlightEntities(operation.relatedEntityIds(), false, context);
56106 if (operation.disabled()) {
56107 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
56108 context.ui().flash.duration(4e3).iconName("#iD-operation-" + operation.id).iconClass("operation disabled").label(operation.tooltip())();
56111 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
56112 context.ui().flash.duration(2e3).iconName("#iD-operation-" + operation.id).iconClass("operation").label(operation.annotation() || operation.title)();
56117 lastPointerUpType = null;
56119 dispatch14.call("toggled", this, true);
56121 function updatePosition() {
56122 if (!_menu || _menu.empty())
56124 var anchorLoc = context.projection(_anchorLocLonLat);
56125 var viewport = context.surfaceRect();
56126 if (anchorLoc[0] < 0 || anchorLoc[0] > viewport.width || anchorLoc[1] < 0 || anchorLoc[1] > viewport.height) {
56130 var menuLeft = displayOnLeft(viewport);
56131 var offset = [0, 0];
56132 offset[0] = menuLeft ? -1 * (_menuSideMargin + _menuWidth) : _menuSideMargin;
56134 if (anchorLoc[1] - _menuHeight < _vpTopMargin) {
56135 offset[1] = -anchorLoc[1] + _vpTopMargin;
56137 offset[1] = -_menuHeight;
56140 if (anchorLoc[1] + _menuHeight > viewport.height - _vpBottomMargin) {
56141 offset[1] = -anchorLoc[1] - _menuHeight + viewport.height - _vpBottomMargin;
56146 var origin = geoVecAdd(anchorLoc, offset);
56147 _menu.style("left", origin[0] + "px").style("top", origin[1] + "px");
56148 var tooltipSide = tooltipPosition(viewport, menuLeft);
56149 _tooltips.forEach(function(tooltip) {
56150 tooltip.placement(tooltipSide);
56152 function displayOnLeft(viewport2) {
56153 if (_mainLocalizer.textDirection() === "ltr") {
56154 if (anchorLoc[0] + _menuSideMargin + _menuWidth > viewport2.width - _vpSideMargin) {
56159 if (anchorLoc[0] - _menuSideMargin - _menuWidth < _vpSideMargin) {
56165 function tooltipPosition(viewport2, menuLeft2) {
56166 if (_mainLocalizer.textDirection() === "ltr") {
56170 if (anchorLoc[0] + _menuSideMargin + _menuWidth + _tooltipWidth > viewport2.width - _vpSideMargin) {
56178 if (anchorLoc[0] - _menuSideMargin - _menuWidth - _tooltipWidth < _vpSideMargin) {
56185 editMenu.close = function() {
56186 context.map().on("move.edit-menu", null).on("drawn.edit-menu", null);
56189 dispatch14.call("toggled", this, false);
56191 editMenu.anchorLoc = function(val) {
56192 if (!arguments.length)
56195 _anchorLocLonLat = context.projection.invert(_anchorLoc);
56198 editMenu.triggerType = function(val) {
56199 if (!arguments.length)
56200 return _triggerType;
56201 _triggerType = val;
56204 editMenu.operations = function(val) {
56205 if (!arguments.length)
56206 return _operations;
56210 return utilRebind(editMenu, dispatch14, "on");
56213 // modules/ui/feature_info.js
56214 function uiFeatureInfo(context) {
56215 function update(selection2) {
56216 var features = context.features();
56217 var stats = features.stats();
56219 var hiddenList = features.hidden().map(function(k2) {
56221 count += stats[k2];
56222 return _t.append("inspector.title_count", {
56223 title: _t("feature." + k2 + ".description"),
56228 }).filter(Boolean);
56229 selection2.text("");
56230 if (hiddenList.length) {
56231 var tooltipBehavior = uiTooltip().placement("top").title(function() {
56232 return (selection3) => {
56233 hiddenList.forEach((hiddenFeature) => {
56234 selection3.append("div").call(hiddenFeature);
56238 selection2.append("a").attr("class", "chip").attr("href", "#").call(_t.append("feature_info.hidden_warning", { count })).call(tooltipBehavior).on("click", function(d3_event) {
56239 tooltipBehavior.hide();
56240 d3_event.preventDefault();
56241 context.ui().togglePanes(context.container().select(".map-panes .map-data-pane"));
56244 selection2.classed("hide", !hiddenList.length);
56246 return function(selection2) {
56247 update(selection2);
56248 context.features().on("change.feature_info", function() {
56249 update(selection2);
56254 // modules/ui/flash.js
56255 function uiFlash(context) {
56257 var _duration = 2e3;
56258 var _iconName = "#iD-icon-no";
56259 var _iconClass = "disabled";
56260 var _label = (s2) => s2.text("");
56263 _flashTimer.stop();
56265 context.container().select(".main-footer-wrap").classed("footer-hide", true).classed("footer-show", false);
56266 context.container().select(".flash-wrap").classed("footer-hide", false).classed("footer-show", true);
56267 var content = context.container().select(".flash-wrap").selectAll(".flash-content").data([0]);
56268 var contentEnter = content.enter().append("div").attr("class", "flash-content");
56269 var iconEnter = contentEnter.append("svg").attr("class", "flash-icon icon").append("g").attr("transform", "translate(10,10)");
56270 iconEnter.append("circle").attr("r", 9);
56271 iconEnter.append("use").attr("transform", "translate(-7,-7)").attr("width", "14").attr("height", "14");
56272 contentEnter.append("div").attr("class", "flash-text");
56273 content = content.merge(contentEnter);
56274 content.selectAll(".flash-icon").attr("class", "icon flash-icon " + (_iconClass || ""));
56275 content.selectAll(".flash-icon use").attr("xlink:href", _iconName);
56276 content.selectAll(".flash-text").attr("class", "flash-text").call(_label);
56277 _flashTimer = timeout_default(function() {
56278 _flashTimer = null;
56279 context.container().select(".main-footer-wrap").classed("footer-hide", false).classed("footer-show", true);
56280 context.container().select(".flash-wrap").classed("footer-hide", true).classed("footer-show", false);
56284 flash.duration = function(_2) {
56285 if (!arguments.length)
56290 flash.label = function(_2) {
56291 if (!arguments.length)
56293 if (typeof _2 !== "function") {
56294 _label = (selection2) => selection2.text(_2);
56296 _label = (selection2) => selection2.text("").call(_2);
56300 flash.iconName = function(_2) {
56301 if (!arguments.length)
56306 flash.iconClass = function(_2) {
56307 if (!arguments.length)
56315 // modules/ui/full_screen.js
56316 function uiFullScreen(context) {
56317 var element = context.container().node();
56318 function getFullScreenFn() {
56319 if (element.requestFullscreen) {
56320 return element.requestFullscreen;
56321 } else if (element.msRequestFullscreen) {
56322 return element.msRequestFullscreen;
56323 } else if (element.mozRequestFullScreen) {
56324 return element.mozRequestFullScreen;
56325 } else if (element.webkitRequestFullscreen) {
56326 return element.webkitRequestFullscreen;
56329 function getExitFullScreenFn() {
56330 if (document.exitFullscreen) {
56331 return document.exitFullscreen;
56332 } else if (document.msExitFullscreen) {
56333 return document.msExitFullscreen;
56334 } else if (document.mozCancelFullScreen) {
56335 return document.mozCancelFullScreen;
56336 } else if (document.webkitExitFullscreen) {
56337 return document.webkitExitFullscreen;
56340 function isFullScreen() {
56341 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
56343 function isSupported() {
56344 return !!getFullScreenFn();
56346 function fullScreen(d3_event) {
56347 d3_event.preventDefault();
56348 if (!isFullScreen()) {
56349 getFullScreenFn().apply(element);
56351 getExitFullScreenFn().apply(document);
56354 return function() {
56355 if (!isSupported())
56357 var detected = utilDetect();
56358 var keys2 = detected.os === "mac" ? [uiCmd("\u2303\u2318F"), "f11"] : ["f11"];
56359 context.keybinding().on(keys2, fullScreen);
56363 // modules/ui/geolocate.js
56364 function uiGeolocate(context) {
56365 var _geolocationOptions = {
56366 // prioritize speed and power usage over precision
56367 enableHighAccuracy: false,
56368 // don't hang indefinitely getting the location
56372 var _locating = uiLoading(context).message(_t.html("geolocate.locating")).blocking(true);
56373 var _layer = context.layers().layer("geolocate");
56377 var _button = select_default2(null);
56379 if (context.inIntro())
56381 if (!_layer.enabled() && !_locating.isShown()) {
56382 _timeoutID = setTimeout(
56387 context.container().call(_locating);
56388 navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
56391 _layer.enabled(null, false);
56392 updateButtonState();
56395 function zoomTo() {
56396 context.enter(modeBrowse(context));
56397 var map2 = context.map();
56398 _layer.enabled(_position, true);
56399 updateButtonState();
56400 map2.centerZoomEase(_extent.center(), Math.min(20, map2.extentZoom(_extent)));
56402 function success(geolocation) {
56403 _position = geolocation;
56404 var coords = _position.coords;
56405 _extent = geoExtent([coords.longitude, coords.latitude]).padByMeters(coords.accuracy);
56413 context.ui().flash.label(_t.append("geolocate.location_unavailable")).iconName("#iD-icon-geolocate")();
56417 function finish() {
56420 clearTimeout(_timeoutID);
56422 _timeoutID = void 0;
56424 function updateButtonState() {
56425 _button.classed("active", _layer.enabled());
56426 _button.attr("aria-pressed", _layer.enabled());
56428 return function(selection2) {
56429 if (!navigator.geolocation || !navigator.geolocation.getCurrentPosition)
56431 _button = selection2.append("button").on("click", click).attr("aria-pressed", false).call(svgIcon("#iD-icon-geolocate", "light")).call(
56432 uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _t.append("geolocate.title")).keys([_t("geolocate.key")])
56434 context.keybinding().on(_t("geolocate.key"), click);
56438 // modules/ui/panels/background.js
56439 function uiPanelBackground(context) {
56440 var background = context.background();
56441 var _currSourceName = null;
56442 var _metadata = {};
56443 var _metadataKeys = [
56451 var debouncedRedraw = debounce_default(redraw, 250);
56452 function redraw(selection2) {
56453 var source = background.baseLayerSource();
56456 var isDG = source.id.match(/^DigitalGlobe/i) !== null;
56457 var sourceLabel = source.label();
56458 if (_currSourceName !== sourceLabel) {
56459 _currSourceName = sourceLabel;
56462 selection2.text("");
56463 var list = selection2.append("ul").attr("class", "background-info");
56464 list.append("li").call(_currSourceName);
56465 _metadataKeys.forEach(function(k2) {
56466 if (isDG && k2 === "vintage")
56468 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]);
56470 debouncedGetMetadata(selection2);
56471 var toggleTiles = context.getDebug("tile") ? "hide_tiles" : "show_tiles";
56472 selection2.append("a").call(_t.append("info_panels.background." + toggleTiles)).attr("href", "#").attr("class", "button button-toggle-tiles").on("click", function(d3_event) {
56473 d3_event.preventDefault();
56474 context.setDebug("tile", !context.getDebug("tile"));
56475 selection2.call(redraw);
56478 var key = source.id + "-vintage";
56479 var sourceVintage = context.background().findSource(key);
56480 var showsVintage = context.background().showsLayer(sourceVintage);
56481 var toggleVintage = showsVintage ? "hide_vintage" : "show_vintage";
56482 selection2.append("a").call(_t.append("info_panels.background." + toggleVintage)).attr("href", "#").attr("class", "button button-toggle-vintage").on("click", function(d3_event) {
56483 d3_event.preventDefault();
56484 context.background().toggleOverlayLayer(sourceVintage);
56485 selection2.call(redraw);
56488 ["DigitalGlobe-Premium", "DigitalGlobe-Standard"].forEach(function(layerId) {
56489 if (source.id !== layerId) {
56490 var key2 = layerId + "-vintage";
56491 var sourceVintage2 = context.background().findSource(key2);
56492 if (context.background().showsLayer(sourceVintage2)) {
56493 context.background().toggleOverlayLayer(sourceVintage2);
56498 var debouncedGetMetadata = debounce_default(getMetadata, 250);
56499 function getMetadata(selection2) {
56500 var tile = context.container().select(".layer-background img.tile-center");
56503 var sourceName = _currSourceName;
56504 var d2 = tile.datum();
56505 var zoom = d2 && d2.length >= 3 && d2[2] || Math.floor(context.map().zoom());
56506 var center = context.map().center();
56507 _metadata.zoom = String(zoom);
56508 selection2.selectAll(".background-info-list-zoom").classed("hide", false).selectAll(".background-info-span-zoom").text(_metadata.zoom);
56509 if (!d2 || !d2.length >= 3)
56511 background.baseLayerSource().getMetadata(center, d2, function(err, result) {
56512 if (err || _currSourceName !== sourceName)
56514 var vintage = result.vintage;
56515 _metadata.vintage = vintage && vintage.range || _t("info_panels.background.unknown");
56516 selection2.selectAll(".background-info-list-vintage").classed("hide", false).selectAll(".background-info-span-vintage").text(_metadata.vintage);
56517 _metadataKeys.forEach(function(k2) {
56518 if (k2 === "zoom" || k2 === "vintage")
56520 var val = result[k2];
56521 _metadata[k2] = val;
56522 selection2.selectAll(".background-info-list-" + k2).classed("hide", !val).selectAll(".background-info-span-" + k2).text(val);
56526 var panel = function(selection2) {
56527 selection2.call(redraw);
56528 context.map().on("drawn.info-background", function() {
56529 selection2.call(debouncedRedraw);
56530 }).on("move.info-background", function() {
56531 selection2.call(debouncedGetMetadata);
56534 panel.off = function() {
56535 context.map().on("drawn.info-background", null).on("move.info-background", null);
56537 panel.id = "background";
56538 panel.label = _t.append("info_panels.background.title");
56539 panel.key = _t("info_panels.background.key");
56543 // modules/ui/panels/history.js
56544 function uiPanelHistory(context) {
56546 function displayTimestamp(timestamp) {
56548 return _t("info_panels.history.unknown");
56557 var d2 = new Date(timestamp);
56558 if (isNaN(d2.getTime()))
56559 return _t("info_panels.history.unknown");
56560 return d2.toLocaleString(_mainLocalizer.localeCode(), options2);
56562 function displayUser(selection2, userName) {
56564 selection2.append("span").call(_t.append("info_panels.history.unknown"));
56567 selection2.append("span").attr("class", "user-name").text(userName);
56568 var links = selection2.append("div").attr("class", "links");
56570 links.append("a").attr("class", "user-osm-link").attr("href", osm.userURL(userName)).attr("target", "_blank").call(_t.append("info_panels.history.profile_link"));
56572 links.append("a").attr("class", "user-hdyc-link").attr("href", "https://hdyc.neis-one.org/?" + userName).attr("target", "_blank").attr("tabindex", -1).text("HDYC");
56574 function displayChangeset(selection2, changeset) {
56576 selection2.append("span").call(_t.append("info_panels.history.unknown"));
56579 selection2.append("span").attr("class", "changeset-id").text(changeset);
56580 var links = selection2.append("div").attr("class", "links");
56582 links.append("a").attr("class", "changeset-osm-link").attr("href", osm.changesetURL(changeset)).attr("target", "_blank").call(_t.append("info_panels.history.changeset_link"));
56584 links.append("a").attr("class", "changeset-osmcha-link").attr("href", "https://osmcha.org/changesets/" + changeset).attr("target", "_blank").text("OSMCha");
56585 links.append("a").attr("class", "changeset-achavi-link").attr("href", "https://overpass-api.de/achavi/?changeset=" + changeset).attr("target", "_blank").text("Achavi");
56587 function redraw(selection2) {
56588 var selectedNoteID = context.selectedNoteID();
56589 osm = context.connection();
56590 var selected, note, entity;
56591 if (selectedNoteID && osm) {
56592 selected = [_t.html("note.note") + " " + selectedNoteID];
56593 note = osm.getNote(selectedNoteID);
56595 selected = context.selectedIDs().filter(function(e3) {
56596 return context.hasEntity(e3);
56598 if (selected.length) {
56599 entity = context.entity(selected[0]);
56602 var singular = selected.length === 1 ? selected[0] : null;
56603 selection2.html("");
56605 selection2.append("h4").attr("class", "history-heading").html(singular);
56607 selection2.append("h4").attr("class", "history-heading").call(_t.append("info_panels.selected", { n: selected.length }));
56612 selection2.call(redrawEntity, entity);
56614 selection2.call(redrawNote, note);
56617 function redrawNote(selection2, note) {
56618 if (!note || note.isNew()) {
56619 selection2.append("div").call(_t.append("info_panels.history.note_no_history"));
56622 var list = selection2.append("ul");
56623 list.append("li").call(_t.append("info_panels.history.note_comments", { suffix: ":" })).append("span").text(note.comments.length);
56624 if (note.comments.length) {
56625 list.append("li").call(_t.append("info_panels.history.note_created_date", { suffix: ":" })).append("span").text(displayTimestamp(note.comments[0].date));
56626 list.append("li").call(_t.append("info_panels.history.note_created_user", { suffix: ":" })).call(displayUser, note.comments[0].user);
56629 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"));
56632 function redrawEntity(selection2, entity) {
56633 if (!entity || entity.isNew()) {
56634 selection2.append("div").call(_t.append("info_panels.history.no_history"));
56637 var links = selection2.append("div").attr("class", "links");
56639 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"));
56641 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");
56642 var list = selection2.append("ul");
56643 list.append("li").call(_t.append("info_panels.history.version", { suffix: ":" })).append("span").text(entity.version);
56644 list.append("li").call(_t.append("info_panels.history.last_edit", { suffix: ":" })).append("span").text(displayTimestamp(entity.timestamp));
56645 list.append("li").call(_t.append("info_panels.history.edited_by", { suffix: ":" })).call(displayUser, entity.user);
56646 list.append("li").call(_t.append("info_panels.history.changeset", { suffix: ":" })).call(displayChangeset, entity.changeset);
56648 var panel = function(selection2) {
56649 selection2.call(redraw);
56650 context.map().on("drawn.info-history", function() {
56651 selection2.call(redraw);
56653 context.on("enter.info-history", function() {
56654 selection2.call(redraw);
56657 panel.off = function() {
56658 context.map().on("drawn.info-history", null);
56659 context.on("enter.info-history", null);
56661 panel.id = "history";
56662 panel.label = _t.append("info_panels.history.title");
56663 panel.key = _t("info_panels.history.key");
56667 // modules/util/units.js
56668 var OSM_PRECISION = 7;
56669 function displayLength(m2, isImperial) {
56670 var d2 = m2 * (isImperial ? 3.28084 : 1);
56682 unit2 = "kilometers";
56687 return _t("units." + unit2, {
56688 quantity: d2.toLocaleString(_mainLocalizer.localeCode(), {
56689 maximumSignificantDigits: 4
56693 function displayArea(m2, isImperial) {
56694 var locale2 = _mainLocalizer.localeCode();
56695 var d2 = m2 * (isImperial ? 10.7639111056 : 1);
56700 if (d2 >= 6969600) {
56701 d1 = d2 / 27878400;
56702 unit1 = "square_miles";
56705 unit1 = "square_feet";
56707 if (d2 > 4356 && d2 < 4356e4) {
56714 unit1 = "square_kilometers";
56717 unit1 = "square_meters";
56719 if (d2 > 1e3 && d2 < 1e7) {
56721 unit2 = "hectares";
56724 area = _t("units." + unit1, {
56725 quantity: d1.toLocaleString(locale2, {
56726 maximumSignificantDigits: 4
56730 return _t("units.area_pair", {
56732 area2: _t("units." + unit2, {
56733 quantity: d22.toLocaleString(locale2, {
56734 maximumSignificantDigits: 2
56742 function wrap(x2, min3, max3) {
56743 var d2 = max3 - min3;
56744 return ((x2 - min3) % d2 + d2) % d2 + min3;
56746 function clamp2(x2, min3, max3) {
56747 return Math.max(min3, Math.min(x2, max3));
56749 function displayCoordinate(deg, pos, neg) {
56750 var locale2 = _mainLocalizer.localeCode();
56751 var min3 = (Math.abs(deg) - Math.floor(Math.abs(deg))) * 60;
56752 var sec = (min3 - Math.floor(min3)) * 60;
56753 var displayDegrees = _t("units.arcdegrees", {
56754 quantity: Math.floor(Math.abs(deg)).toLocaleString(locale2)
56756 var displayCoordinate2;
56757 if (Math.floor(sec) > 0) {
56758 displayCoordinate2 = displayDegrees + _t("units.arcminutes", {
56759 quantity: Math.floor(min3).toLocaleString(locale2)
56760 }) + _t("units.arcseconds", {
56761 quantity: Math.round(sec).toLocaleString(locale2)
56763 } else if (Math.floor(min3) > 0) {
56764 displayCoordinate2 = displayDegrees + _t("units.arcminutes", {
56765 quantity: Math.round(min3).toLocaleString(locale2)
56768 displayCoordinate2 = _t("units.arcdegrees", {
56769 quantity: Math.round(Math.abs(deg)).toLocaleString(locale2)
56773 return displayCoordinate2;
56775 return _t("units.coordinate", {
56776 coordinate: displayCoordinate2,
56777 direction: _t("units." + (deg > 0 ? pos : neg))
56781 function dmsCoordinatePair(coord2) {
56782 return _t("units.coordinate_pair", {
56783 latitude: displayCoordinate(clamp2(coord2[1], -90, 90), "north", "south"),
56784 longitude: displayCoordinate(wrap(coord2[0], -180, 180), "east", "west")
56787 function decimalCoordinatePair(coord2) {
56788 return _t("units.coordinate_pair", {
56789 latitude: clamp2(coord2[1], -90, 90).toFixed(OSM_PRECISION),
56790 longitude: wrap(coord2[0], -180, 180).toFixed(OSM_PRECISION)
56794 // modules/ui/panels/location.js
56795 function uiPanelLocation(context) {
56796 var currLocation = "";
56797 function redraw(selection2) {
56798 selection2.html("");
56799 var list = selection2.append("ul");
56800 var coord2 = context.map().mouseCoordinates();
56801 if (coord2.some(isNaN)) {
56802 coord2 = context.map().center();
56804 list.append("li").text(dmsCoordinatePair(coord2)).append("li").text(decimalCoordinatePair(coord2));
56805 selection2.append("div").attr("class", "location-info").text(currLocation || " ");
56806 debouncedGetLocation(selection2, coord2);
56808 var debouncedGetLocation = debounce_default(getLocation, 250);
56809 function getLocation(selection2, coord2) {
56810 if (!services.geocoder) {
56811 currLocation = _t("info_panels.location.unknown_location");
56812 selection2.selectAll(".location-info").text(currLocation);
56814 services.geocoder.reverse(coord2, function(err, result) {
56815 currLocation = result ? result.display_name : _t("info_panels.location.unknown_location");
56816 selection2.selectAll(".location-info").text(currLocation);
56820 var panel = function(selection2) {
56821 selection2.call(redraw);
56822 context.surface().on(("PointerEvent" in window ? "pointer" : "mouse") + "move.info-location", function() {
56823 selection2.call(redraw);
56826 panel.off = function() {
56827 context.surface().on(".info-location", null);
56829 panel.id = "location";
56830 panel.label = _t.append("info_panels.location.title");
56831 panel.key = _t("info_panels.location.key");
56835 // modules/ui/panels/measurement.js
56836 function uiPanelMeasurement(context) {
56837 function radiansToMeters(r2) {
56838 return r2 * 63710071809e-4;
56840 function steradiansToSqmeters(r2) {
56841 return r2 / (4 * Math.PI) * 510065621724e3;
56843 function toLineString(feature3) {
56844 if (feature3.type === "LineString")
56846 var result = { type: "LineString", coordinates: [] };
56847 if (feature3.type === "Polygon") {
56848 result.coordinates = feature3.coordinates[0];
56849 } else if (feature3.type === "MultiPolygon") {
56850 result.coordinates = feature3.coordinates[0][0];
56854 var _isImperial = !_mainLocalizer.usesMetric();
56855 function redraw(selection2) {
56856 var graph = context.graph();
56857 var selectedNoteID = context.selectedNoteID();
56858 var osm = services.osm;
56859 var localeCode = _mainLocalizer.localeCode();
56861 var center, location, centroid;
56862 var closed, geometry;
56863 var totalNodeCount, length = 0, area = 0, distance;
56864 if (selectedNoteID && osm) {
56865 var note = osm.getNote(selectedNoteID);
56866 heading = _t.html("note.note") + " " + selectedNoteID;
56867 location = note.loc;
56870 var selectedIDs = context.selectedIDs().filter(function(id2) {
56871 return context.hasEntity(id2);
56873 var selected = selectedIDs.map(function(id2) {
56874 return context.entity(id2);
56876 heading = selected.length === 1 ? selected[0].id : _t.html("info_panels.selected", { n: selected.length });
56877 if (selected.length) {
56878 var extent = geoExtent();
56879 for (var i3 in selected) {
56880 var entity = selected[i3];
56881 extent._extend(entity.extent(graph));
56882 geometry = entity.geometry(graph);
56883 if (geometry === "line" || geometry === "area") {
56884 closed = entity.type === "relation" || entity.isClosed() && !entity.isDegenerate();
56885 var feature3 = entity.asGeoJSON(graph);
56886 length += radiansToMeters(length_default(toLineString(feature3)));
56887 centroid = path_default(context.projection).centroid(entity.asGeoJSON(graph));
56888 centroid = centroid && context.projection.invert(centroid);
56889 if (!centroid || !isFinite(centroid[0]) || !isFinite(centroid[1])) {
56890 centroid = entity.extent(graph).center();
56893 area += steradiansToSqmeters(entity.area(graph));
56897 if (selected.length > 1) {
56902 if (selected.length === 2 && selected[0].type === "node" && selected[1].type === "node") {
56903 distance = geoSphericalDistance(selected[0].loc, selected[1].loc);
56905 if (selected.length === 1 && selected[0].type === "node") {
56906 location = selected[0].loc;
56908 totalNodeCount = utilGetAllNodes(selectedIDs, context.graph()).length;
56910 if (!location && !centroid) {
56911 center = extent.center();
56915 selection2.html("");
56917 selection2.append("h4").attr("class", "measurement-heading").html(heading);
56919 var list = selection2.append("ul");
56922 list.append("li").call(_t.append("info_panels.measurement.geometry", { suffix: ":" })).append("span").html(
56923 closed ? _t.html("info_panels.measurement.closed_" + geometry) : _t.html("geometry." + geometry)
56926 if (totalNodeCount) {
56927 list.append("li").call(_t.append("info_panels.measurement.node_count", { suffix: ":" })).append("span").text(totalNodeCount.toLocaleString(localeCode));
56930 list.append("li").call(_t.append("info_panels.measurement.area", { suffix: ":" })).append("span").text(displayArea(area, _isImperial));
56933 list.append("li").call(_t.append("info_panels.measurement." + (closed ? "perimeter" : "length"), { suffix: ":" })).append("span").text(displayLength(length, _isImperial));
56935 if (typeof distance === "number") {
56936 list.append("li").call(_t.append("info_panels.measurement.distance", { suffix: ":" })).append("span").text(displayLength(distance, _isImperial));
56939 coordItem = list.append("li").call(_t.append("info_panels.measurement.location", { suffix: ":" }));
56940 coordItem.append("span").text(dmsCoordinatePair(location));
56941 coordItem.append("span").text(decimalCoordinatePair(location));
56944 coordItem = list.append("li").call(_t.append("info_panels.measurement.centroid", { suffix: ":" }));
56945 coordItem.append("span").text(dmsCoordinatePair(centroid));
56946 coordItem.append("span").text(decimalCoordinatePair(centroid));
56949 coordItem = list.append("li").call(_t.append("info_panels.measurement.center", { suffix: ":" }));
56950 coordItem.append("span").text(dmsCoordinatePair(center));
56951 coordItem.append("span").text(decimalCoordinatePair(center));
56953 if (length || area || typeof distance === "number") {
56954 var toggle = _isImperial ? "imperial" : "metric";
56955 selection2.append("a").call(_t.append("info_panels.measurement." + toggle)).attr("href", "#").attr("class", "button button-toggle-units").on("click", function(d3_event) {
56956 d3_event.preventDefault();
56957 _isImperial = !_isImperial;
56958 selection2.call(redraw);
56962 var panel = function(selection2) {
56963 selection2.call(redraw);
56964 context.map().on("drawn.info-measurement", function() {
56965 selection2.call(redraw);
56967 context.on("enter.info-measurement", function() {
56968 selection2.call(redraw);
56971 panel.off = function() {
56972 context.map().on("drawn.info-measurement", null);
56973 context.on("enter.info-measurement", null);
56975 panel.id = "measurement";
56976 panel.label = _t.append("info_panels.measurement.title");
56977 panel.key = _t("info_panels.measurement.key");
56981 // modules/ui/panels/index.js
56982 var uiInfoPanels = {
56983 background: uiPanelBackground,
56984 history: uiPanelHistory,
56985 location: uiPanelLocation,
56986 measurement: uiPanelMeasurement
56989 // modules/ui/info.js
56990 function uiInfo(context) {
56991 var ids = Object.keys(uiInfoPanels);
56992 var wasActive = ["measurement"];
56995 ids.forEach(function(k2) {
56997 panels[k2] = uiInfoPanels[k2](context);
56998 active[k2] = false;
57001 function info(selection2) {
57002 function redraw() {
57003 var activeids = ids.filter(function(k2) {
57006 var containers = infoPanels.selectAll(".panel-container").data(activeids, function(k2) {
57009 containers.exit().style("opacity", 1).transition().duration(200).style("opacity", 0).on("end", function(d2) {
57010 select_default2(this).call(panels[d2].off).remove();
57012 var enter = containers.enter().append("div").attr("class", function(d2) {
57013 return "fillD2 panel-container panel-container-" + d2;
57015 enter.style("opacity", 0).transition().duration(200).style("opacity", 1);
57016 var title = enter.append("div").attr("class", "panel-title fillD2");
57017 title.append("h3").each(function(d2) {
57018 return panels[d2].label(select_default2(this));
57020 title.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function(d3_event, d2) {
57021 d3_event.stopImmediatePropagation();
57022 d3_event.preventDefault();
57024 }).call(svgIcon("#iD-icon-close"));
57025 enter.append("div").attr("class", function(d2) {
57026 return "panel-content panel-content-" + d2;
57028 infoPanels.selectAll(".panel-content").each(function(d2) {
57029 select_default2(this).call(panels[d2]);
57032 info.toggle = function(which) {
57033 var activeids = ids.filter(function(k2) {
57037 active[which] = !active[which];
57038 if (activeids.length === 1 && activeids[0] === which) {
57039 wasActive = [which];
57041 context.container().select("." + which + "-panel-toggle-item").classed("active", active[which]).select("input").property("checked", active[which]);
57043 if (activeids.length) {
57044 wasActive = activeids;
57045 activeids.forEach(function(k2) {
57046 active[k2] = false;
57049 wasActive.forEach(function(k2) {
57056 var infoPanels = selection2.selectAll(".info-panels").data([0]);
57057 infoPanels = infoPanels.enter().append("div").attr("class", "info-panels").merge(infoPanels);
57059 context.keybinding().on(uiCmd("\u2318" + _t("info_panels.key")), function(d3_event) {
57060 d3_event.stopImmediatePropagation();
57061 d3_event.preventDefault();
57064 ids.forEach(function(k2) {
57065 var key = _t("info_panels." + k2 + ".key", { default: null });
57068 context.keybinding().on(uiCmd("\u2318\u21E7" + key), function(d3_event) {
57069 d3_event.stopImmediatePropagation();
57070 d3_event.preventDefault();
57078 // modules/ui/intro/helper.js
57079 function pointBox(loc, context) {
57080 var rect = context.surfaceRect();
57081 var point2 = context.curtainProjection(loc);
57083 left: point2[0] + rect.left - 40,
57084 top: point2[1] + rect.top - 60,
57089 function pad(locOrBox, padding, context) {
57091 if (locOrBox instanceof Array) {
57092 var rect = context.surfaceRect();
57093 var point2 = context.curtainProjection(locOrBox);
57095 left: point2[0] + rect.left,
57096 top: point2[1] + rect.top
57102 left: box.left - padding,
57103 top: box.top - padding,
57104 width: (box.width || 0) + 2 * padding,
57105 height: (box.width || 0) + 2 * padding
57108 function icon(name, svgklass, useklass) {
57109 return '<svg class="icon ' + (svgklass || "") + '"><use xlink:href="' + name + '"' + (useklass ? ' class="' + useklass + '"' : "") + "></use></svg>";
57111 var helpStringReplacements;
57112 function helpHtml(id2, replacements) {
57113 if (!helpStringReplacements) {
57114 helpStringReplacements = {
57115 // insert icons corresponding to various UI elements
57116 point_icon: icon("#iD-icon-point", "inline"),
57117 line_icon: icon("#iD-icon-line", "inline"),
57118 area_icon: icon("#iD-icon-area", "inline"),
57119 note_icon: icon("#iD-icon-note", "inline add-note"),
57120 plus: icon("#iD-icon-plus", "inline"),
57121 minus: icon("#iD-icon-minus", "inline"),
57122 layers_icon: icon("#iD-icon-layers", "inline"),
57123 data_icon: icon("#iD-icon-data", "inline"),
57124 inspect: icon("#iD-icon-inspect", "inline"),
57125 help_icon: icon("#iD-icon-help", "inline"),
57126 undo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo", "inline"),
57127 redo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-undo" : "#iD-icon-redo", "inline"),
57128 save_icon: icon("#iD-icon-save", "inline"),
57130 circularize_icon: icon("#iD-operation-circularize", "inline operation"),
57131 continue_icon: icon("#iD-operation-continue", "inline operation"),
57132 copy_icon: icon("#iD-operation-copy", "inline operation"),
57133 delete_icon: icon("#iD-operation-delete", "inline operation"),
57134 disconnect_icon: icon("#iD-operation-disconnect", "inline operation"),
57135 downgrade_icon: icon("#iD-operation-downgrade", "inline operation"),
57136 extract_icon: icon("#iD-operation-extract", "inline operation"),
57137 merge_icon: icon("#iD-operation-merge", "inline operation"),
57138 move_icon: icon("#iD-operation-move", "inline operation"),
57139 orthogonalize_icon: icon("#iD-operation-orthogonalize", "inline operation"),
57140 paste_icon: icon("#iD-operation-paste", "inline operation"),
57141 reflect_long_icon: icon("#iD-operation-reflect-long", "inline operation"),
57142 reflect_short_icon: icon("#iD-operation-reflect-short", "inline operation"),
57143 reverse_icon: icon("#iD-operation-reverse", "inline operation"),
57144 rotate_icon: icon("#iD-operation-rotate", "inline operation"),
57145 split_icon: icon("#iD-operation-split", "inline operation"),
57146 straighten_icon: icon("#iD-operation-straighten", "inline operation"),
57147 // interaction icons
57148 leftclick: icon("#iD-walkthrough-mouse-left", "inline operation"),
57149 rightclick: icon("#iD-walkthrough-mouse-right", "inline operation"),
57150 mousewheel_icon: icon("#iD-walkthrough-mousewheel", "inline operation"),
57151 tap_icon: icon("#iD-walkthrough-tap", "inline operation"),
57152 doubletap_icon: icon("#iD-walkthrough-doubletap", "inline operation"),
57153 longpress_icon: icon("#iD-walkthrough-longpress", "inline operation"),
57154 touchdrag_icon: icon("#iD-walkthrough-touchdrag", "inline operation"),
57155 pinch_icon: icon("#iD-walkthrough-pinch-apart", "inline operation"),
57156 // insert keys; may be localized and platform-dependent
57157 shift: uiCmd.display("\u21E7"),
57158 alt: uiCmd.display("\u2325"),
57159 return: uiCmd.display("\u21B5"),
57160 esc: _t.html("shortcuts.key.esc"),
57161 space: _t.html("shortcuts.key.space"),
57162 add_note_key: _t.html("modes.add_note.key"),
57163 help_key: _t.html("help.key"),
57164 shortcuts_key: _t.html("shortcuts.toggle.key"),
57165 // reference localized UI labels directly so that they'll always match
57166 save: _t.html("save.title"),
57167 undo: _t.html("undo.title"),
57168 redo: _t.html("redo.title"),
57169 upload: _t.html("commit.save"),
57170 point: _t.html("modes.add_point.title"),
57171 line: _t.html("modes.add_line.title"),
57172 area: _t.html("modes.add_area.title"),
57173 note: _t.html("modes.add_note.label"),
57174 circularize: _t.html("operations.circularize.title"),
57175 continue: _t.html("operations.continue.title"),
57176 copy: _t.html("operations.copy.title"),
57177 delete: _t.html("operations.delete.title"),
57178 disconnect: _t.html("operations.disconnect.title"),
57179 downgrade: _t.html("operations.downgrade.title"),
57180 extract: _t.html("operations.extract.title"),
57181 merge: _t.html("operations.merge.title"),
57182 move: _t.html("operations.move.title"),
57183 orthogonalize: _t.html("operations.orthogonalize.title"),
57184 paste: _t.html("operations.paste.title"),
57185 reflect_long: _t.html("operations.reflect.title.long"),
57186 reflect_short: _t.html("operations.reflect.title.short"),
57187 reverse: _t.html("operations.reverse.title"),
57188 rotate: _t.html("operations.rotate.title"),
57189 split: _t.html("operations.split.title"),
57190 straighten: _t.html("operations.straighten.title"),
57191 map_data: _t.html("map_data.title"),
57192 osm_notes: _t.html("map_data.layers.notes.title"),
57193 fields: _t.html("inspector.fields"),
57194 tags: _t.html("inspector.tags"),
57195 relations: _t.html("inspector.relations"),
57196 new_relation: _t.html("inspector.new_relation"),
57197 turn_restrictions: _t.html("_tagging.presets.fields.restrictions.label"),
57198 background_settings: _t.html("background.description"),
57199 imagery_offset: _t.html("background.fix_misalignment"),
57200 start_the_walkthrough: _t.html("splash.walkthrough"),
57201 help: _t.html("help.title"),
57202 ok: _t.html("intro.ok")
57204 for (var key in helpStringReplacements) {
57205 helpStringReplacements[key] = { html: helpStringReplacements[key] };
57209 if (replacements) {
57210 reps = Object.assign(replacements, helpStringReplacements);
57212 reps = helpStringReplacements;
57214 return _t.html(id2, reps).replace(/\`(.*?)\`/g, "<kbd>$1</kbd>");
57216 function slugify(text2) {
57217 return text2.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
57219 var missingStrings = {};
57220 function checkKey(key, text2) {
57221 if (_t(key, { default: void 0 }) === void 0) {
57222 if (missingStrings.hasOwnProperty(key))
57224 missingStrings[key] = text2;
57225 var missing = key + ": " + text2;
57226 if (typeof console !== "undefined")
57227 console.log(missing);
57230 function localize(obj) {
57232 var name = obj.tags && obj.tags.name;
57234 key = "intro.graph.name." + slugify(name);
57235 obj.tags.name = _t(key, { default: name });
57236 checkKey(key, name);
57238 var street = obj.tags && obj.tags["addr:street"];
57240 key = "intro.graph.name." + slugify(street);
57241 obj.tags["addr:street"] = _t(key, { default: street });
57242 checkKey(key, street);
57257 addrTags.forEach(function(k2) {
57258 var key2 = "intro.graph." + k2;
57259 var tag = "addr:" + k2;
57260 var val = obj.tags && obj.tags[tag];
57261 var str2 = _t(key2, { default: val });
57263 if (str2.match(/^<.*>$/) !== null) {
57264 delete obj.tags[tag];
57266 obj.tags[tag] = str2;
57273 function isMostlySquare(points) {
57274 var threshold = 15;
57275 var lowerBound = Math.cos((90 - threshold) * Math.PI / 180);
57276 var upperBound = Math.cos(threshold * Math.PI / 180);
57277 for (var i3 = 0; i3 < points.length; i3++) {
57278 var a2 = points[(i3 - 1 + points.length) % points.length];
57279 var origin = points[i3];
57280 var b2 = points[(i3 + 1) % points.length];
57281 var dotp = geoVecNormalizedDot(a2, b2, origin);
57282 var mag = Math.abs(dotp);
57283 if (mag > lowerBound && mag < upperBound) {
57289 function selectMenuItem(context, operation) {
57290 return context.container().select(".edit-menu .edit-menu-item-" + operation);
57292 function transitionTime(point1, point2) {
57293 var distance = geoSphericalDistance(point1, point2);
57294 if (distance === 0) {
57296 } else if (distance < 80) {
57303 // modules/ui/toggle.js
57304 function uiToggle(show, callback) {
57305 return function(selection2) {
57306 selection2.style("opacity", show ? 0 : 1).classed("hide", false).transition().style("opacity", show ? 1 : 0).on("end", function() {
57307 select_default2(this).classed("hide", !show).style("opacity", null);
57309 callback.apply(this);
57314 // modules/ui/curtain.js
57315 function uiCurtain(containerNode) {
57316 var surface = select_default2(null), tooltip = select_default2(null), darkness = select_default2(null);
57317 function curtain(selection2) {
57318 surface = selection2.append("svg").attr("class", "curtain").style("top", 0).style("left", 0);
57319 darkness = surface.append("path").attr("x", 0).attr("y", 0).attr("class", "curtain-darkness");
57320 select_default2(window).on("resize.curtain", resize);
57321 tooltip = selection2.append("div").attr("class", "tooltip");
57322 tooltip.append("div").attr("class", "popover-arrow");
57323 tooltip.append("div").attr("class", "popover-inner");
57325 function resize() {
57326 surface.attr("width", containerNode.clientWidth).attr("height", containerNode.clientHeight);
57327 curtain.cut(darkness.datum());
57330 curtain.reveal = function(box, html2, options2) {
57331 options2 = options2 || {};
57332 if (typeof box === "string") {
57333 box = select_default2(box).node();
57335 if (box && box.getBoundingClientRect) {
57336 box = copyBox(box.getBoundingClientRect());
57337 var containerRect = containerNode.getBoundingClientRect();
57338 box.top -= containerRect.top;
57339 box.left -= containerRect.left;
57341 if (box && options2.padding) {
57342 box.top -= options2.padding;
57343 box.left -= options2.padding;
57344 box.bottom += options2.padding;
57345 box.right += options2.padding;
57346 box.height += options2.padding * 2;
57347 box.width += options2.padding * 2;
57350 if (options2.tooltipBox) {
57351 tooltipBox = options2.tooltipBox;
57352 if (typeof tooltipBox === "string") {
57353 tooltipBox = select_default2(tooltipBox).node();
57355 if (tooltipBox && tooltipBox.getBoundingClientRect) {
57356 tooltipBox = copyBox(tooltipBox.getBoundingClientRect());
57361 if (tooltipBox && html2) {
57362 if (html2.indexOf("**") !== -1) {
57363 if (html2.indexOf("<span") === 0) {
57364 html2 = html2.replace(/^(<span.*?>)(.+?)(\*\*)/, "$1<span>$2</span>$3");
57366 html2 = html2.replace(/^(.+?)(\*\*)/, "<span>$1</span>$2");
57368 html2 = html2.replace(/\*\*(.*?)\*\*/g, '<span class="instruction">$1</span>');
57370 html2 = html2.replace(/\*(.*?)\*/g, "<em>$1</em>");
57371 html2 = html2.replace(/\{br\}/g, "<br/><br/>");
57372 if (options2.buttonText && options2.buttonCallback) {
57373 html2 += '<div class="button-section"><button href="#" class="button action">' + options2.buttonText + "</button></div>";
57375 var classes = "curtain-tooltip popover tooltip arrowed in " + (options2.tooltipClass || "");
57376 tooltip.classed(classes, true).selectAll(".popover-inner").html(html2);
57377 if (options2.buttonText && options2.buttonCallback) {
57378 var button = tooltip.selectAll(".button-section .button.action");
57379 button.on("click", function(d3_event) {
57380 d3_event.preventDefault();
57381 options2.buttonCallback();
57384 var tip = copyBox(tooltip.node().getBoundingClientRect()), w2 = containerNode.clientWidth, h2 = containerNode.clientHeight, tooltipWidth = 200, tooltipArrow = 5, side, pos;
57385 if (options2.tooltipClass === "intro-mouse") {
57388 if (tooltipBox.top + tooltipBox.height > h2) {
57389 tooltipBox.height -= tooltipBox.top + tooltipBox.height - h2;
57391 if (tooltipBox.left + tooltipBox.width > w2) {
57392 tooltipBox.width -= tooltipBox.left + tooltipBox.width - w2;
57394 if (tooltipBox.top + tooltipBox.height < 100) {
57397 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
57398 tooltipBox.top + tooltipBox.height
57400 } else if (tooltipBox.top > h2 - 140) {
57403 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
57404 tooltipBox.top - tip.height
57407 var tipY = tooltipBox.top + tooltipBox.height / 2 - tip.height / 2;
57408 if (_mainLocalizer.textDirection() === "rtl") {
57409 if (tooltipBox.left - tooltipWidth - tooltipArrow < 70) {
57411 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
57414 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
57417 if (tooltipBox.left + tooltipBox.width + tooltipArrow + tooltipWidth > w2 - 70) {
57419 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
57422 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
57426 if (options2.duration !== 0 || !tooltip.classed(side)) {
57427 tooltip.call(uiToggle(true));
57429 tooltip.style("top", pos[1] + "px").style("left", pos[0] + "px").attr("class", classes + " " + side);
57431 if (side === "left" || side === "right") {
57433 shiftY = 60 - pos[1];
57434 } else if (pos[1] + tip.height > h2 - 100) {
57435 shiftY = h2 - pos[1] - tip.height - 100;
57438 tooltip.selectAll(".popover-inner").style("top", shiftY + "px");
57440 tooltip.classed("in", false).call(uiToggle(false));
57442 curtain.cut(box, options2.duration);
57445 curtain.cut = function(datum2, duration) {
57446 darkness.datum(datum2).interrupt();
57448 if (duration === 0) {
57449 selection2 = darkness;
57451 selection2 = darkness.transition().duration(duration || 600).ease(linear2);
57453 selection2.attr("d", function(d2) {
57454 var containerWidth = containerNode.clientWidth;
57455 var containerHeight = containerNode.clientHeight;
57456 var string = "M 0,0 L 0," + containerHeight + " L " + containerWidth + "," + containerHeight + "L" + containerWidth + ",0 Z";
57459 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";
57462 curtain.remove = function() {
57465 select_default2(window).on("resize.curtain", null);
57467 function copyBox(src) {
57471 bottom: src.bottom,
57480 // modules/ui/intro/welcome.js
57481 function uiIntroWelcome(context, reveal) {
57482 var dispatch14 = dispatch_default("done");
57484 title: "intro.welcome.title"
57486 function welcome() {
57487 context.map().centerZoom([-85.63591, 41.94285], 19);
57489 ".intro-nav-wrap .chapter-welcome",
57490 helpHtml("intro.welcome.welcome"),
57491 { buttonText: _t.html("intro.ok"), buttonCallback: practice }
57494 function practice() {
57496 ".intro-nav-wrap .chapter-welcome",
57497 helpHtml("intro.welcome.practice"),
57498 { buttonText: _t.html("intro.ok"), buttonCallback: words }
57503 ".intro-nav-wrap .chapter-welcome",
57504 helpHtml("intro.welcome.words"),
57505 { buttonText: _t.html("intro.ok"), buttonCallback: chapters }
57508 function chapters() {
57509 dispatch14.call("done");
57511 ".intro-nav-wrap .chapter-navigation",
57512 helpHtml("intro.welcome.chapters", { next: _t("intro.navigation.title") })
57515 chapter.enter = function() {
57518 chapter.exit = function() {
57519 context.container().select(".curtain-tooltip.intro-mouse").selectAll(".counter").remove();
57521 chapter.restart = function() {
57525 return utilRebind(chapter, dispatch14, "on");
57528 // modules/ui/intro/navigation.js
57529 function uiIntroNavigation(context, reveal) {
57530 var dispatch14 = dispatch_default("done");
57532 var hallId = "n2061";
57533 var townHall = [-85.63591, 41.94285];
57534 var springStreetId = "w397";
57535 var springStreetEndId = "n1834";
57536 var springStreet = [-85.63582, 41.94255];
57537 var onewayField = _mainPresetIndex.field("oneway");
57538 var maxspeedField = _mainPresetIndex.field("maxspeed");
57540 title: "intro.navigation.title"
57542 function timeout2(f3, t2) {
57543 timeouts.push(window.setTimeout(f3, t2));
57545 function eventCancel(d3_event) {
57546 d3_event.stopPropagation();
57547 d3_event.preventDefault();
57549 function isTownHallSelected() {
57550 var ids = context.selectedIDs();
57551 return ids.length === 1 && ids[0] === hallId;
57553 function dragMap() {
57554 context.enter(modeBrowse(context));
57555 context.history().reset("initial");
57556 var msec = transitionTime(townHall, context.map().center());
57558 reveal(null, null, { duration: 0 });
57560 context.map().centerZoomEase(townHall, 19, msec);
57561 timeout2(function() {
57562 var centerStart = context.map().center();
57563 var textId = context.lastPointerType() === "mouse" ? "drag" : "drag_touch";
57564 var dragString = helpHtml("intro.navigation.map_info") + "{br}" + helpHtml("intro.navigation." + textId);
57565 reveal(".surface", dragString);
57566 context.map().on("drawn.intro", function() {
57567 reveal(".surface", dragString, { duration: 0 });
57569 context.map().on("move.intro", function() {
57570 var centerNow = context.map().center();
57571 if (centerStart[0] !== centerNow[0] || centerStart[1] !== centerNow[1]) {
57572 context.map().on("move.intro", null);
57573 timeout2(function() {
57574 continueTo(zoomMap);
57579 function continueTo(nextStep) {
57580 context.map().on("move.intro drawn.intro", null);
57584 function zoomMap() {
57585 var zoomStart = context.map().zoom();
57586 var textId = context.lastPointerType() === "mouse" ? "zoom" : "zoom_touch";
57587 var zoomString = helpHtml("intro.navigation." + textId);
57588 reveal(".surface", zoomString);
57589 context.map().on("drawn.intro", function() {
57590 reveal(".surface", zoomString, { duration: 0 });
57592 context.map().on("move.intro", function() {
57593 if (context.map().zoom() !== zoomStart) {
57594 context.map().on("move.intro", null);
57595 timeout2(function() {
57596 continueTo(features);
57600 function continueTo(nextStep) {
57601 context.map().on("move.intro drawn.intro", null);
57605 function features() {
57606 var onClick = function() {
57607 continueTo(pointsLinesAreas);
57611 helpHtml("intro.navigation.features"),
57612 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57614 context.map().on("drawn.intro", function() {
57617 helpHtml("intro.navigation.features"),
57618 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57621 function continueTo(nextStep) {
57622 context.map().on("drawn.intro", null);
57626 function pointsLinesAreas() {
57627 var onClick = function() {
57628 continueTo(nodesWays);
57632 helpHtml("intro.navigation.points_lines_areas"),
57633 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57635 context.map().on("drawn.intro", function() {
57638 helpHtml("intro.navigation.points_lines_areas"),
57639 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57642 function continueTo(nextStep) {
57643 context.map().on("drawn.intro", null);
57647 function nodesWays() {
57648 var onClick = function() {
57649 continueTo(clickTownHall);
57653 helpHtml("intro.navigation.nodes_ways"),
57654 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57656 context.map().on("drawn.intro", function() {
57659 helpHtml("intro.navigation.nodes_ways"),
57660 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57663 function continueTo(nextStep) {
57664 context.map().on("drawn.intro", null);
57668 function clickTownHall() {
57669 context.enter(modeBrowse(context));
57670 context.history().reset("initial");
57671 var entity = context.hasEntity(hallId);
57674 reveal(null, null, { duration: 0 });
57675 context.map().centerZoomEase(entity.loc, 19, 500);
57676 timeout2(function() {
57677 var entity2 = context.hasEntity(hallId);
57680 var box = pointBox(entity2.loc, context);
57681 var textId = context.lastPointerType() === "mouse" ? "click_townhall" : "tap_townhall";
57682 reveal(box, helpHtml("intro.navigation." + textId));
57683 context.map().on("move.intro drawn.intro", function() {
57684 var entity3 = context.hasEntity(hallId);
57687 var box2 = pointBox(entity3.loc, context);
57688 reveal(box2, helpHtml("intro.navigation." + textId), { duration: 0 });
57690 context.on("enter.intro", function() {
57691 if (isTownHallSelected())
57692 continueTo(selectedTownHall);
57695 context.history().on("change.intro", function() {
57696 if (!context.hasEntity(hallId)) {
57697 continueTo(clickTownHall);
57700 function continueTo(nextStep) {
57701 context.on("enter.intro", null);
57702 context.map().on("move.intro drawn.intro", null);
57703 context.history().on("change.intro", null);
57707 function selectedTownHall() {
57708 if (!isTownHallSelected())
57709 return clickTownHall();
57710 var entity = context.hasEntity(hallId);
57712 return clickTownHall();
57713 var box = pointBox(entity.loc, context);
57714 var onClick = function() {
57715 continueTo(editorTownHall);
57719 helpHtml("intro.navigation.selected_townhall"),
57720 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57722 context.map().on("move.intro drawn.intro", function() {
57723 var entity2 = context.hasEntity(hallId);
57726 var box2 = pointBox(entity2.loc, context);
57729 helpHtml("intro.navigation.selected_townhall"),
57730 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57733 context.history().on("change.intro", function() {
57734 if (!context.hasEntity(hallId)) {
57735 continueTo(clickTownHall);
57738 function continueTo(nextStep) {
57739 context.map().on("move.intro drawn.intro", null);
57740 context.history().on("change.intro", null);
57744 function editorTownHall() {
57745 if (!isTownHallSelected())
57746 return clickTownHall();
57747 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57748 var onClick = function() {
57749 continueTo(presetTownHall);
57752 ".entity-editor-pane",
57753 helpHtml("intro.navigation.editor_townhall"),
57754 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57756 context.on("exit.intro", function() {
57757 continueTo(clickTownHall);
57759 context.history().on("change.intro", function() {
57760 if (!context.hasEntity(hallId)) {
57761 continueTo(clickTownHall);
57764 function continueTo(nextStep) {
57765 context.on("exit.intro", null);
57766 context.history().on("change.intro", null);
57767 context.container().select(".inspector-wrap").on("wheel.intro", null);
57771 function presetTownHall() {
57772 if (!isTownHallSelected())
57773 return clickTownHall();
57774 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
57775 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57776 var entity = context.entity(context.selectedIDs()[0]);
57777 var preset = _mainPresetIndex.match(entity, context.graph());
57778 var onClick = function() {
57779 continueTo(fieldsTownHall);
57782 ".entity-editor-pane .section-feature-type",
57783 helpHtml("intro.navigation.preset_townhall", { preset: preset.name() }),
57784 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57786 context.on("exit.intro", function() {
57787 continueTo(clickTownHall);
57789 context.history().on("change.intro", function() {
57790 if (!context.hasEntity(hallId)) {
57791 continueTo(clickTownHall);
57794 function continueTo(nextStep) {
57795 context.on("exit.intro", null);
57796 context.history().on("change.intro", null);
57797 context.container().select(".inspector-wrap").on("wheel.intro", null);
57801 function fieldsTownHall() {
57802 if (!isTownHallSelected())
57803 return clickTownHall();
57804 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
57805 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57806 var onClick = function() {
57807 continueTo(closeTownHall);
57810 ".entity-editor-pane .section-preset-fields",
57811 helpHtml("intro.navigation.fields_townhall"),
57812 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57814 context.on("exit.intro", function() {
57815 continueTo(clickTownHall);
57817 context.history().on("change.intro", function() {
57818 if (!context.hasEntity(hallId)) {
57819 continueTo(clickTownHall);
57822 function continueTo(nextStep) {
57823 context.on("exit.intro", null);
57824 context.history().on("change.intro", null);
57825 context.container().select(".inspector-wrap").on("wheel.intro", null);
57829 function closeTownHall() {
57830 if (!isTownHallSelected())
57831 return clickTownHall();
57832 var selector = ".entity-editor-pane button.close svg use";
57833 var href = select_default2(selector).attr("href") || "#iD-icon-close";
57835 ".entity-editor-pane",
57836 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href, "inline") } })
57838 context.on("exit.intro", function() {
57839 continueTo(searchStreet);
57841 context.history().on("change.intro", function() {
57842 var selector2 = ".entity-editor-pane button.close svg use";
57843 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
57845 ".entity-editor-pane",
57846 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href2, "inline") } }),
57850 function continueTo(nextStep) {
57851 context.on("exit.intro", null);
57852 context.history().on("change.intro", null);
57856 function searchStreet() {
57857 context.enter(modeBrowse(context));
57858 context.history().reset("initial");
57859 var msec = transitionTime(springStreet, context.map().center());
57861 reveal(null, null, { duration: 0 });
57863 context.map().centerZoomEase(springStreet, 19, msec);
57864 timeout2(function() {
57866 ".search-header input",
57867 helpHtml("intro.navigation.search_street", { name: _t("intro.graph.name.spring-street") })
57869 context.container().select(".search-header input").on("keyup.intro", checkSearchResult);
57872 function checkSearchResult() {
57873 var first = context.container().select(".feature-list-item:nth-child(0n+2)");
57874 var firstName = first.select(".entity-name");
57875 var name = _t("intro.graph.name.spring-street");
57876 if (!firstName.empty() && firstName.html() === name) {
57879 helpHtml("intro.navigation.choose_street", { name }),
57882 context.on("exit.intro", function() {
57883 continueTo(selectedStreet);
57885 context.container().select(".search-header input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
57887 function continueTo(nextStep) {
57888 context.on("exit.intro", null);
57889 context.container().select(".search-header input").on("keydown.intro", null).on("keyup.intro", null);
57893 function selectedStreet() {
57894 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
57895 return searchStreet();
57897 var onClick = function() {
57898 continueTo(editorStreet);
57900 var entity = context.entity(springStreetEndId);
57901 var box = pointBox(entity.loc, context);
57905 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
57906 { duration: 600, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57908 timeout2(function() {
57909 context.map().on("move.intro drawn.intro", function() {
57910 var entity2 = context.hasEntity(springStreetEndId);
57913 var box2 = pointBox(entity2.loc, context);
57917 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
57918 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57922 context.on("enter.intro", function(mode) {
57923 if (!context.hasEntity(springStreetId)) {
57924 return continueTo(searchStreet);
57926 var ids = context.selectedIDs();
57927 if (mode.id !== "select" || !ids.length || ids[0] !== springStreetId) {
57928 context.enter(modeSelect(context, [springStreetId]));
57931 context.history().on("change.intro", function() {
57932 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
57933 timeout2(function() {
57934 continueTo(searchStreet);
57938 function continueTo(nextStep) {
57939 context.map().on("move.intro drawn.intro", null);
57940 context.on("enter.intro", null);
57941 context.history().on("change.intro", null);
57945 function editorStreet() {
57946 var selector = ".entity-editor-pane button.close svg use";
57947 var href = select_default2(selector).attr("href") || "#iD-icon-close";
57948 reveal(".entity-editor-pane", helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
57949 button: { html: icon(href, "inline") },
57950 field1: onewayField.title(),
57951 field2: maxspeedField.title()
57953 context.on("exit.intro", function() {
57956 context.history().on("change.intro", function() {
57957 var selector2 = ".entity-editor-pane button.close svg use";
57958 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
57960 ".entity-editor-pane",
57961 helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
57962 button: { html: icon(href2, "inline") },
57963 field1: onewayField.title(),
57964 field2: maxspeedField.title()
57969 function continueTo(nextStep) {
57970 context.on("exit.intro", null);
57971 context.history().on("change.intro", null);
57976 dispatch14.call("done");
57979 helpHtml("intro.navigation.play", { next: _t("intro.points.title") }),
57981 tooltipBox: ".intro-nav-wrap .chapter-point",
57982 buttonText: _t.html("intro.ok"),
57983 buttonCallback: function() {
57984 reveal(".ideditor");
57989 chapter.enter = function() {
57992 chapter.exit = function() {
57993 timeouts.forEach(window.clearTimeout);
57994 context.on("enter.intro exit.intro", null);
57995 context.map().on("move.intro drawn.intro", null);
57996 context.history().on("change.intro", null);
57997 context.container().select(".inspector-wrap").on("wheel.intro", null);
57998 context.container().select(".search-header input").on("keydown.intro keyup.intro", null);
58000 chapter.restart = function() {
58004 return utilRebind(chapter, dispatch14, "on");
58007 // modules/ui/intro/point.js
58008 function uiIntroPoint(context, reveal) {
58009 var dispatch14 = dispatch_default("done");
58011 var intersection = [-85.63279, 41.94394];
58012 var building = [-85.632422, 41.944045];
58013 var cafePreset = _mainPresetIndex.item("amenity/cafe");
58014 var _pointID = null;
58016 title: "intro.points.title"
58018 function timeout2(f3, t2) {
58019 timeouts.push(window.setTimeout(f3, t2));
58021 function eventCancel(d3_event) {
58022 d3_event.stopPropagation();
58023 d3_event.preventDefault();
58025 function addPoint() {
58026 context.enter(modeBrowse(context));
58027 context.history().reset("initial");
58028 var msec = transitionTime(intersection, context.map().center());
58030 reveal(null, null, { duration: 0 });
58032 context.map().centerZoomEase(intersection, 19, msec);
58033 timeout2(function() {
58034 var tooltip = reveal(
58035 "button.add-point",
58036 helpHtml("intro.points.points_info") + "{br}" + helpHtml("intro.points.add_point")
58039 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-points");
58040 context.on("enter.intro", function(mode) {
58041 if (mode.id !== "add-point")
58043 continueTo(placePoint);
58046 function continueTo(nextStep) {
58047 context.on("enter.intro", null);
58051 function placePoint() {
58052 if (context.mode().id !== "add-point") {
58053 return chapter.restart();
58055 var pointBox2 = pad(building, 150, context);
58056 var textId = context.lastPointerType() === "mouse" ? "place_point" : "place_point_touch";
58057 reveal(pointBox2, helpHtml("intro.points." + textId));
58058 context.map().on("move.intro drawn.intro", function() {
58059 pointBox2 = pad(building, 150, context);
58060 reveal(pointBox2, helpHtml("intro.points." + textId), { duration: 0 });
58062 context.on("enter.intro", function(mode) {
58063 if (mode.id !== "select")
58064 return chapter.restart();
58065 _pointID = context.mode().selectedIDs()[0];
58066 continueTo(searchPreset);
58068 function continueTo(nextStep) {
58069 context.map().on("move.intro drawn.intro", null);
58070 context.on("enter.intro", null);
58074 function searchPreset() {
58075 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58078 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58079 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58081 ".preset-search-input",
58082 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
58084 context.on("enter.intro", function(mode) {
58085 if (!_pointID || !context.hasEntity(_pointID)) {
58086 return continueTo(addPoint);
58088 var ids = context.selectedIDs();
58089 if (mode.id !== "select" || !ids.length || ids[0] !== _pointID) {
58090 context.enter(modeSelect(context, [_pointID]));
58091 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58092 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58094 ".preset-search-input",
58095 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
58097 context.history().on("change.intro", null);
58100 function checkPresetSearch() {
58101 var first = context.container().select(".preset-list-item:first-child");
58102 if (first.classed("preset-amenity-cafe")) {
58103 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
58105 first.select(".preset-list-button").node(),
58106 helpHtml("intro.points.choose_cafe", { preset: cafePreset.name() }),
58109 context.history().on("change.intro", function() {
58110 continueTo(aboutFeatureEditor);
58114 function continueTo(nextStep) {
58115 context.on("enter.intro", null);
58116 context.history().on("change.intro", null);
58117 context.container().select(".inspector-wrap").on("wheel.intro", null);
58118 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58122 function aboutFeatureEditor() {
58123 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58126 timeout2(function() {
58127 reveal(".entity-editor-pane", helpHtml("intro.points.feature_editor"), {
58128 tooltipClass: "intro-points-describe",
58129 buttonText: _t.html("intro.ok"),
58130 buttonCallback: function() {
58131 continueTo(addName);
58135 context.on("exit.intro", function() {
58136 continueTo(reselectPoint);
58138 function continueTo(nextStep) {
58139 context.on("exit.intro", null);
58143 function addName() {
58144 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58147 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58148 var addNameString = helpHtml("intro.points.fields_info") + "{br}" + helpHtml("intro.points.add_name");
58149 timeout2(function() {
58150 var entity = context.entity(_pointID);
58151 if (entity.tags.name) {
58152 var tooltip = reveal(".entity-editor-pane", addNameString, {
58153 tooltipClass: "intro-points-describe",
58154 buttonText: _t.html("intro.ok"),
58155 buttonCallback: function() {
58156 continueTo(addCloseEditor);
58159 tooltip.select(".instruction").style("display", "none");
58162 ".entity-editor-pane",
58164 { tooltipClass: "intro-points-describe" }
58168 context.history().on("change.intro", function() {
58169 continueTo(addCloseEditor);
58171 context.on("exit.intro", function() {
58172 continueTo(reselectPoint);
58174 function continueTo(nextStep) {
58175 context.on("exit.intro", null);
58176 context.history().on("change.intro", null);
58180 function addCloseEditor() {
58181 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58182 var selector = ".entity-editor-pane button.close svg use";
58183 var href = select_default2(selector).attr("href") || "#iD-icon-close";
58184 context.on("exit.intro", function() {
58185 continueTo(reselectPoint);
58188 ".entity-editor-pane",
58189 helpHtml("intro.points.add_close", { button: { html: icon(href, "inline") } })
58191 function continueTo(nextStep) {
58192 context.on("exit.intro", null);
58196 function reselectPoint() {
58198 return chapter.restart();
58199 var entity = context.hasEntity(_pointID);
58201 return chapter.restart();
58202 var oldPreset = _mainPresetIndex.match(entity, context.graph());
58203 context.replace(actionChangePreset(_pointID, oldPreset, cafePreset));
58204 context.enter(modeBrowse(context));
58205 var msec = transitionTime(entity.loc, context.map().center());
58207 reveal(null, null, { duration: 0 });
58209 context.map().centerEase(entity.loc, msec);
58210 timeout2(function() {
58211 var box = pointBox(entity.loc, context);
58212 reveal(box, helpHtml("intro.points.reselect"), { duration: 600 });
58213 timeout2(function() {
58214 context.map().on("move.intro drawn.intro", function() {
58215 var entity2 = context.hasEntity(_pointID);
58217 return chapter.restart();
58218 var box2 = pointBox(entity2.loc, context);
58219 reveal(box2, helpHtml("intro.points.reselect"), { duration: 0 });
58222 context.on("enter.intro", function(mode) {
58223 if (mode.id !== "select")
58225 continueTo(updatePoint);
58228 function continueTo(nextStep) {
58229 context.map().on("move.intro drawn.intro", null);
58230 context.on("enter.intro", null);
58234 function updatePoint() {
58235 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58236 return continueTo(reselectPoint);
58238 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58239 context.on("exit.intro", function() {
58240 continueTo(reselectPoint);
58242 context.history().on("change.intro", function() {
58243 continueTo(updateCloseEditor);
58245 timeout2(function() {
58247 ".entity-editor-pane",
58248 helpHtml("intro.points.update"),
58249 { tooltipClass: "intro-points-describe" }
58252 function continueTo(nextStep) {
58253 context.on("exit.intro", null);
58254 context.history().on("change.intro", null);
58258 function updateCloseEditor() {
58259 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58260 return continueTo(reselectPoint);
58262 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58263 context.on("exit.intro", function() {
58264 continueTo(rightClickPoint);
58266 timeout2(function() {
58268 ".entity-editor-pane",
58269 helpHtml("intro.points.update_close", { button: { html: icon("#iD-icon-close", "inline") } })
58272 function continueTo(nextStep) {
58273 context.on("exit.intro", null);
58277 function rightClickPoint() {
58279 return chapter.restart();
58280 var entity = context.hasEntity(_pointID);
58282 return chapter.restart();
58283 context.enter(modeBrowse(context));
58284 var box = pointBox(entity.loc, context);
58285 var textId = context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch";
58286 reveal(box, helpHtml("intro.points." + textId), { duration: 600 });
58287 timeout2(function() {
58288 context.map().on("move.intro", function() {
58289 var entity2 = context.hasEntity(_pointID);
58291 return chapter.restart();
58292 var box2 = pointBox(entity2.loc, context);
58293 reveal(box2, helpHtml("intro.points." + textId), { duration: 0 });
58296 context.on("enter.intro", function(mode) {
58297 if (mode.id !== "select")
58299 var ids = context.selectedIDs();
58300 if (ids.length !== 1 || ids[0] !== _pointID)
58302 timeout2(function() {
58303 var node = selectMenuItem(context, "delete").node();
58306 continueTo(enterDelete);
58309 function continueTo(nextStep) {
58310 context.on("enter.intro", null);
58311 context.map().on("move.intro", null);
58315 function enterDelete() {
58317 return chapter.restart();
58318 var entity = context.hasEntity(_pointID);
58320 return chapter.restart();
58321 var node = selectMenuItem(context, "delete").node();
58323 return continueTo(rightClickPoint);
58327 helpHtml("intro.points.delete"),
58330 timeout2(function() {
58331 context.map().on("move.intro", function() {
58334 helpHtml("intro.points.delete"),
58335 { duration: 0, padding: 50 }
58339 context.on("exit.intro", function() {
58341 return chapter.restart();
58342 var entity2 = context.hasEntity(_pointID);
58344 return continueTo(rightClickPoint);
58346 context.history().on("change.intro", function(changed) {
58347 if (changed.deleted().length) {
58351 function continueTo(nextStep) {
58352 context.map().on("move.intro", null);
58353 context.history().on("change.intro", null);
58354 context.on("exit.intro", null);
58359 context.history().on("change.intro", function() {
58363 ".top-toolbar button.undo-button",
58364 helpHtml("intro.points.undo")
58366 function continueTo(nextStep) {
58367 context.history().on("change.intro", null);
58372 dispatch14.call("done");
58375 helpHtml("intro.points.play", { next: _t("intro.areas.title") }),
58377 tooltipBox: ".intro-nav-wrap .chapter-area",
58378 buttonText: _t.html("intro.ok"),
58379 buttonCallback: function() {
58380 reveal(".ideditor");
58385 chapter.enter = function() {
58388 chapter.exit = function() {
58389 timeouts.forEach(window.clearTimeout);
58390 context.on("enter.intro exit.intro", null);
58391 context.map().on("move.intro drawn.intro", null);
58392 context.history().on("change.intro", null);
58393 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58394 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58396 chapter.restart = function() {
58400 return utilRebind(chapter, dispatch14, "on");
58403 // modules/ui/intro/area.js
58404 function uiIntroArea(context, reveal) {
58405 var dispatch14 = dispatch_default("done");
58406 var playground = [-85.63552, 41.94159];
58407 var playgroundPreset = _mainPresetIndex.item("leisure/playground");
58408 var nameField = _mainPresetIndex.field("name");
58409 var descriptionField = _mainPresetIndex.field("description");
58413 title: "intro.areas.title"
58415 function timeout2(f3, t2) {
58416 timeouts.push(window.setTimeout(f3, t2));
58418 function eventCancel(d3_event) {
58419 d3_event.stopPropagation();
58420 d3_event.preventDefault();
58422 function revealPlayground(center, text2, options2) {
58423 var padding = 180 * Math.pow(2, context.map().zoom() - 19.5);
58424 var box = pad(center, padding, context);
58425 reveal(box, text2, options2);
58427 function addArea() {
58428 context.enter(modeBrowse(context));
58429 context.history().reset("initial");
58431 var msec = transitionTime(playground, context.map().center());
58433 reveal(null, null, { duration: 0 });
58435 context.map().centerZoomEase(playground, 19, msec);
58436 timeout2(function() {
58437 var tooltip = reveal(
58439 helpHtml("intro.areas.add_playground")
58441 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-areas");
58442 context.on("enter.intro", function(mode) {
58443 if (mode.id !== "add-area")
58445 continueTo(startPlayground);
58448 function continueTo(nextStep) {
58449 context.on("enter.intro", null);
58453 function startPlayground() {
58454 if (context.mode().id !== "add-area") {
58455 return chapter.restart();
58458 context.map().zoomEase(19.5, 500);
58459 timeout2(function() {
58460 var textId = context.lastPointerType() === "mouse" ? "starting_node_click" : "starting_node_tap";
58461 var startDrawString = helpHtml("intro.areas.start_playground") + helpHtml("intro.areas." + textId);
58467 timeout2(function() {
58468 context.map().on("move.intro drawn.intro", function() {
58475 context.on("enter.intro", function(mode) {
58476 if (mode.id !== "draw-area")
58477 return chapter.restart();
58478 continueTo(continuePlayground);
58482 function continueTo(nextStep) {
58483 context.map().on("move.intro drawn.intro", null);
58484 context.on("enter.intro", null);
58488 function continuePlayground() {
58489 if (context.mode().id !== "draw-area") {
58490 return chapter.restart();
58495 helpHtml("intro.areas.continue_playground"),
58498 timeout2(function() {
58499 context.map().on("move.intro drawn.intro", function() {
58502 helpHtml("intro.areas.continue_playground"),
58507 context.on("enter.intro", function(mode) {
58508 if (mode.id === "draw-area") {
58509 var entity = context.hasEntity(context.selectedIDs()[0]);
58510 if (entity && entity.nodes.length >= 6) {
58511 return continueTo(finishPlayground);
58515 } else if (mode.id === "select") {
58516 _areaID = context.selectedIDs()[0];
58517 return continueTo(searchPresets);
58519 return chapter.restart();
58522 function continueTo(nextStep) {
58523 context.map().on("move.intro drawn.intro", null);
58524 context.on("enter.intro", null);
58528 function finishPlayground() {
58529 if (context.mode().id !== "draw-area") {
58530 return chapter.restart();
58533 var finishString = helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.areas.finish_playground");
58539 timeout2(function() {
58540 context.map().on("move.intro drawn.intro", function() {
58548 context.on("enter.intro", function(mode) {
58549 if (mode.id === "draw-area") {
58551 } else if (mode.id === "select") {
58552 _areaID = context.selectedIDs()[0];
58553 return continueTo(searchPresets);
58555 return chapter.restart();
58558 function continueTo(nextStep) {
58559 context.map().on("move.intro drawn.intro", null);
58560 context.on("enter.intro", null);
58564 function searchPresets() {
58565 if (!_areaID || !context.hasEntity(_areaID)) {
58568 var ids = context.selectedIDs();
58569 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58570 context.enter(modeSelect(context, [_areaID]));
58572 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58573 timeout2(function() {
58574 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
58575 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58577 ".preset-search-input",
58578 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
58581 context.on("enter.intro", function(mode) {
58582 if (!_areaID || !context.hasEntity(_areaID)) {
58583 return continueTo(addArea);
58585 var ids2 = context.selectedIDs();
58586 if (mode.id !== "select" || !ids2.length || ids2[0] !== _areaID) {
58587 context.enter(modeSelect(context, [_areaID]));
58588 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
58589 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58590 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58592 ".preset-search-input",
58593 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
58595 context.history().on("change.intro", null);
58598 function checkPresetSearch() {
58599 var first = context.container().select(".preset-list-item:first-child");
58600 if (first.classed("preset-leisure-playground")) {
58602 first.select(".preset-list-button").node(),
58603 helpHtml("intro.areas.choose_playground", { preset: playgroundPreset.name() }),
58606 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
58607 context.history().on("change.intro", function() {
58608 continueTo(clickAddField);
58612 function continueTo(nextStep) {
58613 context.container().select(".inspector-wrap").on("wheel.intro", null);
58614 context.on("enter.intro", null);
58615 context.history().on("change.intro", null);
58616 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58620 function clickAddField() {
58621 if (!_areaID || !context.hasEntity(_areaID)) {
58624 var ids = context.selectedIDs();
58625 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58626 return searchPresets();
58628 if (!context.container().select(".form-field-description").empty()) {
58629 return continueTo(describePlayground);
58631 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58632 timeout2(function() {
58633 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58634 var entity = context.entity(_areaID);
58635 if (entity.tags.description) {
58636 return continueTo(play);
58638 var box = context.container().select(".more-fields").node().getBoundingClientRect();
58639 if (box.top > 300) {
58640 var pane = context.container().select(".entity-editor-pane .inspector-body");
58641 var start2 = pane.node().scrollTop;
58642 var end = start2 + (box.top - 300);
58643 pane.transition().duration(250).tween("scroll.inspector", function() {
58645 var i3 = number_default(start2, end);
58646 return function(t2) {
58647 node.scrollTop = i3(t2);
58651 timeout2(function() {
58653 ".more-fields .combobox-input",
58654 helpHtml("intro.areas.add_field", {
58655 name: nameField.title(),
58656 description: descriptionField.title()
58660 context.container().select(".more-fields .combobox-input").on("click.intro", function() {
58662 watcher = window.setInterval(function() {
58663 if (!context.container().select("div.combobox").empty()) {
58664 window.clearInterval(watcher);
58665 continueTo(chooseDescriptionField);
58671 context.on("exit.intro", function() {
58672 return continueTo(searchPresets);
58674 function continueTo(nextStep) {
58675 context.container().select(".inspector-wrap").on("wheel.intro", null);
58676 context.container().select(".more-fields .combobox-input").on("click.intro", null);
58677 context.on("exit.intro", null);
58681 function chooseDescriptionField() {
58682 if (!_areaID || !context.hasEntity(_areaID)) {
58685 var ids = context.selectedIDs();
58686 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58687 return searchPresets();
58689 if (!context.container().select(".form-field-description").empty()) {
58690 return continueTo(describePlayground);
58692 if (context.container().select("div.combobox").empty()) {
58693 return continueTo(clickAddField);
58696 watcher = window.setInterval(function() {
58697 if (context.container().select("div.combobox").empty()) {
58698 window.clearInterval(watcher);
58699 timeout2(function() {
58700 if (context.container().select(".form-field-description").empty()) {
58701 continueTo(retryChooseDescription);
58703 continueTo(describePlayground);
58710 helpHtml("intro.areas.choose_field", { field: descriptionField.title() }),
58713 context.on("exit.intro", function() {
58714 return continueTo(searchPresets);
58716 function continueTo(nextStep) {
58718 window.clearInterval(watcher);
58719 context.on("exit.intro", null);
58723 function describePlayground() {
58724 if (!_areaID || !context.hasEntity(_areaID)) {
58727 var ids = context.selectedIDs();
58728 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58729 return searchPresets();
58731 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58732 if (context.container().select(".form-field-description").empty()) {
58733 return continueTo(retryChooseDescription);
58735 context.on("exit.intro", function() {
58739 ".entity-editor-pane",
58740 helpHtml("intro.areas.describe_playground", { button: { html: icon("#iD-icon-close", "inline") } }),
58743 function continueTo(nextStep) {
58744 context.on("exit.intro", null);
58748 function retryChooseDescription() {
58749 if (!_areaID || !context.hasEntity(_areaID)) {
58752 var ids = context.selectedIDs();
58753 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58754 return searchPresets();
58756 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58758 ".entity-editor-pane",
58759 helpHtml("intro.areas.retry_add_field", { field: descriptionField.title() }),
58761 buttonText: _t.html("intro.ok"),
58762 buttonCallback: function() {
58763 continueTo(clickAddField);
58767 context.on("exit.intro", function() {
58768 return continueTo(searchPresets);
58770 function continueTo(nextStep) {
58771 context.on("exit.intro", null);
58776 dispatch14.call("done");
58779 helpHtml("intro.areas.play", { next: _t("intro.lines.title") }),
58781 tooltipBox: ".intro-nav-wrap .chapter-line",
58782 buttonText: _t.html("intro.ok"),
58783 buttonCallback: function() {
58784 reveal(".ideditor");
58789 chapter.enter = function() {
58792 chapter.exit = function() {
58793 timeouts.forEach(window.clearTimeout);
58794 context.on("enter.intro exit.intro", null);
58795 context.map().on("move.intro drawn.intro", null);
58796 context.history().on("change.intro", null);
58797 context.container().select(".inspector-wrap").on("wheel.intro", null);
58798 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58799 context.container().select(".more-fields .combobox-input").on("click.intro", null);
58801 chapter.restart = function() {
58805 return utilRebind(chapter, dispatch14, "on");
58808 // modules/ui/intro/line.js
58809 function uiIntroLine(context, reveal) {
58810 var dispatch14 = dispatch_default("done");
58812 var _tulipRoadID = null;
58813 var flowerRoadID = "w646";
58814 var tulipRoadStart = [-85.6297754121684, 41.95805253325314];
58815 var tulipRoadMidpoint = [-85.62975395449628, 41.95787501510204];
58816 var tulipRoadIntersection = [-85.62974496187628, 41.95742515554585];
58817 var roadCategory = _mainPresetIndex.item("category-road_minor");
58818 var residentialPreset = _mainPresetIndex.item("highway/residential");
58819 var woodRoadID = "w525";
58820 var woodRoadEndID = "n2862";
58821 var woodRoadAddNode = [-85.62390110349587, 41.95397111462291];
58822 var woodRoadDragEndpoint = [-85.623867390213, 41.95466987786487];
58823 var woodRoadDragMidpoint = [-85.62386254803509, 41.95430395953872];
58824 var washingtonStreetID = "w522";
58825 var twelfthAvenueID = "w1";
58826 var eleventhAvenueEndID = "n3550";
58827 var twelfthAvenueEndID = "n5";
58828 var _washingtonSegmentID = null;
58829 var eleventhAvenueEnd = context.entity(eleventhAvenueEndID).loc;
58830 var twelfthAvenueEnd = context.entity(twelfthAvenueEndID).loc;
58831 var deleteLinesLoc = [-85.6219395542764, 41.95228033922477];
58832 var twelfthAvenue = [-85.62219310052491, 41.952505413152956];
58834 title: "intro.lines.title"
58836 function timeout2(f3, t2) {
58837 timeouts.push(window.setTimeout(f3, t2));
58839 function eventCancel(d3_event) {
58840 d3_event.stopPropagation();
58841 d3_event.preventDefault();
58843 function addLine() {
58844 context.enter(modeBrowse(context));
58845 context.history().reset("initial");
58846 var msec = transitionTime(tulipRoadStart, context.map().center());
58848 reveal(null, null, { duration: 0 });
58850 context.map().centerZoomEase(tulipRoadStart, 18.5, msec);
58851 timeout2(function() {
58852 var tooltip = reveal(
58854 helpHtml("intro.lines.add_line")
58856 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-lines");
58857 context.on("enter.intro", function(mode) {
58858 if (mode.id !== "add-line")
58860 continueTo(startLine);
58863 function continueTo(nextStep) {
58864 context.on("enter.intro", null);
58868 function startLine() {
58869 if (context.mode().id !== "add-line")
58870 return chapter.restart();
58871 _tulipRoadID = null;
58872 var padding = 70 * Math.pow(2, context.map().zoom() - 18);
58873 var box = pad(tulipRoadStart, padding, context);
58874 box.height = box.height + 100;
58875 var textId = context.lastPointerType() === "mouse" ? "start_line" : "start_line_tap";
58876 var startLineString = helpHtml("intro.lines.missing_road") + "{br}" + helpHtml("intro.lines.line_draw_info") + helpHtml("intro.lines." + textId);
58877 reveal(box, startLineString);
58878 context.map().on("move.intro drawn.intro", function() {
58879 padding = 70 * Math.pow(2, context.map().zoom() - 18);
58880 box = pad(tulipRoadStart, padding, context);
58881 box.height = box.height + 100;
58882 reveal(box, startLineString, { duration: 0 });
58884 context.on("enter.intro", function(mode) {
58885 if (mode.id !== "draw-line")
58886 return chapter.restart();
58887 continueTo(drawLine);
58889 function continueTo(nextStep) {
58890 context.map().on("move.intro drawn.intro", null);
58891 context.on("enter.intro", null);
58895 function drawLine() {
58896 if (context.mode().id !== "draw-line")
58897 return chapter.restart();
58898 _tulipRoadID = context.mode().selectedIDs()[0];
58899 context.map().centerEase(tulipRoadMidpoint, 500);
58900 timeout2(function() {
58901 var padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
58902 var box = pad(tulipRoadMidpoint, padding, context);
58903 box.height = box.height * 2;
58906 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") })
58908 context.map().on("move.intro drawn.intro", function() {
58909 padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
58910 box = pad(tulipRoadMidpoint, padding, context);
58911 box.height = box.height * 2;
58914 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") }),
58919 context.history().on("change.intro", function() {
58920 if (isLineConnected()) {
58921 continueTo(continueLine);
58924 context.on("enter.intro", function(mode) {
58925 if (mode.id === "draw-line") {
58927 } else if (mode.id === "select") {
58928 continueTo(retryIntersect);
58931 return chapter.restart();
58934 function continueTo(nextStep) {
58935 context.map().on("move.intro drawn.intro", null);
58936 context.history().on("change.intro", null);
58937 context.on("enter.intro", null);
58941 function isLineConnected() {
58942 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
58945 var drawNodes = context.graph().childNodes(entity);
58946 return drawNodes.some(function(node) {
58947 return context.graph().parentWays(node).some(function(parent) {
58948 return parent.id === flowerRoadID;
58952 function retryIntersect() {
58953 select_default2(window).on("pointerdown.intro mousedown.intro", eventCancel, true);
58954 var box = pad(tulipRoadIntersection, 80, context);
58957 helpHtml("intro.lines.retry_intersect", { name: _t("intro.graph.name.flower-street") })
58959 timeout2(chapter.restart, 3e3);
58961 function continueLine() {
58962 if (context.mode().id !== "draw-line")
58963 return chapter.restart();
58964 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
58966 return chapter.restart();
58967 context.map().centerEase(tulipRoadIntersection, 500);
58968 var continueLineText = helpHtml("intro.lines.continue_line") + "{br}" + helpHtml("intro.lines.finish_line_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.lines.finish_road");
58969 reveal(".surface", continueLineText);
58970 context.on("enter.intro", function(mode) {
58971 if (mode.id === "draw-line") {
58973 } else if (mode.id === "select") {
58974 return continueTo(chooseCategoryRoad);
58976 return chapter.restart();
58979 function continueTo(nextStep) {
58980 context.on("enter.intro", null);
58984 function chooseCategoryRoad() {
58985 if (context.mode().id !== "select")
58986 return chapter.restart();
58987 context.on("exit.intro", function() {
58988 return chapter.restart();
58990 var button = context.container().select(".preset-category-road_minor .preset-list-button");
58991 if (button.empty())
58992 return chapter.restart();
58993 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58994 timeout2(function() {
58995 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
58998 helpHtml("intro.lines.choose_category_road", { category: roadCategory.name() })
59000 button.on("click.intro", function() {
59001 continueTo(choosePresetResidential);
59004 function continueTo(nextStep) {
59005 context.container().select(".inspector-wrap").on("wheel.intro", null);
59006 context.container().select(".preset-list-button").on("click.intro", null);
59007 context.on("exit.intro", null);
59011 function choosePresetResidential() {
59012 if (context.mode().id !== "select")
59013 return chapter.restart();
59014 context.on("exit.intro", function() {
59015 return chapter.restart();
59017 var subgrid = context.container().select(".preset-category-road_minor .subgrid");
59018 if (subgrid.empty())
59019 return chapter.restart();
59020 subgrid.selectAll(":not(.preset-highway-residential) .preset-list-button").on("click.intro", function() {
59021 continueTo(retryPresetResidential);
59023 subgrid.selectAll(".preset-highway-residential .preset-list-button").on("click.intro", function() {
59024 continueTo(nameRoad);
59026 timeout2(function() {
59029 helpHtml("intro.lines.choose_preset_residential", { preset: residentialPreset.name() }),
59030 { tooltipBox: ".preset-highway-residential .preset-list-button", duration: 300 }
59033 function continueTo(nextStep) {
59034 context.container().select(".preset-list-button").on("click.intro", null);
59035 context.on("exit.intro", null);
59039 function retryPresetResidential() {
59040 if (context.mode().id !== "select")
59041 return chapter.restart();
59042 context.on("exit.intro", function() {
59043 return chapter.restart();
59045 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59046 timeout2(function() {
59047 var button = context.container().select(".entity-editor-pane .preset-list-button");
59050 helpHtml("intro.lines.retry_preset_residential", { preset: residentialPreset.name() })
59052 button.on("click.intro", function() {
59053 continueTo(chooseCategoryRoad);
59056 function continueTo(nextStep) {
59057 context.container().select(".inspector-wrap").on("wheel.intro", null);
59058 context.container().select(".preset-list-button").on("click.intro", null);
59059 context.on("exit.intro", null);
59063 function nameRoad() {
59064 context.on("exit.intro", function() {
59065 continueTo(didNameRoad);
59067 timeout2(function() {
59069 ".entity-editor-pane",
59070 helpHtml("intro.lines.name_road", { button: { html: icon("#iD-icon-close", "inline") } }),
59071 { tooltipClass: "intro-lines-name_road" }
59074 function continueTo(nextStep) {
59075 context.on("exit.intro", null);
59079 function didNameRoad() {
59080 context.history().checkpoint("doneAddLine");
59081 timeout2(function() {
59082 reveal(".surface", helpHtml("intro.lines.did_name_road"), {
59083 buttonText: _t.html("intro.ok"),
59084 buttonCallback: function() {
59085 continueTo(updateLine);
59089 function continueTo(nextStep) {
59093 function updateLine() {
59094 context.history().reset("doneAddLine");
59095 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59096 return chapter.restart();
59098 var msec = transitionTime(woodRoadDragMidpoint, context.map().center());
59100 reveal(null, null, { duration: 0 });
59102 context.map().centerZoomEase(woodRoadDragMidpoint, 19, msec);
59103 timeout2(function() {
59104 var padding = 250 * Math.pow(2, context.map().zoom() - 19);
59105 var box = pad(woodRoadDragMidpoint, padding, context);
59106 var advance = function() {
59107 continueTo(addNode);
59111 helpHtml("intro.lines.update_line"),
59112 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59114 context.map().on("move.intro drawn.intro", function() {
59115 var padding2 = 250 * Math.pow(2, context.map().zoom() - 19);
59116 var box2 = pad(woodRoadDragMidpoint, padding2, context);
59119 helpHtml("intro.lines.update_line"),
59120 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59124 function continueTo(nextStep) {
59125 context.map().on("move.intro drawn.intro", null);
59129 function addNode() {
59130 context.history().reset("doneAddLine");
59131 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59132 return chapter.restart();
59134 var padding = 40 * Math.pow(2, context.map().zoom() - 19);
59135 var box = pad(woodRoadAddNode, padding, context);
59136 var addNodeString = helpHtml("intro.lines.add_node" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
59137 reveal(box, addNodeString);
59138 context.map().on("move.intro drawn.intro", function() {
59139 var padding2 = 40 * Math.pow(2, context.map().zoom() - 19);
59140 var box2 = pad(woodRoadAddNode, padding2, context);
59141 reveal(box2, addNodeString, { duration: 0 });
59143 context.history().on("change.intro", function(changed) {
59144 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59145 return continueTo(updateLine);
59147 if (changed.created().length === 1) {
59148 timeout2(function() {
59149 continueTo(startDragEndpoint);
59153 context.on("enter.intro", function(mode) {
59154 if (mode.id !== "select") {
59155 continueTo(updateLine);
59158 function continueTo(nextStep) {
59159 context.map().on("move.intro drawn.intro", null);
59160 context.history().on("change.intro", null);
59161 context.on("enter.intro", null);
59165 function startDragEndpoint() {
59166 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59167 return continueTo(updateLine);
59169 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59170 var box = pad(woodRoadDragEndpoint, padding, context);
59171 var startDragString = helpHtml("intro.lines.start_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch")) + helpHtml("intro.lines.drag_to_intersection");
59172 reveal(box, startDragString);
59173 context.map().on("move.intro drawn.intro", function() {
59174 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59175 return continueTo(updateLine);
59177 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59178 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59179 reveal(box2, startDragString, { duration: 0 });
59180 var entity = context.entity(woodRoadEndID);
59181 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) <= 4) {
59182 continueTo(finishDragEndpoint);
59185 function continueTo(nextStep) {
59186 context.map().on("move.intro drawn.intro", null);
59190 function finishDragEndpoint() {
59191 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59192 return continueTo(updateLine);
59194 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59195 var box = pad(woodRoadDragEndpoint, padding, context);
59196 var finishDragString = helpHtml("intro.lines.spot_looks_good") + helpHtml("intro.lines.finish_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
59197 reveal(box, finishDragString);
59198 context.map().on("move.intro drawn.intro", function() {
59199 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59200 return continueTo(updateLine);
59202 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59203 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59204 reveal(box2, finishDragString, { duration: 0 });
59205 var entity = context.entity(woodRoadEndID);
59206 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) > 4) {
59207 continueTo(startDragEndpoint);
59210 context.on("enter.intro", function() {
59211 continueTo(startDragMidpoint);
59213 function continueTo(nextStep) {
59214 context.map().on("move.intro drawn.intro", null);
59215 context.on("enter.intro", null);
59219 function startDragMidpoint() {
59220 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59221 return continueTo(updateLine);
59223 if (context.selectedIDs().indexOf(woodRoadID) === -1) {
59224 context.enter(modeSelect(context, [woodRoadID]));
59226 var padding = 80 * Math.pow(2, context.map().zoom() - 19);
59227 var box = pad(woodRoadDragMidpoint, padding, context);
59228 reveal(box, helpHtml("intro.lines.start_drag_midpoint"));
59229 context.map().on("move.intro drawn.intro", function() {
59230 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59231 return continueTo(updateLine);
59233 var padding2 = 80 * Math.pow(2, context.map().zoom() - 19);
59234 var box2 = pad(woodRoadDragMidpoint, padding2, context);
59235 reveal(box2, helpHtml("intro.lines.start_drag_midpoint"), { duration: 0 });
59237 context.history().on("change.intro", function(changed) {
59238 if (changed.created().length === 1) {
59239 continueTo(continueDragMidpoint);
59242 context.on("enter.intro", function(mode) {
59243 if (mode.id !== "select") {
59244 context.enter(modeSelect(context, [woodRoadID]));
59247 function continueTo(nextStep) {
59248 context.map().on("move.intro drawn.intro", null);
59249 context.history().on("change.intro", null);
59250 context.on("enter.intro", null);
59254 function continueDragMidpoint() {
59255 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59256 return continueTo(updateLine);
59258 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59259 var box = pad(woodRoadDragEndpoint, padding, context);
59261 var advance = function() {
59262 context.history().checkpoint("doneUpdateLine");
59263 continueTo(deleteLines);
59267 helpHtml("intro.lines.continue_drag_midpoint"),
59268 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59270 context.map().on("move.intro drawn.intro", function() {
59271 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59272 return continueTo(updateLine);
59274 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59275 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59276 box2.height += 400;
59279 helpHtml("intro.lines.continue_drag_midpoint"),
59280 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59283 function continueTo(nextStep) {
59284 context.map().on("move.intro drawn.intro", null);
59288 function deleteLines() {
59289 context.history().reset("doneUpdateLine");
59290 context.enter(modeBrowse(context));
59291 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59292 return chapter.restart();
59294 var msec = transitionTime(deleteLinesLoc, context.map().center());
59296 reveal(null, null, { duration: 0 });
59298 context.map().centerZoomEase(deleteLinesLoc, 18, msec);
59299 timeout2(function() {
59300 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59301 var box = pad(deleteLinesLoc, padding, context);
59304 var advance = function() {
59305 continueTo(rightClickIntersection);
59309 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
59310 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59312 context.map().on("move.intro drawn.intro", function() {
59313 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59314 var box2 = pad(deleteLinesLoc, padding2, context);
59316 box2.height += 400;
59319 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
59320 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59323 context.history().on("change.intro", function() {
59324 timeout2(function() {
59325 continueTo(deleteLines);
59329 function continueTo(nextStep) {
59330 context.map().on("move.intro drawn.intro", null);
59331 context.history().on("change.intro", null);
59335 function rightClickIntersection() {
59336 context.history().reset("doneUpdateLine");
59337 context.enter(modeBrowse(context));
59338 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
59339 var rightClickString = helpHtml("intro.lines.split_street", {
59340 street1: _t("intro.graph.name.11th-avenue"),
59341 street2: _t("intro.graph.name.washington-street")
59342 }) + helpHtml("intro.lines." + (context.lastPointerType() === "mouse" ? "rightclick_intersection" : "edit_menu_intersection_touch"));
59343 timeout2(function() {
59344 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
59345 var box = pad(eleventhAvenueEnd, padding, context);
59346 reveal(box, rightClickString);
59347 context.map().on("move.intro drawn.intro", function() {
59348 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
59349 var box2 = pad(eleventhAvenueEnd, padding2, context);
59356 context.on("enter.intro", function(mode) {
59357 if (mode.id !== "select")
59359 var ids = context.selectedIDs();
59360 if (ids.length !== 1 || ids[0] !== eleventhAvenueEndID)
59362 timeout2(function() {
59363 var node = selectMenuItem(context, "split").node();
59366 continueTo(splitIntersection);
59369 context.history().on("change.intro", function() {
59370 timeout2(function() {
59371 continueTo(deleteLines);
59375 function continueTo(nextStep) {
59376 context.map().on("move.intro drawn.intro", null);
59377 context.on("enter.intro", null);
59378 context.history().on("change.intro", null);
59382 function splitIntersection() {
59383 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59384 return continueTo(deleteLines);
59386 var node = selectMenuItem(context, "split").node();
59388 return continueTo(rightClickIntersection);
59390 var wasChanged = false;
59391 _washingtonSegmentID = null;
59395 "intro.lines.split_intersection",
59396 { street: _t("intro.graph.name.washington-street") }
59400 context.map().on("move.intro drawn.intro", function() {
59401 var node2 = selectMenuItem(context, "split").node();
59402 if (!wasChanged && !node2) {
59403 return continueTo(rightClickIntersection);
59408 "intro.lines.split_intersection",
59409 { street: _t("intro.graph.name.washington-street") }
59411 { duration: 0, padding: 50 }
59414 context.history().on("change.intro", function(changed) {
59416 timeout2(function() {
59417 if (context.history().undoAnnotation() === _t("operations.split.annotation.line", { n: 1 })) {
59418 _washingtonSegmentID = changed.created()[0].id;
59419 continueTo(didSplit);
59421 _washingtonSegmentID = null;
59422 continueTo(retrySplit);
59426 function continueTo(nextStep) {
59427 context.map().on("move.intro drawn.intro", null);
59428 context.history().on("change.intro", null);
59432 function retrySplit() {
59433 context.enter(modeBrowse(context));
59434 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
59435 var advance = function() {
59436 continueTo(rightClickIntersection);
59438 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
59439 var box = pad(eleventhAvenueEnd, padding, context);
59442 helpHtml("intro.lines.retry_split"),
59443 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59445 context.map().on("move.intro drawn.intro", function() {
59446 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
59447 var box2 = pad(eleventhAvenueEnd, padding2, context);
59450 helpHtml("intro.lines.retry_split"),
59451 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59454 function continueTo(nextStep) {
59455 context.map().on("move.intro drawn.intro", null);
59459 function didSplit() {
59460 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59461 return continueTo(rightClickIntersection);
59463 var ids = context.selectedIDs();
59464 var string = "intro.lines.did_split_" + (ids.length > 1 ? "multi" : "single");
59465 var street = _t("intro.graph.name.washington-street");
59466 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59467 var box = pad(twelfthAvenue, padding, context);
59468 box.width = box.width / 2;
59471 helpHtml(string, { street1: street, street2: street }),
59474 timeout2(function() {
59475 context.map().centerZoomEase(twelfthAvenue, 18, 500);
59476 context.map().on("move.intro drawn.intro", function() {
59477 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59478 var box2 = pad(twelfthAvenue, padding2, context);
59479 box2.width = box2.width / 2;
59482 helpHtml(string, { street1: street, street2: street }),
59487 context.on("enter.intro", function() {
59488 var ids2 = context.selectedIDs();
59489 if (ids2.length === 1 && ids2[0] === _washingtonSegmentID) {
59490 continueTo(multiSelect);
59493 context.history().on("change.intro", function() {
59494 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59495 return continueTo(rightClickIntersection);
59498 function continueTo(nextStep) {
59499 context.map().on("move.intro drawn.intro", null);
59500 context.on("enter.intro", null);
59501 context.history().on("change.intro", null);
59505 function multiSelect() {
59506 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59507 return continueTo(rightClickIntersection);
59509 var ids = context.selectedIDs();
59510 var hasWashington = ids.indexOf(_washingtonSegmentID) !== -1;
59511 var hasTwelfth = ids.indexOf(twelfthAvenueID) !== -1;
59512 if (hasWashington && hasTwelfth) {
59513 return continueTo(multiRightClick);
59514 } else if (!hasWashington && !hasTwelfth) {
59515 return continueTo(didSplit);
59517 context.map().centerZoomEase(twelfthAvenue, 18, 500);
59518 timeout2(function() {
59519 var selected, other, padding, box;
59520 if (hasWashington) {
59521 selected = _t("intro.graph.name.washington-street");
59522 other = _t("intro.graph.name.12th-avenue");
59523 padding = 60 * Math.pow(2, context.map().zoom() - 18);
59524 box = pad(twelfthAvenueEnd, padding, context);
59527 selected = _t("intro.graph.name.12th-avenue");
59528 other = _t("intro.graph.name.washington-street");
59529 padding = 200 * Math.pow(2, context.map().zoom() - 18);
59530 box = pad(twelfthAvenue, padding, context);
59536 "intro.lines.multi_select",
59537 { selected, other1: other }
59538 ) + " " + helpHtml(
59539 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
59540 { selected, other2: other }
59543 context.map().on("move.intro drawn.intro", function() {
59544 if (hasWashington) {
59545 selected = _t("intro.graph.name.washington-street");
59546 other = _t("intro.graph.name.12th-avenue");
59547 padding = 60 * Math.pow(2, context.map().zoom() - 18);
59548 box = pad(twelfthAvenueEnd, padding, context);
59551 selected = _t("intro.graph.name.12th-avenue");
59552 other = _t("intro.graph.name.washington-street");
59553 padding = 200 * Math.pow(2, context.map().zoom() - 18);
59554 box = pad(twelfthAvenue, padding, context);
59560 "intro.lines.multi_select",
59561 { selected, other1: other }
59562 ) + " " + helpHtml(
59563 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
59564 { selected, other2: other }
59569 context.on("enter.intro", function() {
59570 continueTo(multiSelect);
59572 context.history().on("change.intro", function() {
59573 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59574 return continueTo(rightClickIntersection);
59578 function continueTo(nextStep) {
59579 context.map().on("move.intro drawn.intro", null);
59580 context.on("enter.intro", null);
59581 context.history().on("change.intro", null);
59585 function multiRightClick() {
59586 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59587 return continueTo(rightClickIntersection);
59589 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59590 var box = pad(twelfthAvenue, padding, context);
59591 var rightClickString = helpHtml("intro.lines.multi_select_success") + helpHtml("intro.lines.multi_" + (context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch"));
59592 reveal(box, rightClickString);
59593 context.map().on("move.intro drawn.intro", function() {
59594 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59595 var box2 = pad(twelfthAvenue, padding2, context);
59596 reveal(box2, rightClickString, { duration: 0 });
59598 context.ui().editMenu().on("toggled.intro", function(open) {
59601 timeout2(function() {
59602 var ids = context.selectedIDs();
59603 if (ids.length === 2 && ids.indexOf(twelfthAvenueID) !== -1 && ids.indexOf(_washingtonSegmentID) !== -1) {
59604 var node = selectMenuItem(context, "delete").node();
59607 continueTo(multiDelete);
59608 } else if (ids.length === 1 && ids.indexOf(_washingtonSegmentID) !== -1) {
59609 return continueTo(multiSelect);
59611 return continueTo(didSplit);
59615 context.history().on("change.intro", function() {
59616 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59617 return continueTo(rightClickIntersection);
59620 function continueTo(nextStep) {
59621 context.map().on("move.intro drawn.intro", null);
59622 context.ui().editMenu().on("toggled.intro", null);
59623 context.history().on("change.intro", null);
59627 function multiDelete() {
59628 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59629 return continueTo(rightClickIntersection);
59631 var node = selectMenuItem(context, "delete").node();
59633 return continueTo(multiRightClick);
59636 helpHtml("intro.lines.multi_delete"),
59639 context.map().on("move.intro drawn.intro", function() {
59642 helpHtml("intro.lines.multi_delete"),
59643 { duration: 0, padding: 50 }
59646 context.on("exit.intro", function() {
59647 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
59648 return continueTo(multiSelect);
59651 context.history().on("change.intro", function() {
59652 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
59653 continueTo(retryDelete);
59658 function continueTo(nextStep) {
59659 context.map().on("move.intro drawn.intro", null);
59660 context.on("exit.intro", null);
59661 context.history().on("change.intro", null);
59665 function retryDelete() {
59666 context.enter(modeBrowse(context));
59667 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59668 var box = pad(twelfthAvenue, padding, context);
59669 reveal(box, helpHtml("intro.lines.retry_delete"), {
59670 buttonText: _t.html("intro.ok"),
59671 buttonCallback: function() {
59672 continueTo(multiSelect);
59675 function continueTo(nextStep) {
59680 dispatch14.call("done");
59683 helpHtml("intro.lines.play", { next: _t("intro.buildings.title") }),
59685 tooltipBox: ".intro-nav-wrap .chapter-building",
59686 buttonText: _t.html("intro.ok"),
59687 buttonCallback: function() {
59688 reveal(".ideditor");
59693 chapter.enter = function() {
59696 chapter.exit = function() {
59697 timeouts.forEach(window.clearTimeout);
59698 select_default2(window).on("pointerdown.intro mousedown.intro", null, true);
59699 context.on("enter.intro exit.intro", null);
59700 context.map().on("move.intro drawn.intro", null);
59701 context.history().on("change.intro", null);
59702 context.container().select(".inspector-wrap").on("wheel.intro", null);
59703 context.container().select(".preset-list-button").on("click.intro", null);
59705 chapter.restart = function() {
59709 return utilRebind(chapter, dispatch14, "on");
59712 // modules/ui/intro/building.js
59713 function uiIntroBuilding(context, reveal) {
59714 var dispatch14 = dispatch_default("done");
59715 var house = [-85.62815, 41.95638];
59716 var tank = [-85.62732, 41.95347];
59717 var buildingCatetory = _mainPresetIndex.item("category-building");
59718 var housePreset = _mainPresetIndex.item("building/house");
59719 var tankPreset = _mainPresetIndex.item("man_made/storage_tank");
59721 var _houseID = null;
59722 var _tankID = null;
59724 title: "intro.buildings.title"
59726 function timeout2(f3, t2) {
59727 timeouts.push(window.setTimeout(f3, t2));
59729 function eventCancel(d3_event) {
59730 d3_event.stopPropagation();
59731 d3_event.preventDefault();
59733 function revealHouse(center, text2, options2) {
59734 var padding = 160 * Math.pow(2, context.map().zoom() - 20);
59735 var box = pad(center, padding, context);
59736 reveal(box, text2, options2);
59738 function revealTank(center, text2, options2) {
59739 var padding = 190 * Math.pow(2, context.map().zoom() - 19.5);
59740 var box = pad(center, padding, context);
59741 reveal(box, text2, options2);
59743 function addHouse() {
59744 context.enter(modeBrowse(context));
59745 context.history().reset("initial");
59747 var msec = transitionTime(house, context.map().center());
59749 reveal(null, null, { duration: 0 });
59751 context.map().centerZoomEase(house, 19, msec);
59752 timeout2(function() {
59753 var tooltip = reveal(
59755 helpHtml("intro.buildings.add_building")
59757 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-buildings");
59758 context.on("enter.intro", function(mode) {
59759 if (mode.id !== "add-area")
59761 continueTo(startHouse);
59764 function continueTo(nextStep) {
59765 context.on("enter.intro", null);
59769 function startHouse() {
59770 if (context.mode().id !== "add-area") {
59771 return continueTo(addHouse);
59774 context.map().zoomEase(20, 500);
59775 timeout2(function() {
59776 var startString = helpHtml("intro.buildings.start_building") + helpHtml("intro.buildings.building_corner_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
59777 revealHouse(house, startString);
59778 context.map().on("move.intro drawn.intro", function() {
59779 revealHouse(house, startString, { duration: 0 });
59781 context.on("enter.intro", function(mode) {
59782 if (mode.id !== "draw-area")
59783 return chapter.restart();
59784 continueTo(continueHouse);
59787 function continueTo(nextStep) {
59788 context.map().on("move.intro drawn.intro", null);
59789 context.on("enter.intro", null);
59793 function continueHouse() {
59794 if (context.mode().id !== "draw-area") {
59795 return continueTo(addHouse);
59798 var continueString = helpHtml("intro.buildings.continue_building") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_building");
59799 revealHouse(house, continueString);
59800 context.map().on("move.intro drawn.intro", function() {
59801 revealHouse(house, continueString, { duration: 0 });
59803 context.on("enter.intro", function(mode) {
59804 if (mode.id === "draw-area") {
59806 } else if (mode.id === "select") {
59807 var graph = context.graph();
59808 var way = context.entity(context.selectedIDs()[0]);
59809 var nodes = graph.childNodes(way);
59810 var points = utilArrayUniq(nodes).map(function(n3) {
59811 return context.projection(n3.loc);
59813 if (isMostlySquare(points)) {
59815 return continueTo(chooseCategoryBuilding);
59817 return continueTo(retryHouse);
59820 return chapter.restart();
59823 function continueTo(nextStep) {
59824 context.map().on("move.intro drawn.intro", null);
59825 context.on("enter.intro", null);
59829 function retryHouse() {
59830 var onClick = function() {
59831 continueTo(addHouse);
59835 helpHtml("intro.buildings.retry_building"),
59836 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
59838 context.map().on("move.intro drawn.intro", function() {
59841 helpHtml("intro.buildings.retry_building"),
59842 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
59845 function continueTo(nextStep) {
59846 context.map().on("move.intro drawn.intro", null);
59850 function chooseCategoryBuilding() {
59851 if (!_houseID || !context.hasEntity(_houseID)) {
59854 var ids = context.selectedIDs();
59855 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59856 context.enter(modeSelect(context, [_houseID]));
59858 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59859 timeout2(function() {
59860 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
59861 var button = context.container().select(".preset-category-building .preset-list-button");
59864 helpHtml("intro.buildings.choose_category_building", { category: buildingCatetory.name() })
59866 button.on("click.intro", function() {
59867 button.on("click.intro", null);
59868 continueTo(choosePresetHouse);
59871 context.on("enter.intro", function(mode) {
59872 if (!_houseID || !context.hasEntity(_houseID)) {
59873 return continueTo(addHouse);
59875 var ids2 = context.selectedIDs();
59876 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
59877 return continueTo(chooseCategoryBuilding);
59880 function continueTo(nextStep) {
59881 context.container().select(".inspector-wrap").on("wheel.intro", null);
59882 context.container().select(".preset-list-button").on("click.intro", null);
59883 context.on("enter.intro", null);
59887 function choosePresetHouse() {
59888 if (!_houseID || !context.hasEntity(_houseID)) {
59891 var ids = context.selectedIDs();
59892 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59893 context.enter(modeSelect(context, [_houseID]));
59895 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59896 timeout2(function() {
59897 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
59898 var button = context.container().select(".preset-building-house .preset-list-button");
59901 helpHtml("intro.buildings.choose_preset_house", { preset: housePreset.name() }),
59904 button.on("click.intro", function() {
59905 button.on("click.intro", null);
59906 continueTo(closeEditorHouse);
59909 context.on("enter.intro", function(mode) {
59910 if (!_houseID || !context.hasEntity(_houseID)) {
59911 return continueTo(addHouse);
59913 var ids2 = context.selectedIDs();
59914 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
59915 return continueTo(chooseCategoryBuilding);
59918 function continueTo(nextStep) {
59919 context.container().select(".inspector-wrap").on("wheel.intro", null);
59920 context.container().select(".preset-list-button").on("click.intro", null);
59921 context.on("enter.intro", null);
59925 function closeEditorHouse() {
59926 if (!_houseID || !context.hasEntity(_houseID)) {
59929 var ids = context.selectedIDs();
59930 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59931 context.enter(modeSelect(context, [_houseID]));
59933 context.history().checkpoint("hasHouse");
59934 context.on("exit.intro", function() {
59935 continueTo(rightClickHouse);
59937 timeout2(function() {
59939 ".entity-editor-pane",
59940 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
59943 function continueTo(nextStep) {
59944 context.on("exit.intro", null);
59948 function rightClickHouse() {
59950 return chapter.restart();
59951 context.enter(modeBrowse(context));
59952 context.history().reset("hasHouse");
59953 var zoom = context.map().zoom();
59957 context.map().centerZoomEase(house, zoom, 500);
59958 context.on("enter.intro", function(mode) {
59959 if (mode.id !== "select")
59961 var ids = context.selectedIDs();
59962 if (ids.length !== 1 || ids[0] !== _houseID)
59964 timeout2(function() {
59965 var node = selectMenuItem(context, "orthogonalize").node();
59968 continueTo(clickSquare);
59971 context.map().on("move.intro drawn.intro", function() {
59972 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_building" : "edit_menu_building_touch"));
59973 revealHouse(house, rightclickString, { duration: 0 });
59975 context.history().on("change.intro", function() {
59976 continueTo(rightClickHouse);
59978 function continueTo(nextStep) {
59979 context.on("enter.intro", null);
59980 context.map().on("move.intro drawn.intro", null);
59981 context.history().on("change.intro", null);
59985 function clickSquare() {
59987 return chapter.restart();
59988 var entity = context.hasEntity(_houseID);
59990 return continueTo(rightClickHouse);
59991 var node = selectMenuItem(context, "orthogonalize").node();
59993 return continueTo(rightClickHouse);
59995 var wasChanged = false;
59998 helpHtml("intro.buildings.square_building"),
60001 context.on("enter.intro", function(mode) {
60002 if (mode.id === "browse") {
60003 continueTo(rightClickHouse);
60004 } else if (mode.id === "move" || mode.id === "rotate") {
60005 continueTo(retryClickSquare);
60008 context.map().on("move.intro", function() {
60009 var node2 = selectMenuItem(context, "orthogonalize").node();
60010 if (!wasChanged && !node2) {
60011 return continueTo(rightClickHouse);
60015 helpHtml("intro.buildings.square_building"),
60016 { duration: 0, padding: 50 }
60019 context.history().on("change.intro", function() {
60021 context.history().on("change.intro", null);
60022 timeout2(function() {
60023 if (context.history().undoAnnotation() === _t("operations.orthogonalize.annotation.feature", { n: 1 })) {
60024 continueTo(doneSquare);
60026 continueTo(retryClickSquare);
60030 function continueTo(nextStep) {
60031 context.on("enter.intro", null);
60032 context.map().on("move.intro", null);
60033 context.history().on("change.intro", null);
60037 function retryClickSquare() {
60038 context.enter(modeBrowse(context));
60039 revealHouse(house, helpHtml("intro.buildings.retry_square"), {
60040 buttonText: _t.html("intro.ok"),
60041 buttonCallback: function() {
60042 continueTo(rightClickHouse);
60045 function continueTo(nextStep) {
60049 function doneSquare() {
60050 context.history().checkpoint("doneSquare");
60051 revealHouse(house, helpHtml("intro.buildings.done_square"), {
60052 buttonText: _t.html("intro.ok"),
60053 buttonCallback: function() {
60054 continueTo(addTank);
60057 function continueTo(nextStep) {
60061 function addTank() {
60062 context.enter(modeBrowse(context));
60063 context.history().reset("doneSquare");
60065 var msec = transitionTime(tank, context.map().center());
60067 reveal(null, null, { duration: 0 });
60069 context.map().centerZoomEase(tank, 19.5, msec);
60070 timeout2(function() {
60073 helpHtml("intro.buildings.add_tank")
60075 context.on("enter.intro", function(mode) {
60076 if (mode.id !== "add-area")
60078 continueTo(startTank);
60081 function continueTo(nextStep) {
60082 context.on("enter.intro", null);
60086 function startTank() {
60087 if (context.mode().id !== "add-area") {
60088 return continueTo(addTank);
60091 timeout2(function() {
60092 var startString = helpHtml("intro.buildings.start_tank") + helpHtml("intro.buildings.tank_edge_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
60093 revealTank(tank, startString);
60094 context.map().on("move.intro drawn.intro", function() {
60095 revealTank(tank, startString, { duration: 0 });
60097 context.on("enter.intro", function(mode) {
60098 if (mode.id !== "draw-area")
60099 return chapter.restart();
60100 continueTo(continueTank);
60103 function continueTo(nextStep) {
60104 context.map().on("move.intro drawn.intro", null);
60105 context.on("enter.intro", null);
60109 function continueTank() {
60110 if (context.mode().id !== "draw-area") {
60111 return continueTo(addTank);
60114 var continueString = helpHtml("intro.buildings.continue_tank") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_tank");
60115 revealTank(tank, continueString);
60116 context.map().on("move.intro drawn.intro", function() {
60117 revealTank(tank, continueString, { duration: 0 });
60119 context.on("enter.intro", function(mode) {
60120 if (mode.id === "draw-area") {
60122 } else if (mode.id === "select") {
60123 _tankID = context.selectedIDs()[0];
60124 return continueTo(searchPresetTank);
60126 return continueTo(addTank);
60129 function continueTo(nextStep) {
60130 context.map().on("move.intro drawn.intro", null);
60131 context.on("enter.intro", null);
60135 function searchPresetTank() {
60136 if (!_tankID || !context.hasEntity(_tankID)) {
60139 var ids = context.selectedIDs();
60140 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
60141 context.enter(modeSelect(context, [_tankID]));
60143 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
60144 timeout2(function() {
60145 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
60146 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
60148 ".preset-search-input",
60149 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
60152 context.on("enter.intro", function(mode) {
60153 if (!_tankID || !context.hasEntity(_tankID)) {
60154 return continueTo(addTank);
60156 var ids2 = context.selectedIDs();
60157 if (mode.id !== "select" || !ids2.length || ids2[0] !== _tankID) {
60158 context.enter(modeSelect(context, [_tankID]));
60159 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
60160 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
60161 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
60163 ".preset-search-input",
60164 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
60166 context.history().on("change.intro", null);
60169 function checkPresetSearch() {
60170 var first = context.container().select(".preset-list-item:first-child");
60171 if (first.classed("preset-man_made-storage_tank")) {
60173 first.select(".preset-list-button").node(),
60174 helpHtml("intro.buildings.choose_tank", { preset: tankPreset.name() }),
60177 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
60178 context.history().on("change.intro", function() {
60179 continueTo(closeEditorTank);
60183 function continueTo(nextStep) {
60184 context.container().select(".inspector-wrap").on("wheel.intro", null);
60185 context.on("enter.intro", null);
60186 context.history().on("change.intro", null);
60187 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
60191 function closeEditorTank() {
60192 if (!_tankID || !context.hasEntity(_tankID)) {
60195 var ids = context.selectedIDs();
60196 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
60197 context.enter(modeSelect(context, [_tankID]));
60199 context.history().checkpoint("hasTank");
60200 context.on("exit.intro", function() {
60201 continueTo(rightClickTank);
60203 timeout2(function() {
60205 ".entity-editor-pane",
60206 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
60209 function continueTo(nextStep) {
60210 context.on("exit.intro", null);
60214 function rightClickTank() {
60216 return continueTo(addTank);
60217 context.enter(modeBrowse(context));
60218 context.history().reset("hasTank");
60219 context.map().centerEase(tank, 500);
60220 timeout2(function() {
60221 context.on("enter.intro", function(mode) {
60222 if (mode.id !== "select")
60224 var ids = context.selectedIDs();
60225 if (ids.length !== 1 || ids[0] !== _tankID)
60227 timeout2(function() {
60228 var node = selectMenuItem(context, "circularize").node();
60231 continueTo(clickCircle);
60234 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_tank" : "edit_menu_tank_touch"));
60235 revealTank(tank, rightclickString);
60236 context.map().on("move.intro drawn.intro", function() {
60237 revealTank(tank, rightclickString, { duration: 0 });
60239 context.history().on("change.intro", function() {
60240 continueTo(rightClickTank);
60243 function continueTo(nextStep) {
60244 context.on("enter.intro", null);
60245 context.map().on("move.intro drawn.intro", null);
60246 context.history().on("change.intro", null);
60250 function clickCircle() {
60252 return chapter.restart();
60253 var entity = context.hasEntity(_tankID);
60255 return continueTo(rightClickTank);
60256 var node = selectMenuItem(context, "circularize").node();
60258 return continueTo(rightClickTank);
60260 var wasChanged = false;
60263 helpHtml("intro.buildings.circle_tank"),
60266 context.on("enter.intro", function(mode) {
60267 if (mode.id === "browse") {
60268 continueTo(rightClickTank);
60269 } else if (mode.id === "move" || mode.id === "rotate") {
60270 continueTo(retryClickCircle);
60273 context.map().on("move.intro", function() {
60274 var node2 = selectMenuItem(context, "circularize").node();
60275 if (!wasChanged && !node2) {
60276 return continueTo(rightClickTank);
60280 helpHtml("intro.buildings.circle_tank"),
60281 { duration: 0, padding: 50 }
60284 context.history().on("change.intro", function() {
60286 context.history().on("change.intro", null);
60287 timeout2(function() {
60288 if (context.history().undoAnnotation() === _t("operations.circularize.annotation.feature", { n: 1 })) {
60291 continueTo(retryClickCircle);
60295 function continueTo(nextStep) {
60296 context.on("enter.intro", null);
60297 context.map().on("move.intro", null);
60298 context.history().on("change.intro", null);
60302 function retryClickCircle() {
60303 context.enter(modeBrowse(context));
60304 revealTank(tank, helpHtml("intro.buildings.retry_circle"), {
60305 buttonText: _t.html("intro.ok"),
60306 buttonCallback: function() {
60307 continueTo(rightClickTank);
60310 function continueTo(nextStep) {
60315 dispatch14.call("done");
60318 helpHtml("intro.buildings.play", { next: _t("intro.startediting.title") }),
60320 tooltipBox: ".intro-nav-wrap .chapter-startEditing",
60321 buttonText: _t.html("intro.ok"),
60322 buttonCallback: function() {
60323 reveal(".ideditor");
60328 chapter.enter = function() {
60331 chapter.exit = function() {
60332 timeouts.forEach(window.clearTimeout);
60333 context.on("enter.intro exit.intro", null);
60334 context.map().on("move.intro drawn.intro", null);
60335 context.history().on("change.intro", null);
60336 context.container().select(".inspector-wrap").on("wheel.intro", null);
60337 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
60338 context.container().select(".more-fields .combobox-input").on("click.intro", null);
60340 chapter.restart = function() {
60344 return utilRebind(chapter, dispatch14, "on");
60347 // modules/ui/intro/start_editing.js
60348 function uiIntroStartEditing(context, reveal) {
60349 var dispatch14 = dispatch_default("done", "startEditing");
60350 var modalSelection = select_default2(null);
60352 title: "intro.startediting.title"
60354 function showHelp() {
60356 ".map-control.help-control",
60357 helpHtml("intro.startediting.help"),
60359 buttonText: _t.html("intro.ok"),
60360 buttonCallback: function() {
60366 function shortcuts() {
60368 ".map-control.help-control",
60369 helpHtml("intro.startediting.shortcuts"),
60371 buttonText: _t.html("intro.ok"),
60372 buttonCallback: function() {
60378 function showSave() {
60379 context.container().selectAll(".shaded").remove();
60381 ".top-toolbar button.save",
60382 helpHtml("intro.startediting.save"),
60384 buttonText: _t.html("intro.ok"),
60385 buttonCallback: function() {
60391 function showStart() {
60392 context.container().selectAll(".shaded").remove();
60393 modalSelection = uiModal(context.container());
60394 modalSelection.select(".modal").attr("class", "modal-splash modal");
60395 modalSelection.selectAll(".close").remove();
60396 var startbutton = modalSelection.select(".content").attr("class", "fillL").append("button").attr("class", "modal-section huge-modal-button").on("click", function() {
60397 modalSelection.remove();
60399 startbutton.append("svg").attr("class", "illustration").append("use").attr("xlink:href", "#iD-logo-walkthrough");
60400 startbutton.append("h2").call(_t.append("intro.startediting.start"));
60401 dispatch14.call("startEditing");
60403 chapter.enter = function() {
60406 chapter.exit = function() {
60407 modalSelection.remove();
60408 context.container().selectAll(".shaded").remove();
60410 return utilRebind(chapter, dispatch14, "on");
60413 // modules/ui/intro/intro.js
60415 welcome: uiIntroWelcome,
60416 navigation: uiIntroNavigation,
60417 point: uiIntroPoint,
60420 building: uiIntroBuilding,
60421 startEditing: uiIntroStartEditing
60423 var chapterFlow = [
60432 function uiIntro(context) {
60433 const INTRO_IMAGERY = "EsriWorldImageryClarity";
60434 let _introGraph = {};
60436 function intro(selection2) {
60437 _mainFileFetcher.get("intro_graph").then((dataIntroGraph) => {
60438 for (let id2 in dataIntroGraph) {
60439 if (!_introGraph[id2]) {
60440 _introGraph[id2] = osmEntity(localize(dataIntroGraph[id2]));
60443 selection2.call(startIntro);
60444 }).catch(function() {
60447 function startIntro(selection2) {
60448 context.enter(modeBrowse(context));
60449 let osm = context.connection();
60450 let history = context.history().toJSON();
60451 let hash = window.location.hash;
60452 let center = context.map().center();
60453 let zoom = context.map().zoom();
60454 let background = context.background().baseLayerSource();
60455 let overlays = context.background().overlayLayerSources();
60456 let opacity = context.container().selectAll(".main-map .layer-background").style("opacity");
60457 let caches = osm && osm.caches();
60458 let baseEntities = context.history().graph().base().entities;
60459 context.ui().sidebar.expand();
60460 context.container().selectAll("button.sidebar-toggle").classed("disabled", true);
60461 context.inIntro(true);
60463 osm.toggle(false).reset();
60465 context.history().reset();
60466 context.history().merge(Object.values(coreGraph().load(_introGraph).entities));
60467 context.history().checkpoint("initial");
60468 let imagery = context.background().findSource(INTRO_IMAGERY);
60470 context.background().baseLayerSource(imagery);
60472 context.background().bing();
60474 overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
60475 let layers = context.layers();
60476 layers.all().forEach((item) => {
60477 if (typeof item.layer.enabled === "function") {
60478 item.layer.enabled(item.id === "osm");
60481 context.container().selectAll(".main-map .layer-background").style("opacity", 1);
60482 let curtain = uiCurtain(context.container().node());
60483 selection2.call(curtain);
60484 corePreferences("walkthrough_started", "yes");
60485 let storedProgress = corePreferences("walkthrough_progress") || "";
60486 let progress = storedProgress.split(";").filter(Boolean);
60487 let chapters = chapterFlow.map((chapter, i3) => {
60488 let s2 = chapterUi[chapter](context, curtain.reveal).on("done", () => {
60489 buttons.filter((d2) => d2.title === s2.title).classed("finished", true);
60490 if (i3 < chapterFlow.length - 1) {
60491 const next = chapterFlow[i3 + 1];
60492 context.container().select(`button.chapter-${next}`).classed("next", true);
60494 progress.push(chapter);
60495 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
60499 chapters[chapters.length - 1].on("startEditing", () => {
60500 progress.push("startEditing");
60501 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
60502 let incomplete = utilArrayDifference(chapterFlow, progress);
60503 if (!incomplete.length) {
60504 corePreferences("walkthrough_completed", "yes");
60508 context.container().selectAll(".main-map .layer-background").style("opacity", opacity);
60509 context.container().selectAll("button.sidebar-toggle").classed("disabled", false);
60511 osm.toggle(true).reset().caches(caches);
60513 context.history().reset().merge(Object.values(baseEntities));
60514 context.background().baseLayerSource(background);
60515 overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
60517 context.history().fromJSON(history, false);
60519 context.map().centerZoom(center, zoom);
60520 window.location.replace(hash);
60521 context.inIntro(false);
60523 let navwrap = selection2.append("div").attr("class", "intro-nav-wrap fillD");
60524 navwrap.append("svg").attr("class", "intro-nav-wrap-logo").append("use").attr("xlink:href", "#iD-logo-walkthrough");
60525 let buttonwrap = navwrap.append("div").attr("class", "joined").selectAll("button.chapter");
60526 let buttons = buttonwrap.data(chapters).enter().append("button").attr("class", (d2, i3) => `chapter chapter-${chapterFlow[i3]}`).on("click", enterChapter);
60527 buttons.append("span").html((d2) => _t.html(d2.title));
60528 buttons.append("span").attr("class", "status").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
60529 enterChapter(null, chapters[0]);
60530 function enterChapter(d3_event, newChapter) {
60531 if (_currChapter) {
60532 _currChapter.exit();
60534 context.enter(modeBrowse(context));
60535 _currChapter = newChapter;
60536 _currChapter.enter();
60537 buttons.classed("next", false).classed("active", (d2) => d2.title === _currChapter.title);
60543 // modules/ui/issues_info.js
60544 function uiIssuesInfo(context) {
60545 var warningsItem = {
60548 iconID: "iD-icon-alert",
60549 descriptionID: "issues.warnings_and_errors"
60551 var resolvedItem = {
60554 iconID: "iD-icon-apply",
60555 descriptionID: "issues.user_resolved_issues"
60557 function update(selection2) {
60558 var shownItems = [];
60559 var liveIssues = context.validator().getIssues({
60560 what: corePreferences("validate-what") || "edited",
60561 where: corePreferences("validate-where") || "all"
60563 if (liveIssues.length) {
60564 warningsItem.count = liveIssues.length;
60565 shownItems.push(warningsItem);
60567 if (corePreferences("validate-what") === "all") {
60568 var resolvedIssues = context.validator().getResolvedIssues();
60569 if (resolvedIssues.length) {
60570 resolvedItem.count = resolvedIssues.length;
60571 shownItems.push(resolvedItem);
60574 var chips = selection2.selectAll(".chip").data(shownItems, function(d2) {
60577 chips.exit().remove();
60578 var enter = chips.enter().append("a").attr("class", function(d2) {
60579 return "chip " + d2.id + "-count";
60580 }).attr("href", "#").each(function(d2) {
60581 var chipSelection = select_default2(this);
60582 var tooltipBehavior = uiTooltip().placement("top").title(() => _t.append(d2.descriptionID));
60583 chipSelection.call(tooltipBehavior).on("click", function(d3_event) {
60584 d3_event.preventDefault();
60585 tooltipBehavior.hide(select_default2(this));
60586 context.ui().togglePanes(context.container().select(".map-panes .issues-pane"));
60588 chipSelection.call(svgIcon("#" + d2.iconID));
60590 enter.append("span").attr("class", "count");
60591 enter.merge(chips).selectAll("span.count").text(function(d2) {
60592 return d2.count.toString();
60595 return function(selection2) {
60596 update(selection2);
60597 context.validator().on("validated.infobox", function() {
60598 update(selection2);
60603 // modules/ui/map_in_map.js
60604 function uiMapInMap(context) {
60605 function mapInMap(selection2) {
60606 var backgroundLayer = rendererTileLayer(context);
60607 var overlayLayers = {};
60608 var projection2 = geoRawMercator();
60609 var dataLayer = svgData(projection2, context).showLabels(false);
60610 var debugLayer = svgDebug(projection2, context);
60611 var zoom = zoom_default2().scaleExtent([geoZoomToScale(0.5), geoZoomToScale(24)]).on("start", zoomStarted).on("zoom", zoomed).on("end", zoomEnded);
60612 var wrap2 = select_default2(null);
60613 var tiles = select_default2(null);
60614 var viewport = select_default2(null);
60615 var _isTransformed = false;
60616 var _isHidden = true;
60617 var _skipEvents = false;
60618 var _gesture = null;
60625 function zoomStarted() {
60628 _tStart = _tCurr = projection2.transform();
60631 function zoomed(d3_event) {
60634 var x2 = d3_event.transform.x;
60635 var y2 = d3_event.transform.y;
60636 var k2 = d3_event.transform.k;
60637 var isZooming = k2 !== _tStart.k;
60638 var isPanning = x2 !== _tStart.x || y2 !== _tStart.y;
60639 if (!isZooming && !isPanning) {
60643 _gesture = isZooming ? "zoom" : "pan";
60645 var tMini = projection2.transform();
60647 if (_gesture === "zoom") {
60648 scale = k2 / tMini.k;
60649 tX = (_cMini[0] / scale - _cMini[0]) * scale;
60650 tY = (_cMini[1] / scale - _cMini[1]) * scale;
60657 utilSetTransform(tiles, tX, tY, scale);
60658 utilSetTransform(viewport, 0, 0, scale);
60659 _isTransformed = true;
60660 _tCurr = identity2.translate(x2, y2).scale(k2);
60661 var zMain = geoScaleToZoom(context.projection.scale());
60662 var zMini = geoScaleToZoom(k2);
60663 _zDiff = zMain - zMini;
60666 function zoomEnded() {
60669 if (_gesture !== "pan")
60671 updateProjection();
60673 context.map().center(projection2.invert(_cMini));
60675 function updateProjection() {
60676 var loc = context.map().center();
60677 var tMain = context.projection.transform();
60678 var zMain = geoScaleToZoom(tMain.k);
60679 var zMini = Math.max(zMain - _zDiff, 0.5);
60680 var kMini = geoZoomToScale(zMini);
60681 projection2.translate([tMain.x, tMain.y]).scale(kMini);
60682 var point2 = projection2(loc);
60683 var mouse = _gesture === "pan" ? geoVecSubtract([_tCurr.x, _tCurr.y], [_tStart.x, _tStart.y]) : [0, 0];
60684 var xMini = _cMini[0] - point2[0] + tMain.x + mouse[0];
60685 var yMini = _cMini[1] - point2[1] + tMain.y + mouse[1];
60686 projection2.translate([xMini, yMini]).clipExtent([[0, 0], _dMini]);
60687 _tCurr = projection2.transform();
60688 if (_isTransformed) {
60689 utilSetTransform(tiles, 0, 0);
60690 utilSetTransform(viewport, 0, 0);
60691 _isTransformed = false;
60693 zoom.scaleExtent([geoZoomToScale(0.5), geoZoomToScale(zMain - 3)]);
60694 _skipEvents = true;
60695 wrap2.call(zoom.transform, _tCurr);
60696 _skipEvents = false;
60698 function redraw() {
60699 clearTimeout(_timeoutID);
60702 updateProjection();
60703 var zMini = geoScaleToZoom(projection2.scale());
60704 tiles = wrap2.selectAll(".map-in-map-tiles").data([0]);
60705 tiles = tiles.enter().append("div").attr("class", "map-in-map-tiles").merge(tiles);
60706 backgroundLayer.source(context.background().baseLayerSource()).projection(projection2).dimensions(_dMini);
60707 var background = tiles.selectAll(".map-in-map-background").data([0]);
60708 background.enter().append("div").attr("class", "map-in-map-background").merge(background).call(backgroundLayer);
60709 var overlaySources = context.background().overlayLayerSources();
60710 var activeOverlayLayers = [];
60711 for (var i3 = 0; i3 < overlaySources.length; i3++) {
60712 if (overlaySources[i3].validZoom(zMini)) {
60713 if (!overlayLayers[i3])
60714 overlayLayers[i3] = rendererTileLayer(context);
60715 activeOverlayLayers.push(overlayLayers[i3].source(overlaySources[i3]).projection(projection2).dimensions(_dMini));
60718 var overlay = tiles.selectAll(".map-in-map-overlay").data([0]);
60719 overlay = overlay.enter().append("div").attr("class", "map-in-map-overlay").merge(overlay);
60720 var overlays = overlay.selectAll("div").data(activeOverlayLayers, function(d2) {
60721 return d2.source().name();
60723 overlays.exit().remove();
60724 overlays = overlays.enter().append("div").merge(overlays).each(function(layer) {
60725 select_default2(this).call(layer);
60727 var dataLayers = tiles.selectAll(".map-in-map-data").data([0]);
60728 dataLayers.exit().remove();
60729 dataLayers = dataLayers.enter().append("svg").attr("class", "map-in-map-data").merge(dataLayers).call(dataLayer).call(debugLayer);
60730 if (_gesture !== "pan") {
60731 var getPath = path_default(projection2);
60732 var bbox2 = { type: "Polygon", coordinates: [context.map().extent().polygon()] };
60733 viewport = wrap2.selectAll(".map-in-map-viewport").data([0]);
60734 viewport = viewport.enter().append("svg").attr("class", "map-in-map-viewport").merge(viewport);
60735 var path = viewport.selectAll(".map-in-map-bbox").data([bbox2]);
60736 path.enter().append("path").attr("class", "map-in-map-bbox").merge(path).attr("d", getPath).classed("thick", function(d2) {
60737 return getPath.area(d2) < 30;
60741 function queueRedraw() {
60742 clearTimeout(_timeoutID);
60743 _timeoutID = setTimeout(function() {
60747 function toggle(d3_event) {
60749 d3_event.preventDefault();
60750 _isHidden = !_isHidden;
60751 context.container().select(".minimap-toggle-item").classed("active", !_isHidden).select("input").property("checked", !_isHidden);
60753 wrap2.style("display", "block").style("opacity", "1").transition().duration(200).style("opacity", "0").on("end", function() {
60754 selection2.selectAll(".map-in-map").style("display", "none");
60757 wrap2.style("display", "block").style("opacity", "0").transition().duration(200).style("opacity", "1").on("end", function() {
60762 uiMapInMap.toggle = toggle;
60763 wrap2 = selection2.selectAll(".map-in-map").data([0]);
60764 wrap2 = wrap2.enter().append("div").attr("class", "map-in-map").style("display", _isHidden ? "none" : "block").call(zoom).on("dblclick.zoom", null).merge(wrap2);
60765 _dMini = [200, 150];
60766 _cMini = geoVecScale(_dMini, 0.5);
60767 context.map().on("drawn.map-in-map", function(drawn) {
60768 if (drawn.full === true) {
60773 context.keybinding().on(_t("background.minimap.key"), toggle);
60778 // modules/ui/notice.js
60779 function uiNotice(context) {
60780 return function(selection2) {
60781 var div = selection2.append("div").attr("class", "notice");
60782 var button = div.append("button").attr("class", "zoom-to notice fillD").on("click", function() {
60783 context.map().zoomEase(context.minEditableZoom());
60784 }).on("wheel", function(d3_event) {
60785 var e22 = new WheelEvent(d3_event.type, d3_event);
60786 context.surface().node().dispatchEvent(e22);
60788 button.call(svgIcon("#iD-icon-plus", "pre-text")).append("span").attr("class", "label").call(_t.append("zoom_in_edit"));
60789 function disableTooHigh() {
60790 var canEdit = context.map().zoom() >= context.minEditableZoom();
60791 div.style("display", canEdit ? "none" : "block");
60793 context.map().on("move.notice", debounce_default(disableTooHigh, 500));
60798 // modules/ui/photoviewer.js
60799 function uiPhotoviewer(context) {
60800 var dispatch14 = dispatch_default("resize");
60801 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
60802 function photoviewer(selection2) {
60803 selection2.append("button").attr("class", "thumb-hide").attr("title", _t("icons.close")).on("click", function() {
60804 if (services.streetside) {
60805 services.streetside.hideViewer(context);
60807 if (services.mapillary) {
60808 services.mapillary.hideViewer(context);
60810 if (services.kartaview) {
60811 services.kartaview.hideViewer(context);
60813 if (services.mapilio) {
60814 services.mapilio.hideViewer(context);
60816 if (services.vegbilder) {
60817 services.vegbilder.hideViewer(context);
60819 }).append("div").call(svgIcon("#iD-icon-close"));
60820 function preventDefault(d3_event) {
60821 d3_event.preventDefault();
60823 selection2.append("button").attr("class", "resize-handle-xy").on("touchstart touchdown touchend", preventDefault).on(
60824 _pointerPrefix + "down",
60825 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true, resizeOnY: true })
60827 selection2.append("button").attr("class", "resize-handle-x").on("touchstart touchdown touchend", preventDefault).on(
60828 _pointerPrefix + "down",
60829 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true })
60831 selection2.append("button").attr("class", "resize-handle-y").on("touchstart touchdown touchend", preventDefault).on(
60832 _pointerPrefix + "down",
60833 buildResizeListener(selection2, "resize", dispatch14, { resizeOnY: true })
60835 function buildResizeListener(target, eventName, dispatch15, options2) {
60836 var resizeOnX = !!options2.resizeOnX;
60837 var resizeOnY = !!options2.resizeOnY;
60838 var minHeight = options2.minHeight || 240;
60839 var minWidth = options2.minWidth || 320;
60845 function startResize(d3_event) {
60846 if (pointerId !== (d3_event.pointerId || "mouse"))
60848 d3_event.preventDefault();
60849 d3_event.stopPropagation();
60850 var mapSize = context.map().dimensions();
60852 var maxWidth = mapSize[0];
60853 var newWidth = clamp3(startWidth + d3_event.clientX - startX, minWidth, maxWidth);
60854 target.style("width", newWidth + "px");
60857 var maxHeight = mapSize[1] - 90;
60858 var newHeight = clamp3(startHeight + startY - d3_event.clientY, minHeight, maxHeight);
60859 target.style("height", newHeight + "px");
60861 dispatch15.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
60863 function clamp3(num, min3, max3) {
60864 return Math.max(min3, Math.min(num, max3));
60866 function stopResize(d3_event) {
60867 if (pointerId !== (d3_event.pointerId || "mouse"))
60869 d3_event.preventDefault();
60870 d3_event.stopPropagation();
60871 select_default2(window).on("." + eventName, null);
60873 return function initResize(d3_event) {
60874 d3_event.preventDefault();
60875 d3_event.stopPropagation();
60876 pointerId = d3_event.pointerId || "mouse";
60877 startX = d3_event.clientX;
60878 startY = d3_event.clientY;
60879 var targetRect = target.node().getBoundingClientRect();
60880 startWidth = targetRect.width;
60881 startHeight = targetRect.height;
60882 select_default2(window).on(_pointerPrefix + "move." + eventName, startResize, false).on(_pointerPrefix + "up." + eventName, stopResize, false);
60883 if (_pointerPrefix === "pointer") {
60884 select_default2(window).on("pointercancel." + eventName, stopResize, false);
60889 photoviewer.onMapResize = function() {
60890 var photoviewer2 = context.container().select(".photoviewer");
60891 var content = context.container().select(".main-content");
60892 var mapDimensions = utilGetDimensions(content, true);
60893 var photoDimensions = utilGetDimensions(photoviewer2, true);
60894 if (photoDimensions[0] > mapDimensions[0] || photoDimensions[1] > mapDimensions[1] - 90) {
60895 var setPhotoDimensions = [
60896 Math.min(photoDimensions[0], mapDimensions[0]),
60897 Math.min(photoDimensions[1], mapDimensions[1] - 90)
60899 photoviewer2.style("width", setPhotoDimensions[0] + "px").style("height", setPhotoDimensions[1] + "px");
60900 dispatch14.call("resize", photoviewer2, subtractPadding(setPhotoDimensions, photoviewer2));
60903 function subtractPadding(dimensions, selection2) {
60905 dimensions[0] - parseFloat(selection2.style("padding-left")) - parseFloat(selection2.style("padding-right")),
60906 dimensions[1] - parseFloat(selection2.style("padding-top")) - parseFloat(selection2.style("padding-bottom"))
60909 return utilRebind(photoviewer, dispatch14, "on");
60912 // modules/ui/restore.js
60913 function uiRestore(context) {
60914 return function(selection2) {
60915 if (!context.history().hasRestorableChanges())
60917 let modalSelection = uiModal(selection2, true);
60918 modalSelection.select(".modal").attr("class", "modal fillL");
60919 let introModal = modalSelection.select(".content");
60920 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("restore.heading"));
60921 introModal.append("div").attr("class", "modal-section").append("p").call(_t.append("restore.description"));
60922 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
60923 let restore = buttonWrap.append("button").attr("class", "restore").on("click", () => {
60924 context.history().restore();
60925 modalSelection.remove();
60927 restore.append("svg").attr("class", "logo logo-restore").append("use").attr("xlink:href", "#iD-logo-restore");
60928 restore.append("div").call(_t.append("restore.restore"));
60929 let reset = buttonWrap.append("button").attr("class", "reset").on("click", () => {
60930 context.history().clearSaved();
60931 modalSelection.remove();
60933 reset.append("svg").attr("class", "logo logo-reset").append("use").attr("xlink:href", "#iD-logo-reset");
60934 reset.append("div").call(_t.append("restore.reset"));
60935 restore.node().focus();
60939 // modules/ui/scale.js
60940 function uiScale(context) {
60941 var projection2 = context.projection, isImperial = !_mainLocalizer.usesMetric(), maxLength = 180, tickHeight = 8;
60942 function scaleDefs(loc1, loc2) {
60943 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;
60945 buckets = [528e4, 528e3, 52800, 5280, 500, 50, 5, 1];
60947 buckets = [5e6, 5e5, 5e4, 5e3, 500, 50, 5, 1];
60949 for (i3 = 0; i3 < buckets.length; i3++) {
60952 scale.dist = Math.floor(dist / val) * val;
60955 scale.dist = +dist.toFixed(2);
60958 dLon = geoMetersToLon(scale.dist / conversion, lat);
60959 scale.px = Math.round(projection2([loc1[0] + dLon, loc1[1]])[0]);
60960 scale.text = displayLength(scale.dist / conversion, isImperial);
60963 function update(selection2) {
60964 var dims = context.map().dimensions(), loc1 = projection2.invert([0, dims[1]]), loc2 = projection2.invert([maxLength, dims[1]]), scale = scaleDefs(loc1, loc2);
60965 selection2.select(".scale-path").attr("d", "M0.5,0.5v" + tickHeight + "h" + scale.px + "v-" + tickHeight);
60966 selection2.select(".scale-text").style(_mainLocalizer.textDirection() === "ltr" ? "left" : "right", scale.px + 16 + "px").text(scale.text);
60968 return function(selection2) {
60969 function switchUnits() {
60970 isImperial = !isImperial;
60971 selection2.call(update);
60973 var scalegroup = selection2.append("svg").attr("class", "scale").on("click", switchUnits).append("g").attr("transform", "translate(10,11)");
60974 scalegroup.append("path").attr("class", "scale-path");
60975 selection2.append("div").attr("class", "scale-text");
60976 selection2.call(update);
60977 context.map().on("move.scale", function() {
60978 update(selection2);
60983 // modules/ui/shortcuts.js
60984 function uiShortcuts(context) {
60985 var detected = utilDetect();
60986 var _activeTab = 0;
60987 var _modalSelection;
60988 var _selection = select_default2(null);
60989 var _dataShortcuts;
60990 function shortcutsModal(_modalSelection2) {
60991 _modalSelection2.select(".modal").classed("modal-shortcuts", true);
60992 var content = _modalSelection2.select(".content");
60993 content.append("div").attr("class", "modal-section header").append("h2").call(_t.append("shortcuts.title"));
60994 _mainFileFetcher.get("shortcuts").then(function(data) {
60995 _dataShortcuts = data;
60996 content.call(render);
60997 }).catch(function() {
61000 function render(selection2) {
61001 if (!_dataShortcuts)
61003 var wrapper = selection2.selectAll(".wrapper").data([0]);
61004 var wrapperEnter = wrapper.enter().append("div").attr("class", "wrapper modal-section");
61005 var tabsBar = wrapperEnter.append("div").attr("class", "tabs-bar");
61006 var shortcutsList = wrapperEnter.append("div").attr("class", "shortcuts-list");
61007 wrapper = wrapper.merge(wrapperEnter);
61008 var tabs = tabsBar.selectAll(".tab").data(_dataShortcuts);
61009 var tabsEnter = tabs.enter().append("a").attr("class", "tab").attr("href", "#").on("click", function(d3_event, d2) {
61010 d3_event.preventDefault();
61011 var i3 = _dataShortcuts.indexOf(d2);
61013 render(selection2);
61015 tabsEnter.append("span").html(function(d2) {
61016 return _t.html(d2.text);
61018 wrapper.selectAll(".tab").classed("active", function(d2, i3) {
61019 return i3 === _activeTab;
61021 var shortcuts = shortcutsList.selectAll(".shortcut-tab").data(_dataShortcuts);
61022 var shortcutsEnter = shortcuts.enter().append("div").attr("class", function(d2) {
61023 return "shortcut-tab shortcut-tab-" + d2.tab;
61025 var columnsEnter = shortcutsEnter.selectAll(".shortcut-column").data(function(d2) {
61027 }).enter().append("table").attr("class", "shortcut-column");
61028 var rowsEnter = columnsEnter.selectAll(".shortcut-row").data(function(d2) {
61030 }).enter().append("tr").attr("class", "shortcut-row");
61031 var sectionRows = rowsEnter.filter(function(d2) {
61032 return !d2.shortcuts;
61034 sectionRows.append("td");
61035 sectionRows.append("td").attr("class", "shortcut-section").append("h3").html(function(d2) {
61036 return _t.html(d2.text);
61038 var shortcutRows = rowsEnter.filter(function(d2) {
61039 return d2.shortcuts;
61041 var shortcutKeys = shortcutRows.append("td").attr("class", "shortcut-keys");
61042 var modifierKeys = shortcutKeys.filter(function(d2) {
61043 return d2.modifiers;
61045 modifierKeys.selectAll("kbd.modifier").data(function(d2) {
61046 if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
61048 } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
61051 return d2.modifiers;
61053 }).enter().each(function() {
61054 var selection3 = select_default2(this);
61055 selection3.append("kbd").attr("class", "modifier").text(function(d2) {
61056 return uiCmd.display(d2);
61058 selection3.append("span").text("+");
61060 shortcutKeys.selectAll("kbd.shortcut").data(function(d2) {
61061 var arr = d2.shortcuts;
61062 if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
61064 } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
61067 arr = arr.map(function(s2) {
61068 return uiCmd.display(s2.indexOf(".") !== -1 ? _t(s2) : s2);
61070 return utilArrayUniq(arr).map(function(s2) {
61073 separator: d2.separator,
61077 }).enter().each(function(d2, i3, nodes) {
61078 var selection3 = select_default2(this);
61079 var click = d2.shortcut.toLowerCase().match(/(.*).click/);
61080 if (click && click[1]) {
61081 selection3.call(svgIcon("#iD-walkthrough-mouse-" + click[1], "operation"));
61082 } else if (d2.shortcut.toLowerCase() === "long-press") {
61083 selection3.call(svgIcon("#iD-walkthrough-longpress", "longpress operation"));
61084 } else if (d2.shortcut.toLowerCase() === "tap") {
61085 selection3.call(svgIcon("#iD-walkthrough-tap", "tap operation"));
61087 selection3.append("kbd").attr("class", "shortcut").text(function(d4) {
61088 return d4.shortcut;
61091 if (i3 < nodes.length - 1) {
61092 selection3.append("span").html(d2.separator || "\xA0" + _t.html("shortcuts.or") + "\xA0");
61093 } else if (i3 === nodes.length - 1 && d2.suffix) {
61094 selection3.append("span").text(d2.suffix);
61097 shortcutKeys.filter(function(d2) {
61099 }).each(function() {
61100 var selection3 = select_default2(this);
61101 selection3.append("span").text("+");
61102 selection3.append("span").attr("class", "gesture").html(function(d2) {
61103 return _t.html(d2.gesture);
61106 shortcutRows.append("td").attr("class", "shortcut-desc").html(function(d2) {
61107 return d2.text ? _t.html(d2.text) : "\xA0";
61109 wrapper.selectAll(".shortcut-tab").style("display", function(d2, i3) {
61110 return i3 === _activeTab ? "flex" : "none";
61113 return function(selection2, show) {
61114 _selection = selection2;
61116 _modalSelection = uiModal(selection2);
61117 _modalSelection.call(shortcutsModal);
61119 context.keybinding().on([_t("shortcuts.toggle.key"), "?"], function() {
61120 if (context.container().selectAll(".modal-shortcuts").size()) {
61121 if (_modalSelection) {
61122 _modalSelection.close();
61123 _modalSelection = null;
61126 _modalSelection = uiModal(_selection);
61127 _modalSelection.call(shortcutsModal);
61134 // modules/ui/data_header.js
61135 function uiDataHeader() {
61137 function dataHeader(selection2) {
61138 var header = selection2.selectAll(".data-header").data(
61139 _datum ? [_datum] : [],
61141 return d2.__featurehash__;
61144 header.exit().remove();
61145 var headerEnter = header.enter().append("div").attr("class", "data-header");
61146 var iconEnter = headerEnter.append("div").attr("class", "data-header-icon");
61147 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-data", "note-fill"));
61148 headerEnter.append("div").attr("class", "data-header-label").call(_t.append("map_data.layers.custom.title"));
61150 dataHeader.datum = function(val) {
61151 if (!arguments.length)
61159 // modules/ui/combobox.js
61160 var _comboHideTimerID;
61161 function uiCombobox(context, klass) {
61162 var dispatch14 = dispatch_default("accept", "cancel", "update");
61163 var container = context.container();
61164 var _suggestions = [];
61167 var _selected = null;
61168 var _canAutocomplete = true;
61169 var _caseSensitive = false;
61170 var _cancelFetch = false;
61173 var _mouseEnterHandler, _mouseLeaveHandler;
61174 var _fetcher = function(val, cb) {
61175 cb(_data.filter(function(d2) {
61176 var terms = d2.terms || [];
61177 terms.push(d2.value);
61179 terms.push(d2.key);
61181 return terms.some(function(term) {
61182 return term.toString().toLowerCase().indexOf(val.toLowerCase()) !== -1;
61186 var combobox = function(input, attachTo) {
61187 if (!input || input.empty())
61189 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() {
61190 var parent = this.parentNode;
61191 var sibling = this.nextSibling;
61192 select_default2(parent).selectAll(".combobox-caret").filter(function(d2) {
61193 return d2 === input.node();
61194 }).data([input.node()]).enter().insert("div", function() {
61196 }).attr("class", "combobox-caret").on("mousedown.combo-caret", function(d3_event) {
61197 d3_event.preventDefault();
61198 input.node().focus();
61199 mousedown(d3_event);
61200 }).on("mouseup.combo-caret", function(d3_event) {
61201 d3_event.preventDefault();
61205 function mousedown(d3_event) {
61206 if (d3_event.button !== 0)
61208 if (input.classed("disabled"))
61210 _tDown = +/* @__PURE__ */ new Date();
61211 var start2 = input.property("selectionStart");
61212 var end = input.property("selectionEnd");
61213 if (start2 !== end) {
61214 var val = utilGetSetValue(input);
61215 input.node().setSelectionRange(val.length, val.length);
61218 input.on("mouseup.combo-input", mouseup);
61220 function mouseup(d3_event) {
61221 input.on("mouseup.combo-input", null);
61222 if (d3_event.button !== 0)
61224 if (input.classed("disabled"))
61226 if (input.node() !== document.activeElement)
61228 var start2 = input.property("selectionStart");
61229 var end = input.property("selectionEnd");
61230 if (start2 !== end)
61232 var combo = container.selectAll(".combobox");
61233 if (combo.empty() || combo.datum() !== input.node()) {
61234 var tOrig = _tDown;
61235 window.setTimeout(function() {
61236 if (tOrig !== _tDown)
61238 fetchComboData("", function() {
61248 fetchComboData("");
61251 _comboHideTimerID = window.setTimeout(hide, 75);
61255 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) {
61256 d3_event.preventDefault();
61258 container.on("scroll.combo-scroll", render, true);
61261 if (_comboHideTimerID) {
61262 window.clearTimeout(_comboHideTimerID);
61263 _comboHideTimerID = void 0;
61265 container.selectAll(".combobox").remove();
61266 container.on("scroll.combo-scroll", null);
61268 function keydown(d3_event) {
61269 var shown = !container.selectAll(".combobox").empty();
61270 var tagName = input.node() ? input.node().tagName.toLowerCase() : "";
61271 switch (d3_event.keyCode) {
61274 d3_event.stopPropagation();
61277 input.on("input.combo-input", function() {
61278 var start2 = input.property("selectionStart");
61279 input.node().setSelectionRange(start2, start2);
61280 input.on("input.combo-input", change);
61288 d3_event.preventDefault();
61289 d3_event.stopPropagation();
61293 if (tagName === "textarea" && !shown)
61295 d3_event.preventDefault();
61296 if (tagName === "input" && !shown) {
61302 if (tagName === "textarea" && !shown)
61304 d3_event.preventDefault();
61305 if (tagName === "input" && !shown) {
61312 function keyup(d3_event) {
61313 switch (d3_event.keyCode) {
61319 function change(doAutoComplete) {
61320 if (doAutoComplete === void 0)
61321 doAutoComplete = true;
61322 fetchComboData(value(), function() {
61324 var val = input.property("value");
61325 if (_suggestions.length) {
61326 if (doAutoComplete && input.property("selectionEnd") === val.length) {
61327 _selected = tryAutocomplete();
61334 var combo = container.selectAll(".combobox");
61335 if (combo.empty()) {
61344 function nav(dir) {
61345 if (_suggestions.length) {
61347 for (var i3 = 0; i3 < _suggestions.length; i3++) {
61348 if (_selected && _suggestions[i3].value === _selected) {
61353 index = Math.max(Math.min(index + dir, _suggestions.length - 1), 0);
61354 _selected = _suggestions[index].value;
61355 utilGetSetValue(input, _selected);
61356 dispatch14.call("update");
61361 function ensureVisible() {
61362 var combo = container.selectAll(".combobox");
61365 var containerRect = container.node().getBoundingClientRect();
61366 var comboRect = combo.node().getBoundingClientRect();
61367 if (comboRect.bottom > containerRect.bottom) {
61368 var node = attachTo ? attachTo.node() : input.node();
61369 node.scrollIntoView({ behavior: "instant", block: "center" });
61372 var selected = combo.selectAll(".combobox-option.selected").node();
61374 selected.scrollIntoView({ behavior: "smooth", block: "nearest" });
61378 var value2 = input.property("value");
61379 var start2 = input.property("selectionStart");
61380 var end = input.property("selectionEnd");
61381 if (start2 && end) {
61382 value2 = value2.substring(0, start2);
61386 function fetchComboData(v2, cb) {
61387 _cancelFetch = false;
61388 _fetcher.call(input, v2, function(results) {
61391 _suggestions = results;
61392 results.forEach(function(d2) {
61393 _fetched[d2.value] = d2;
61400 function tryAutocomplete() {
61401 if (!_canAutocomplete)
61403 var val = _caseSensitive ? value() : value().toLowerCase();
61408 const suggestionValues = [];
61409 _suggestions.forEach((s2) => {
61410 suggestionValues.push(s2.value);
61411 if (s2.key && s2.key !== s2.value) {
61412 suggestionValues.push(s2.key);
61415 var bestIndex = -1;
61416 for (var i3 = 0; i3 < suggestionValues.length; i3++) {
61417 var suggestion = suggestionValues[i3];
61418 var compare = _caseSensitive ? suggestion : suggestion.toLowerCase();
61419 if (compare === val) {
61422 } else if (bestIndex === -1 && compare.indexOf(val) === 0) {
61426 if (bestIndex !== -1) {
61427 var bestVal = suggestionValues[bestIndex];
61428 input.property("value", bestVal);
61429 input.node().setSelectionRange(val.length, bestVal.length);
61430 dispatch14.call("update");
61434 function render() {
61435 if (_suggestions.length < _minItems || document.activeElement !== input.node()) {
61439 var shown = !container.selectAll(".combobox").empty();
61442 var combo = container.selectAll(".combobox");
61443 var options2 = combo.selectAll(".combobox-option").data(_suggestions, function(d2) {
61446 options2.exit().remove();
61447 options2.enter().append("a").attr("class", function(d2) {
61448 return "combobox-option " + (d2.klass || "");
61449 }).attr("title", function(d2) {
61451 }).each(function(d2) {
61453 d2.display(select_default2(this));
61455 select_default2(this).text(d2.value);
61457 }).on("mouseenter", _mouseEnterHandler).on("mouseleave", _mouseLeaveHandler).merge(options2).classed("selected", function(d2) {
61458 return d2.value === _selected || d2.key === _selected;
61459 }).on("click.combo-option", accept).order();
61460 var node = attachTo ? attachTo.node() : input.node();
61461 var containerRect = container.node().getBoundingClientRect();
61462 var rect = node.getBoundingClientRect();
61463 combo.style("left", rect.left + 5 - containerRect.left + "px").style("width", rect.width - 10 + "px").style("top", rect.height + rect.top - containerRect.top + "px");
61465 function accept(d3_event, d2) {
61466 _cancelFetch = true;
61467 var thiz = input.node();
61469 utilGetSetValue(input, d2.value);
61470 utilTriggerEvent(input, "change");
61472 var val = utilGetSetValue(input);
61473 thiz.setSelectionRange(val.length, val.length);
61474 d2 = _fetched[val];
61475 dispatch14.call("accept", thiz, d2, val);
61478 function cancel() {
61479 _cancelFetch = true;
61480 var thiz = input.node();
61481 var val = utilGetSetValue(input);
61482 var start2 = input.property("selectionStart");
61483 var end = input.property("selectionEnd");
61484 val = val.slice(0, start2) + val.slice(end);
61485 utilGetSetValue(input, val);
61486 thiz.setSelectionRange(val.length, val.length);
61487 dispatch14.call("cancel", thiz);
61491 combobox.canAutocomplete = function(val) {
61492 if (!arguments.length)
61493 return _canAutocomplete;
61494 _canAutocomplete = val;
61497 combobox.caseSensitive = function(val) {
61498 if (!arguments.length)
61499 return _caseSensitive;
61500 _caseSensitive = val;
61503 combobox.data = function(val) {
61504 if (!arguments.length)
61509 combobox.fetcher = function(val) {
61510 if (!arguments.length)
61515 combobox.minItems = function(val) {
61516 if (!arguments.length)
61521 combobox.itemsMouseEnter = function(val) {
61522 if (!arguments.length)
61523 return _mouseEnterHandler;
61524 _mouseEnterHandler = val;
61527 combobox.itemsMouseLeave = function(val) {
61528 if (!arguments.length)
61529 return _mouseLeaveHandler;
61530 _mouseLeaveHandler = val;
61533 return utilRebind(combobox, dispatch14, "on");
61535 uiCombobox.off = function(input, context) {
61536 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);
61537 context.container().on("scroll.combo-scroll", null);
61540 // modules/ui/disclosure.js
61541 function uiDisclosure(context, key, expandedDefault) {
61542 var dispatch14 = dispatch_default("toggled");
61544 var _label = utilFunctor("");
61545 var _updatePreference = true;
61546 var _content = function() {
61548 var disclosure = function(selection2) {
61549 if (_expanded === void 0 || _expanded === null) {
61550 var preference = corePreferences("disclosure." + key + ".expanded");
61551 _expanded = preference === null ? !!expandedDefault : preference === "true";
61553 var hideToggle = selection2.selectAll(".hide-toggle-" + key).data([0]);
61554 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"));
61555 hideToggleEnter.append("span").attr("class", "hide-toggle-text");
61556 hideToggle = hideToggleEnter.merge(hideToggle);
61557 hideToggle.on("click", toggle).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`)).attr("aria-expanded", _expanded).classed("expanded", _expanded);
61558 const label = _label();
61559 const labelSelection = hideToggle.selectAll(".hide-toggle-text");
61560 if (typeof label !== "function") {
61561 labelSelection.text(_label());
61563 labelSelection.text("").call(label);
61565 hideToggle.selectAll(".hide-toggle-icon").attr(
61567 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
61569 var wrap2 = selection2.selectAll(".disclosure-wrap").data([0]);
61570 wrap2 = wrap2.enter().append("div").attr("class", "disclosure-wrap disclosure-wrap-" + key).merge(wrap2).classed("hide", !_expanded);
61572 wrap2.call(_content);
61574 function toggle(d3_event) {
61575 d3_event.preventDefault();
61576 _expanded = !_expanded;
61577 if (_updatePreference) {
61578 corePreferences("disclosure." + key + ".expanded", _expanded);
61580 hideToggle.classed("expanded", _expanded).attr("aria-expanded", _expanded).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`));
61581 hideToggle.selectAll(".hide-toggle-icon").attr(
61583 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
61585 wrap2.call(uiToggle(_expanded));
61587 wrap2.call(_content);
61589 dispatch14.call("toggled", this, _expanded);
61592 disclosure.label = function(val) {
61593 if (!arguments.length)
61595 _label = utilFunctor(val);
61598 disclosure.expanded = function(val) {
61599 if (!arguments.length)
61604 disclosure.updatePreference = function(val) {
61605 if (!arguments.length)
61606 return _updatePreference;
61607 _updatePreference = val;
61610 disclosure.content = function(val) {
61611 if (!arguments.length)
61616 return utilRebind(disclosure, dispatch14, "on");
61619 // modules/ui/section.js
61620 function uiSection(id2, context) {
61621 var _classes = utilFunctor("");
61622 var _shouldDisplay;
61626 var _expandedByDefault = utilFunctor(true);
61627 var _disclosureContent;
61628 var _disclosureExpanded;
61629 var _containerSelection = select_default2(null);
61633 section.classes = function(val) {
61634 if (!arguments.length)
61636 _classes = utilFunctor(val);
61639 section.label = function(val) {
61640 if (!arguments.length)
61642 _label = utilFunctor(val);
61645 section.expandedByDefault = function(val) {
61646 if (!arguments.length)
61647 return _expandedByDefault;
61648 _expandedByDefault = utilFunctor(val);
61651 section.shouldDisplay = function(val) {
61652 if (!arguments.length)
61653 return _shouldDisplay;
61654 _shouldDisplay = utilFunctor(val);
61657 section.content = function(val) {
61658 if (!arguments.length)
61663 section.disclosureContent = function(val) {
61664 if (!arguments.length)
61665 return _disclosureContent;
61666 _disclosureContent = val;
61669 section.disclosureExpanded = function(val) {
61670 if (!arguments.length)
61671 return _disclosureExpanded;
61672 _disclosureExpanded = val;
61675 section.render = function(selection2) {
61676 _containerSelection = selection2.selectAll(".section-" + id2).data([0]);
61677 var sectionEnter = _containerSelection.enter().append("div").attr("class", "section section-" + id2 + " " + (_classes && _classes() || ""));
61678 _containerSelection = sectionEnter.merge(_containerSelection);
61679 _containerSelection.call(renderContent);
61681 section.reRender = function() {
61682 _containerSelection.call(renderContent);
61684 section.selection = function() {
61685 return _containerSelection;
61687 section.disclosure = function() {
61688 return _disclosure;
61690 function renderContent(selection2) {
61691 if (_shouldDisplay) {
61692 var shouldDisplay = _shouldDisplay();
61693 selection2.classed("hide", !shouldDisplay);
61694 if (!shouldDisplay) {
61695 selection2.html("");
61699 if (_disclosureContent) {
61700 if (!_disclosure) {
61701 _disclosure = uiDisclosure(context, id2.replace(/-/g, "_"), _expandedByDefault()).label(_label || "").content(_disclosureContent);
61703 if (_disclosureExpanded !== void 0) {
61704 _disclosure.expanded(_disclosureExpanded);
61705 _disclosureExpanded = void 0;
61707 selection2.call(_disclosure);
61711 selection2.call(_content);
61717 // modules/ui/tag_reference.js
61718 function uiTagReference(what) {
61719 var wikibase = what.qid ? services.wikidata : services.osmWikibase;
61720 var tagReference = {};
61721 var _button = select_default2(null);
61722 var _body = select_default2(null);
61728 _button.classed("tag-reference-loading", true);
61729 wikibase.getDocs(what, gotDocs);
61731 function gotDocs(err, docs) {
61733 if (!docs || !docs.title) {
61734 _body.append("p").attr("class", "tag-reference-description").call(_t.append("inspector.no_documentation_key"));
61738 if (docs.imageURL) {
61739 _body.append("img").attr("class", "tag-reference-wiki-image").attr("alt", docs.description).attr("src", docs.imageURL).on("load", function() {
61741 }).on("error", function() {
61742 select_default2(this).remove();
61748 var tagReferenceDescription = _body.append("p").attr("class", "tag-reference-description").append("span");
61749 if (docs.description) {
61750 tagReferenceDescription = tagReferenceDescription.attr("class", "localized-text").attr("lang", docs.descriptionLocaleCode || "und").text(docs.description);
61752 tagReferenceDescription = tagReferenceDescription.call(_t.append("inspector.no_documentation_key"));
61754 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"));
61756 _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));
61758 if (what.key === "comment") {
61759 _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"));
61764 _button.classed("tag-reference-loading", false);
61765 _body.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1");
61767 _button.selectAll("svg.icon use").each(function() {
61768 var iconUse = select_default2(this);
61769 if (iconUse.attr("href") === "#iD-icon-info") {
61770 iconUse.attr("href", "#iD-icon-info-filled");
61775 _body.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
61776 _body.classed("expanded", false);
61779 _button.selectAll("svg.icon use").each(function() {
61780 var iconUse = select_default2(this);
61781 if (iconUse.attr("href") === "#iD-icon-info-filled") {
61782 iconUse.attr("href", "#iD-icon-info");
61786 tagReference.button = function(selection2, klass, iconName) {
61787 _button = selection2.selectAll(".tag-reference-button").data([0]);
61788 _button = _button.enter().append("button").attr("class", "tag-reference-button " + (klass || "")).attr("title", _t("icons.information")).call(svgIcon("#iD-icon-" + (iconName || "inspect"))).merge(_button);
61789 _button.on("click", function(d3_event) {
61790 d3_event.stopPropagation();
61791 d3_event.preventDefault();
61795 } else if (_loaded) {
61802 tagReference.body = function(selection2) {
61803 var itemID = what.qid || what.key + "-" + (what.value || "");
61804 _body = selection2.selectAll(".tag-reference-body").data([itemID], function(d2) {
61807 _body.exit().remove();
61808 _body = _body.enter().append("div").attr("class", "tag-reference-body").style("max-height", "0").style("opacity", "0").merge(_body);
61809 if (_showing === false) {
61813 tagReference.showing = function(val) {
61814 if (!arguments.length)
61817 return tagReference;
61819 return tagReference;
61822 // modules/ui/field_help.js
61823 function uiFieldHelp(context, fieldName) {
61824 var fieldHelp = {};
61825 var _inspector = select_default2(null);
61826 var _wrap = select_default2(null);
61827 var _body = select_default2(null);
61828 var fieldHelpKeys = {
61856 "indirect_example",
61861 var fieldHelpHeadings = {};
61862 var replacements = {
61863 distField: { html: _t.html("restriction.controls.distance") },
61864 viaField: { html: _t.html("restriction.controls.via") },
61865 fromShadow: { html: icon("#iD-turn-shadow", "inline shadow from") },
61866 allowShadow: { html: icon("#iD-turn-shadow", "inline shadow allow") },
61867 restrictShadow: { html: icon("#iD-turn-shadow", "inline shadow restrict") },
61868 onlyShadow: { html: icon("#iD-turn-shadow", "inline shadow only") },
61869 allowTurn: { html: icon("#iD-turn-yes", "inline turn") },
61870 restrictTurn: { html: icon("#iD-turn-no", "inline turn") },
61871 onlyTurn: { html: icon("#iD-turn-only", "inline turn") }
61873 var docs = fieldHelpKeys[fieldName].map(function(key) {
61874 var helpkey = "help.field." + fieldName + "." + key[0];
61875 var text2 = key[1].reduce(function(all, part) {
61876 var subkey = helpkey + "." + part;
61877 var depth = fieldHelpHeadings[subkey];
61878 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
61879 return all + hhh + _t.html(subkey, replacements) + "\n\n";
61883 title: _t.html(helpkey + ".title"),
61884 html: marked(text2.trim())
61889 _body.classed("hide", false).style("opacity", "0").transition().duration(200).style("opacity", "1");
61892 _body.classed("hide", true).transition().duration(200).style("opacity", "0").on("end", function() {
61893 _body.classed("hide", true);
61896 function clickHelp(index) {
61897 var d2 = docs[index];
61898 var tkeys = fieldHelpKeys[fieldName][index][1];
61899 _body.selectAll(".field-help-nav-item").classed("active", function(d4, i3) {
61900 return i3 === index;
61902 var content = _body.selectAll(".field-help-content").html(d2.html);
61903 content.selectAll("p").attr("class", function(d4, i3) {
61906 if (d2.key === "help.field.restrictions.inspecting") {
61907 content.insert("img", "p.from_shadow").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_inspect.gif"));
61908 } else if (d2.key === "help.field.restrictions.modifying") {
61909 content.insert("img", "p.allow_turn").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_modify.gif"));
61912 fieldHelp.button = function(selection2) {
61915 var button = selection2.selectAll(".field-help-button").data([0]);
61916 button.enter().append("button").attr("class", "field-help-button").call(svgIcon("#iD-icon-help")).merge(button).on("click", function(d3_event) {
61917 d3_event.stopPropagation();
61918 d3_event.preventDefault();
61919 if (_body.classed("hide")) {
61926 function updatePosition() {
61927 var wrap2 = _wrap.node();
61928 var inspector = _inspector.node();
61929 var wRect = wrap2.getBoundingClientRect();
61930 var iRect = inspector.getBoundingClientRect();
61931 _body.style("top", wRect.top + inspector.scrollTop - iRect.top + "px");
61933 fieldHelp.body = function(selection2) {
61934 _wrap = selection2.selectAll(".form-field-input-wrap");
61937 _inspector = context.container().select(".sidebar .entity-editor-pane .inspector-body");
61938 if (_inspector.empty())
61940 _body = _inspector.selectAll(".field-help-body").data([0]);
61941 var enter = _body.enter().append("div").attr("class", "field-help-body hide");
61942 var titleEnter = enter.append("div").attr("class", "field-help-title cf");
61943 titleEnter.append("h2").attr("class", _mainLocalizer.textDirection() === "rtl" ? "fr" : "fl").call(_t.append("help.field." + fieldName + ".title"));
61944 titleEnter.append("button").attr("class", "fr close").attr("title", _t("icons.close")).on("click", function(d3_event) {
61945 d3_event.stopPropagation();
61946 d3_event.preventDefault();
61948 }).call(svgIcon("#iD-icon-close"));
61949 var navEnter = enter.append("div").attr("class", "field-help-nav cf");
61950 var titles = docs.map(function(d2) {
61953 navEnter.selectAll(".field-help-nav-item").data(titles).enter().append("div").attr("class", "field-help-nav-item").html(function(d2) {
61955 }).on("click", function(d3_event, d2) {
61956 d3_event.stopPropagation();
61957 d3_event.preventDefault();
61958 clickHelp(titles.indexOf(d2));
61960 enter.append("div").attr("class", "field-help-content");
61961 _body = _body.merge(enter);
61967 // modules/ui/fields/check.js
61968 function uiFieldCheck(field, context) {
61969 var dispatch14 = dispatch_default("change");
61970 var options2 = field.options;
61974 var input = select_default2(null);
61975 var text2 = select_default2(null);
61976 var label = select_default2(null);
61977 var reverser = select_default2(null);
61979 var _entityIDs = [];
61981 var stringsField = field.resolveReference("stringsCrossReference");
61982 if (!options2 && stringsField.options) {
61983 options2 = stringsField.options;
61986 for (var i3 in options2) {
61987 var v2 = options2[i3];
61988 values.push(v2 === "undefined" ? void 0 : v2);
61989 texts.push(stringsField.t.html("options." + v2, { "default": v2 }));
61992 values = [void 0, "yes"];
61993 texts = [_t.html("inspector.unknown"), _t.html("inspector.check.yes")];
61994 if (field.type !== "defaultCheck") {
61996 texts.push(_t.html("inspector.check.no"));
61999 function checkImpliedYes() {
62000 _impliedYes = field.id === "oneway_yes";
62001 if (field.id === "oneway") {
62002 var entity = context.entity(_entityIDs[0]);
62003 for (var key in entity.tags) {
62004 if (key in osmOneWayTags && entity.tags[key] in osmOneWayTags[key]) {
62005 _impliedYes = true;
62006 texts[0] = _t.html("_tagging.presets.fields.oneway_yes.options.undefined");
62012 function reverserHidden() {
62013 if (!context.container().select("div.inspector-hover").empty())
62015 return !(_value === "yes" || _impliedYes && !_value);
62017 function reverserSetText(selection2) {
62018 var entity = _entityIDs.length && context.hasEntity(_entityIDs[0]);
62019 if (reverserHidden() || !entity)
62021 var first = entity.first();
62022 var last = entity.isClosed() ? entity.nodes[entity.nodes.length - 2] : entity.last();
62023 var pseudoDirection = first < last;
62024 var icon2 = pseudoDirection ? "#iD-icon-forward" : "#iD-icon-backward";
62025 selection2.selectAll(".reverser-span").html("").call(_t.append("inspector.check.reverser")).call(svgIcon(icon2, "inline"));
62028 var check = function(selection2) {
62030 label = selection2.selectAll(".form-field-input-wrap").data([0]);
62031 var enter = label.enter().append("label").attr("class", "form-field-input-wrap form-field-input-check");
62032 enter.append("input").property("indeterminate", field.type !== "defaultCheck").attr("type", "checkbox").attr("id", field.domId);
62033 enter.append("span").html(texts[0]).attr("class", "value");
62034 if (field.type === "onewayCheck") {
62035 enter.append("button").attr("class", "reverser" + (reverserHidden() ? " hide" : "")).append("span").attr("class", "reverser-span");
62037 label = label.merge(enter);
62038 input = label.selectAll("input");
62039 text2 = label.selectAll("span.value");
62040 input.on("click", function(d3_event) {
62041 d3_event.stopPropagation();
62043 if (Array.isArray(_tags[field.key])) {
62044 if (values.indexOf("yes") !== -1) {
62045 t2[field.key] = "yes";
62047 t2[field.key] = values[0];
62050 t2[field.key] = values[(values.indexOf(_value) + 1) % values.length];
62052 if (t2[field.key] === "reversible" || t2[field.key] === "alternating") {
62053 t2[field.key] = values[0];
62055 dispatch14.call("change", this, t2);
62057 if (field.type === "onewayCheck") {
62058 reverser = label.selectAll(".reverser");
62059 reverser.call(reverserSetText).on("click", function(d3_event) {
62060 d3_event.preventDefault();
62061 d3_event.stopPropagation();
62064 for (var i4 in _entityIDs) {
62065 graph = actionReverse(_entityIDs[i4])(graph);
62069 _t("operations.reverse.annotation.line", { n: 1 })
62071 context.validator().validate();
62072 select_default2(this).call(reverserSetText);
62076 check.entityIDs = function(val) {
62077 if (!arguments.length)
62082 check.tags = function(tags) {
62084 function isChecked(val) {
62085 return val !== "no" && val !== "" && val !== void 0 && val !== null;
62087 function textFor(val) {
62090 var index = values.indexOf(val);
62091 return index !== -1 ? texts[index] : '"' + val + '"';
62094 var isMixed = Array.isArray(tags[field.key]);
62095 _value = !isMixed && tags[field.key] && tags[field.key].toLowerCase();
62096 if (field.type === "onewayCheck" && (_value === "1" || _value === "-1")) {
62099 input.property("indeterminate", isMixed || field.type !== "defaultCheck" && !_value).property("checked", isChecked(_value));
62100 text2.html(isMixed ? _t.html("inspector.multiple_values") : textFor(_value)).classed("mixed", isMixed);
62101 label.classed("set", !!_value);
62102 if (field.type === "onewayCheck") {
62103 reverser.classed("hide", reverserHidden()).call(reverserSetText);
62106 check.focus = function() {
62107 input.node().focus();
62109 return utilRebind(check, dispatch14, "on");
62112 // modules/ui/length_indicator.js
62113 function uiLengthIndicator(maxChars) {
62114 var _wrap = select_default2(null);
62115 var _tooltip = uiPopover("tooltip max-length-warning").placement("bottom").hasArrow(true).content(() => (selection2) => {
62116 selection2.text("");
62117 selection2.call(svgIcon("#iD-icon-alert", "inline"));
62118 selection2.call(_t.append("inspector.max_length_reached", { maxChars }));
62120 var _silent = false;
62121 var lengthIndicator = function(selection2) {
62122 _wrap = selection2.selectAll("span.length-indicator-wrap").data([0]);
62123 _wrap = _wrap.enter().append("span").merge(_wrap).classed("length-indicator-wrap", true);
62124 selection2.call(_tooltip);
62126 lengthIndicator.update = function(val) {
62127 const strLen = utilUnicodeCharsCount(utilCleanOsmString(val, Number.POSITIVE_INFINITY));
62128 let indicator = _wrap.selectAll("span.length-indicator").data([strLen]);
62129 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");
62132 if (strLen > maxChars) {
62138 lengthIndicator.silent = function(val) {
62139 if (!arguments.length)
62142 return lengthIndicator;
62144 return lengthIndicator;
62147 // modules/ui/fields/combo.js
62148 function uiFieldCombo(field, context) {
62149 var dispatch14 = dispatch_default("change");
62150 var _isMulti = field.type === "multiCombo" || field.type === "manyCombo";
62151 var _isNetwork = field.type === "networkCombo";
62152 var _isSemi = field.type === "semiCombo";
62153 var _showTagInfoSuggestions = field.type !== "manyCombo" && field.autoSuggestions !== false;
62154 var _allowCustomValues = field.type !== "manyCombo" && field.customValues !== false;
62155 var _snake_case = field.snake_case || field.snake_case === void 0;
62156 var _combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(field.caseSensitive).minItems(1);
62157 var _container = select_default2(null);
62158 var _inputWrap = select_default2(null);
62159 var _input = select_default2(null);
62160 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
62161 var _comboData = [];
62162 var _multiData = [];
62163 var _entityIDs = [];
62166 var _staticPlaceholder;
62167 var _dataDeprecated = [];
62168 _mainFileFetcher.get("deprecated").then(function(d2) {
62169 _dataDeprecated = d2;
62170 }).catch(function() {
62172 if (_isMulti && field.key && /[^:]$/.test(field.key)) {
62175 function snake(s2) {
62176 return s2.replace(/\s+/g, "_");
62178 function clean2(s2) {
62179 return s2.split(";").map(function(s3) {
62183 function tagValue(dval) {
62184 dval = clean2(dval || "");
62185 var found = getOptions(true).find(function(o2) {
62186 return o2.key && clean2(o2.value) === dval;
62190 if (field.type === "typeCombo" && !dval) {
62193 return restrictTagValueSpelling(dval) || void 0;
62195 function restrictTagValueSpelling(dval) {
62197 dval = snake(dval);
62199 if (!field.caseSensitive) {
62200 dval = dval.toLowerCase();
62204 function getLabelId(field2, v2) {
62205 return field2.hasTextForStringId(`options.${v2}.title`) ? `options.${v2}.title` : `options.${v2}`;
62207 function displayValue(tval) {
62209 var stringsField = field.resolveReference("stringsCrossReference");
62210 const labelId = getLabelId(stringsField, tval);
62211 if (stringsField.hasTextForStringId(labelId)) {
62212 return stringsField.t(labelId, { default: tval });
62214 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
62219 function renderValue(tval) {
62221 var stringsField = field.resolveReference("stringsCrossReference");
62222 const labelId = getLabelId(stringsField, tval);
62223 if (stringsField.hasTextForStringId(labelId)) {
62224 return stringsField.t.append(labelId, { default: tval });
62226 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
62229 return (selection2) => selection2.text(tval);
62231 function objectDifference(a2, b2) {
62232 return a2.filter(function(d1) {
62233 return !b2.some(function(d2) {
62234 return d1.value === d2.value;
62238 function initCombo(selection2, attachTo) {
62239 if (!_allowCustomValues) {
62240 selection2.attr("readonly", "readonly");
62242 if (_showTagInfoSuggestions && services.taginfo) {
62243 selection2.call(_combobox.fetcher(setTaginfoValues), attachTo);
62244 setTaginfoValues("", setPlaceholder);
62246 selection2.call(_combobox, attachTo);
62247 setTimeout(() => setStaticValues(setPlaceholder), 0);
62250 function getOptions(allOptions) {
62251 var stringsField = field.resolveReference("stringsCrossReference");
62252 if (!(field.options || stringsField.options))
62255 if (allOptions !== true) {
62256 options2 = field.options || stringsField.options;
62258 options2 = [].concat(field.options, stringsField.options).filter(Boolean);
62260 return options2.map(function(v2) {
62261 const labelId = getLabelId(stringsField, v2);
62264 value: stringsField.t(labelId, { default: v2 }),
62265 title: stringsField.t(`options.${v2}.description`, { default: v2 }),
62266 display: addComboboxIcons(stringsField.t.append(labelId, { default: v2 }), v2),
62267 klass: stringsField.hasTextForStringId(labelId) ? "" : "raw-option"
62271 function setStaticValues(callback, filter2) {
62272 _comboData = getOptions();
62273 if (filter2 !== void 0) {
62274 _comboData = _comboData.filter(filter2);
62276 _comboData = objectDifference(_comboData, _multiData);
62277 _combobox.data(_comboData);
62279 callback(_comboData);
62281 function setTaginfoValues(q2, callback) {
62282 var queryFilter = (d2) => d2.value.toLowerCase().includes(q2.toLowerCase()) || d2.key.toLowerCase().includes(q2.toLowerCase());
62283 setStaticValues(callback, queryFilter);
62284 var stringsField = field.resolveReference("stringsCrossReference");
62285 var fn = _isMulti ? "multikeys" : "values";
62286 var query = (_isMulti ? field.key : "") + q2;
62287 var hasCountryPrefix = _isNetwork && _countryCode && _countryCode.indexOf(q2.toLowerCase()) === 0;
62288 if (hasCountryPrefix) {
62289 query = _countryCode + ":";
62292 debounce: q2 !== "",
62296 if (_entityIDs.length) {
62297 params.geometry = context.graph().geometry(_entityIDs[0]);
62299 services.taginfo[fn](params, function(err, data) {
62302 data = data.filter((d2) => field.type !== "typeCombo" || d2.value !== "yes");
62303 data = data.filter((d2) => {
62304 var value = d2.value;
62306 value = value.slice(field.key.length);
62308 return value === restrictTagValueSpelling(value);
62310 var deprecatedValues = osmEntity.deprecatedTagValuesByKey(_dataDeprecated)[field.key];
62311 if (deprecatedValues) {
62312 data = data.filter((d2) => !deprecatedValues.includes(d2.value));
62314 if (hasCountryPrefix) {
62315 data = data.filter((d2) => d2.value.toLowerCase().indexOf(_countryCode + ":") === 0);
62317 const additionalOptions = (field.options || stringsField.options || []).filter((v2) => !data.some((dv) => dv.value === (_isMulti ? field.key + v2 : v2))).map((v2) => ({ value: v2 }));
62318 _container.classed("empty-combobox", data.length === 0);
62319 _comboData = data.concat(additionalOptions).map(function(d2) {
62322 v2 = v2.replace(field.key, "");
62323 const labelId = getLabelId(stringsField, v2);
62324 var isLocalizable = stringsField.hasTextForStringId(labelId);
62325 var label = stringsField.t(labelId, { default: v2 });
62329 title: stringsField.t(`options.${v2}.description`, { default: isLocalizable ? v2 : d2.title !== label ? d2.title : "" }),
62330 display: addComboboxIcons(stringsField.t.append(labelId, { default: v2 }), v2),
62331 klass: isLocalizable ? "" : "raw-option"
62334 _comboData = _comboData.filter(queryFilter);
62335 _comboData = objectDifference(_comboData, _multiData);
62337 callback(_comboData);
62340 function addComboboxIcons(disp, value) {
62341 const iconsField = field.resolveReference("iconsCrossReference");
62342 if (iconsField.icons) {
62343 return function(selection2) {
62344 var span = selection2.insert("span", ":first-child").attr("class", "tag-value-icon");
62345 if (iconsField.icons[value]) {
62346 span.call(svgIcon(`#${iconsField.icons[value]}`));
62348 disp.call(this, selection2);
62353 function setPlaceholder(values) {
62354 if (_isMulti || _isSemi) {
62355 _staticPlaceholder = field.placeholder() || _t("inspector.add");
62357 var vals = values.map(function(d2) {
62359 }).filter(function(s2) {
62360 return s2.length < 20;
62362 var placeholders = vals.length > 1 ? vals : values.map(function(d2) {
62365 _staticPlaceholder = field.placeholder() || placeholders.slice(0, 3).join(", ");
62367 if (!/(…|\.\.\.)$/.test(_staticPlaceholder)) {
62368 _staticPlaceholder += "\u2026";
62371 if (!_isMulti && !_isSemi && _tags && Array.isArray(_tags[field.key])) {
62372 ph = _t("inspector.multiple_values");
62374 ph = _staticPlaceholder;
62376 _container.selectAll("input").attr("placeholder", ph);
62377 var hideAdd = !_allowCustomValues && !values.length;
62378 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
62380 function change() {
62383 if (_isMulti || _isSemi) {
62386 vals = [tagValue(utilGetSetValue(_input))];
62387 } else if (_isSemi) {
62388 val = tagValue(utilGetSetValue(_input)) || "";
62389 val = val.replace(/,/g, ";");
62390 vals = val.split(";");
62392 vals = vals.filter(Boolean);
62395 _container.classed("active", false);
62396 utilGetSetValue(_input, "");
62398 utilArrayUniq(vals).forEach(function(v2) {
62399 var key = (field.key || "") + v2;
62401 var old = _tags[key];
62402 if (typeof old === "string" && old.toLowerCase() !== "no")
62405 key = context.cleanTagKey(key);
62406 field.keys.push(key);
62409 } else if (_isSemi) {
62410 var arr = _multiData.map(function(d2) {
62413 arr = arr.concat(vals);
62414 t2[field.key] = context.cleanTagValue(utilArrayUniq(arr).filter(Boolean).join(";"));
62416 window.setTimeout(function() {
62417 _input.node().focus();
62420 var rawValue = utilGetSetValue(_input);
62421 if (!rawValue && Array.isArray(_tags[field.key]))
62423 val = context.cleanTagValue(tagValue(rawValue));
62424 t2[field.key] = val || void 0;
62426 dispatch14.call("change", this, t2);
62428 function removeMultikey(d3_event, d2) {
62429 d3_event.preventDefault();
62430 d3_event.stopPropagation();
62433 t2[d2.key] = void 0;
62434 } else if (_isSemi) {
62435 var arr = _multiData.map(function(md) {
62436 return md.key === d2.key ? null : md.key;
62437 }).filter(Boolean);
62438 arr = utilArrayUniq(arr);
62439 t2[field.key] = arr.length ? arr.join(";") : void 0;
62440 _lengthIndicator.update(t2[field.key]);
62442 dispatch14.call("change", this, t2);
62444 function invertMultikey(d3_event, d2) {
62445 d3_event.preventDefault();
62446 d3_event.stopPropagation();
62449 t2[d2.key] = _tags[d2.key] === "yes" ? "no" : "yes";
62451 dispatch14.call("change", this, t2);
62453 function combo(selection2) {
62454 _container = selection2.selectAll(".form-field-input-wrap").data([0]);
62455 var type2 = _isMulti || _isSemi ? "multicombo" : "combo";
62456 _container = _container.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + type2).merge(_container);
62457 if (_isMulti || _isSemi) {
62458 _container = _container.selectAll(".chiplist").data([0]);
62459 var listClass = "chiplist";
62460 if (field.key === "destination" || field.key === "via") {
62461 listClass += " full-line-chips";
62463 _container = _container.enter().append("ul").attr("class", listClass).on("click", function() {
62464 window.setTimeout(function() {
62465 _input.node().focus();
62467 }).merge(_container);
62468 _inputWrap = _container.selectAll(".input-wrap").data([0]);
62469 _inputWrap = _inputWrap.enter().append("li").attr("class", "input-wrap").merge(_inputWrap);
62470 var hideAdd = !_allowCustomValues && !_comboData.length;
62471 _inputWrap.style("display", hideAdd ? "none" : null);
62472 _input = _inputWrap.selectAll("input").data([0]);
62474 _input = _container.selectAll("input").data([0]);
62476 _input = _input.enter().append("input").attr("type", "text").attr("id", field.domId).call(utilNoAuto).call(initCombo, _container).merge(_input);
62478 _inputWrap.call(_lengthIndicator);
62479 } else if (!_isMulti) {
62480 _container.call(_lengthIndicator);
62483 var extent = combinedEntityExtent();
62484 var countryCode = extent && iso1A2Code(extent.center());
62485 _countryCode = countryCode && countryCode.toLowerCase();
62487 _input.on("change", change).on("blur", change).on("input", function() {
62488 let val = utilGetSetValue(_input);
62490 if (_isSemi && _tags[field.key]) {
62491 val += ";" + _tags[field.key];
62493 _lengthIndicator.update(val);
62495 _input.on("keydown.field", function(d3_event) {
62496 switch (d3_event.keyCode) {
62498 _input.node().blur();
62499 d3_event.stopPropagation();
62503 if (_isMulti || _isSemi) {
62504 _combobox.on("accept", function() {
62505 _input.node().blur();
62506 _input.node().focus();
62508 _input.on("focus", function() {
62509 _container.classed("active", true);
62512 _combobox.on("cancel", function() {
62513 _input.node().blur();
62514 }).on("update", function() {
62515 updateIcon(utilGetSetValue(_input));
62518 function updateIcon(value) {
62519 value = tagValue(value);
62520 let container = _container;
62521 if (field.type === "multiCombo" || field.type === "semiCombo") {
62522 container = _container.select(".input-wrap");
62524 const iconsField = field.resolveReference("iconsCrossReference");
62525 if (iconsField.icons) {
62526 container.selectAll(".tag-value-icon").remove();
62527 if (iconsField.icons[value]) {
62528 container.selectAll(".tag-value-icon").data([value]).enter().insert("div", "input").attr("class", "tag-value-icon").call(svgIcon(`#${iconsField.icons[value]}`));
62532 combo.tags = function(tags) {
62534 var stringsField = field.resolveReference("stringsCrossReference");
62535 var isMixed = Array.isArray(tags[field.key]);
62536 var showsValue = (value) => !isMixed && value && !(field.type === "typeCombo" && value === "yes");
62537 var isRawValue = (value) => showsValue(value) && !stringsField.hasTextForStringId(`options.${value}`) && !stringsField.hasTextForStringId(`options.${value}.title`);
62538 var isKnownValue = (value) => showsValue(value) && !isRawValue(value);
62539 var isReadOnly = !_allowCustomValues;
62540 if (_isMulti || _isSemi) {
62544 for (var k2 in tags) {
62545 if (field.key && k2.indexOf(field.key) !== 0)
62547 if (!field.key && field.keys.indexOf(k2) === -1)
62550 var suffix = field.key ? k2.slice(field.key.length) : k2;
62553 value: displayValue(suffix),
62554 display: addComboboxIcons(renderValue(suffix), suffix),
62555 state: typeof v2 === "string" ? v2.toLowerCase() : "",
62556 isMixed: Array.isArray(v2)
62560 field.keys = _multiData.map(function(d2) {
62563 maxLength = context.maxCharsForTagKey() - utilUnicodeCharsCount(field.key);
62565 maxLength = context.maxCharsForTagKey();
62567 } else if (_isSemi) {
62568 var allValues = [];
62570 if (Array.isArray(tags[field.key])) {
62571 tags[field.key].forEach(function(tagVal) {
62572 var thisVals = utilArrayUniq((tagVal || "").split(";")).filter(Boolean);
62573 allValues = allValues.concat(thisVals);
62574 if (!commonValues) {
62575 commonValues = thisVals;
62577 commonValues = commonValues.filter((value) => thisVals.includes(value));
62580 allValues = utilArrayUniq(allValues).filter(Boolean);
62582 allValues = utilArrayUniq((tags[field.key] || "").split(";")).filter(Boolean);
62583 commonValues = allValues;
62585 _multiData = allValues.map(function(v3) {
62588 value: displayValue(v3),
62589 display: addComboboxIcons(renderValue(v3), v3),
62590 isMixed: !commonValues.includes(v3)
62593 var currLength = utilUnicodeCharsCount(commonValues.join(";"));
62594 maxLength = context.maxCharsForTagValue() - currLength;
62595 if (currLength > 0) {
62599 maxLength = Math.max(0, maxLength);
62600 var hideAdd = maxLength <= 0 || !_allowCustomValues && !_comboData.length;
62601 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
62602 var allowDragAndDrop = _isSemi && !Array.isArray(tags[field.key]);
62603 var chips = _container.selectAll(".chip").data(_multiData);
62604 chips.exit().remove();
62605 var enter = chips.enter().insert("li", ".input-wrap").attr("class", "chip");
62606 enter.append("span");
62608 chips = chips.merge(enter).order().classed("raw-value", function(d2) {
62611 k3 = k3.replace(field.key, "");
62612 return !stringsField.hasTextForStringId("options." + k3);
62613 }).classed("draggable", allowDragAndDrop).classed("mixed", function(d2) {
62615 }).attr("title", function(d2) {
62617 return _t("inspector.unshared_value_tooltip");
62619 if (!["yes", "no"].includes(d2.state)) {
62623 }).classed("negated", (d2) => d2.state === "no");
62625 chips.selectAll("input[type=checkbox]").remove();
62626 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);
62628 if (allowDragAndDrop) {
62629 registerDragAndDrop(chips);
62631 chips.select("span").each(function(d2) {
62632 const selection2 = select_default2(this);
62634 selection2.text("");
62635 d2.display(selection2);
62637 selection2.text(d2.value);
62640 chips.select("a").attr("href", "#").on("click", removeMultikey).attr("class", "remove").text("\xD7");
62643 var mixedValues = isMixed && tags[field.key].map(function(val) {
62644 return displayValue(val);
62645 }).filter(Boolean);
62646 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) {
62647 if (isReadOnly && isKnownValue(tags[field.key]) && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
62648 d3_event.preventDefault();
62649 d3_event.stopPropagation();
62651 t2[field.key] = void 0;
62652 dispatch14.call("change", this, t2);
62655 if (!Array.isArray(tags[field.key])) {
62656 updateIcon(tags[field.key]);
62659 _lengthIndicator.update(tags[field.key]);
62662 const refreshStyles = () => {
62663 _input.data([tagValue(utilGetSetValue(_input))]).classed("raw-value", isRawValue).classed("known-value", isKnownValue);
62665 _input.on("input.refreshStyles", refreshStyles);
62666 _combobox.on("update.refreshStyles", refreshStyles);
62669 function registerDragAndDrop(selection2) {
62670 var dragOrigin, targetIndex;
62672 drag_default().on("start", function(d3_event) {
62677 targetIndex = null;
62678 }).on("drag", function(d3_event) {
62679 var x2 = d3_event.x - dragOrigin.x, y2 = d3_event.y - dragOrigin.y;
62680 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
62681 Math.sqrt(Math.pow(x2, 2) + Math.pow(y2, 2)) <= 5)
62683 var index = selection2.nodes().indexOf(this);
62684 select_default2(this).classed("dragging", true);
62685 targetIndex = null;
62686 var targetIndexOffsetTop = null;
62687 var draggedTagWidth = select_default2(this).node().offsetWidth;
62688 if (field.key === "destination" || field.key === "via") {
62689 _container.selectAll(".chip").style("transform", function(d2, index2) {
62690 var node = select_default2(this).node();
62691 if (index === index2) {
62692 return "translate(" + x2 + "px, " + y2 + "px)";
62693 } else if (index2 > index && d3_event.y > node.offsetTop) {
62694 if (targetIndex === null || index2 > targetIndex) {
62695 targetIndex = index2;
62697 return "translateY(-100%)";
62698 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
62699 if (targetIndex === null || index2 < targetIndex) {
62700 targetIndex = index2;
62702 return "translateY(100%)";
62707 _container.selectAll(".chip").each(function(d2, index2) {
62708 var node = select_default2(this).node();
62709 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) {
62710 targetIndex = index2;
62711 targetIndexOffsetTop = node.offsetTop;
62713 }).style("transform", function(d2, index2) {
62714 var node = select_default2(this).node();
62715 if (index === index2) {
62716 return "translate(" + x2 + "px, " + y2 + "px)";
62718 if (node.offsetTop === targetIndexOffsetTop) {
62719 if (index2 < index && index2 >= targetIndex) {
62720 return "translateX(" + draggedTagWidth + "px)";
62721 } else if (index2 > index && index2 <= targetIndex) {
62722 return "translateX(-" + draggedTagWidth + "px)";
62728 }).on("end", function() {
62729 if (!select_default2(this).classed("dragging")) {
62732 var index = selection2.nodes().indexOf(this);
62733 select_default2(this).classed("dragging", false);
62734 _container.selectAll(".chip").style("transform", null);
62735 if (typeof targetIndex === "number") {
62736 var element = _multiData[index];
62737 _multiData.splice(index, 1);
62738 _multiData.splice(targetIndex, 0, element);
62740 if (_multiData.length) {
62741 t2[field.key] = _multiData.map(function(element2) {
62742 return element2.key;
62745 t2[field.key] = void 0;
62747 dispatch14.call("change", this, t2);
62749 dragOrigin = void 0;
62750 targetIndex = void 0;
62754 combo.focus = function() {
62755 _input.node().focus();
62757 combo.entityIDs = function(val) {
62758 if (!arguments.length)
62763 function combinedEntityExtent() {
62764 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
62766 return utilRebind(combo, dispatch14, "on");
62769 // modules/ui/fields/input.js
62770 var likelyRawNumberFormat = /^-?(0\.\d*|\d*\.\d{0,2}(\d{4,})?|\d{4,}\.\d{3})$/;
62771 function uiFieldText(field, context) {
62772 var dispatch14 = dispatch_default("change");
62773 var input = select_default2(null);
62774 var outlinkButton = select_default2(null);
62775 var wrap2 = select_default2(null);
62776 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
62777 var _entityIDs = [];
62779 var _phoneFormats = {};
62780 const isDirectionField = field.key.split(":").some((keyPart) => keyPart === "direction");
62781 const formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
62782 const parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
62783 const countDecimalPlaces = _mainLocalizer.decimalPlaceCounter(_mainLocalizer.languageCode());
62784 if (field.type === "tel") {
62785 _mainFileFetcher.get("phone_formats").then(function(d2) {
62786 _phoneFormats = d2;
62787 updatePhonePlaceholder();
62788 }).catch(function() {
62791 function calcLocked() {
62792 var isLocked = (field.id === "brand" || field.id === "network" || field.id === "operator" || field.id === "flag") && _entityIDs.length && _entityIDs.some(function(entityID) {
62793 var entity = context.graph().hasEntity(entityID);
62796 if (entity.tags.wikidata)
62798 var preset = _mainPresetIndex.match(entity, context.graph());
62799 var isSuggestion = preset && preset.suggestion;
62800 var which = field.id;
62801 return isSuggestion && !!entity.tags[which] && !!entity.tags[which + ":wikidata"];
62803 field.locked(isLocked);
62805 function i3(selection2) {
62807 var isLocked = field.locked();
62808 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
62809 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
62810 input = wrap2.selectAll("input").data([0]);
62811 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);
62812 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
62813 wrap2.call(_lengthIndicator);
62814 if (field.type === "tel") {
62815 updatePhonePlaceholder();
62816 } else if (field.type === "number") {
62817 var rtl = _mainLocalizer.textDirection() === "rtl";
62818 input.attr("type", "text");
62819 var inc = field.increment;
62820 var buttons = wrap2.selectAll(".increment, .decrement").data(rtl ? [inc, -inc] : [-inc, inc]);
62821 buttons.enter().append("button").attr("class", function(d2) {
62822 var which = d2 > 0 ? "increment" : "decrement";
62823 return "form-field-button " + which;
62824 }).attr("title", function(d2) {
62825 var which = d2 > 0 ? "increment" : "decrement";
62826 return _t(`inspector.${which}`);
62827 }).merge(buttons).on("click", function(d3_event, d2) {
62828 d3_event.preventDefault();
62829 var isMixed = Array.isArray(_tags[field.key]);
62832 var raw_vals = input.node().value || "0";
62833 var vals = raw_vals.split(";");
62834 vals = vals.map(function(v2) {
62836 const isRawNumber = likelyRawNumberFormat.test(v2);
62837 var num = isRawNumber ? parseFloat(v2) : parseLocaleFloat(v2);
62838 if (isDirectionField) {
62839 const compassDir = cardinal[v2.toLowerCase()];
62840 if (compassDir !== void 0) {
62844 if (!isFinite(num))
62846 num = parseFloat(num);
62847 if (!isFinite(num))
62850 if (isDirectionField) {
62851 num = (num % 360 + 360) % 360;
62853 return formatFloat(clamped(num), isRawNumber ? v2.includes(".") ? v2.split(".")[1].length : 0 : countDecimalPlaces(v2));
62855 input.node().value = vals.join(";");
62858 } else if (field.type === "identifier" && field.urlFormat && field.pattern) {
62859 input.attr("type", "text");
62860 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
62861 outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", function() {
62862 var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat);
62863 if (domainResults.length >= 2 && domainResults[1]) {
62864 var domain2 = domainResults[1];
62865 return _t("icons.view_on", { domain: domain2 });
62868 }).on("click", function(d3_event) {
62869 d3_event.preventDefault();
62870 var value = validIdentifierValueForLink();
62872 var url = field.urlFormat.replace(/{value}/, encodeURIComponent(value));
62873 window.open(url, "_blank");
62875 }).classed("disabled", () => !validIdentifierValueForLink()).merge(outlinkButton);
62876 } else if (field.type === "url") {
62877 input.attr("type", "text");
62878 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
62879 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) {
62880 d3_event.preventDefault();
62881 const value = validIdentifierValueForLink();
62883 window.open(value, "_blank");
62884 }).merge(outlinkButton);
62885 } else if (field.type === "colour") {
62886 input.attr("type", "text");
62887 updateColourPreview();
62888 } else if (field.type === "date") {
62889 input.attr("type", "text");
62893 function updateColourPreview() {
62894 function isColourValid(colour2) {
62895 if (!colour2.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)) {
62897 } else if (!CSS.supports("color", colour2) || ["unset", "inherit", "initial", "revert"].includes(colour2)) {
62902 wrap2.selectAll(".colour-preview").remove();
62903 const colour = utilGetSetValue(input);
62904 if (!isColourValid(colour) && colour !== "") {
62905 wrap2.selectAll("input.colour-selector").remove();
62906 wrap2.selectAll(".form-field-button").remove();
62909 var colourSelector = wrap2.selectAll(".colour-selector").data([0]);
62910 colourSelector.enter().append("input").attr("type", "color").attr("class", "colour-selector").on("input", debounce_default(function(d3_event) {
62911 d3_event.preventDefault();
62912 var colour2 = this.value;
62913 if (!isColourValid(colour2))
62915 utilGetSetValue(input, this.value);
62917 updateColourPreview();
62919 wrap2.selectAll("input.colour-selector").attr("value", colour);
62920 var chooserButton = wrap2.selectAll(".colour-preview").data([colour]);
62921 chooserButton = chooserButton.enter().append("div").attr("class", "form-field-button colour-preview").append("div").style("background-color", (d2) => d2).attr("class", "colour-box");
62922 if (colour === "") {
62923 chooserButton = chooserButton.call(svgIcon("#iD-icon-edit"));
62925 chooserButton.on("click", () => wrap2.select(".colour-selector").node().showPicker());
62927 function updateDateField() {
62928 function isDateValid(date2) {
62929 return date2.match(/^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$/);
62931 const date = utilGetSetValue(input);
62932 const now3 = /* @__PURE__ */ new Date();
62933 const today = new Date(now3.getTime() - now3.getTimezoneOffset() * 6e4).toISOString().split("T")[0];
62934 if ((field.key === "check_date" || field.key === "survey:date") && date !== today) {
62935 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", () => {
62936 utilGetSetValue(input, today);
62941 wrap2.selectAll(".date-set-today").remove();
62943 if (!isDateValid(date) && date !== "") {
62944 wrap2.selectAll("input.date-selector").remove();
62945 wrap2.selectAll(".date-calendar").remove();
62948 if (utilDetect().browser !== "Safari") {
62949 var dateSelector = wrap2.selectAll(".date-selector").data([0]);
62950 dateSelector.enter().append("input").attr("type", "date").attr("class", "date-selector").on("input", debounce_default(function(d3_event) {
62951 d3_event.preventDefault();
62952 var date2 = this.value;
62953 if (!isDateValid(date2))
62955 utilGetSetValue(input, this.value);
62959 wrap2.selectAll("input.date-selector").attr("value", date);
62960 var calendarButton = wrap2.selectAll(".date-calendar").data([date]);
62961 calendarButton = calendarButton.enter().append("button").attr("class", "form-field-button date-calendar").call(svgIcon("#fas-calendar-days"));
62962 calendarButton.on("click", () => wrap2.select(".date-selector").node().showPicker());
62965 function updatePhonePlaceholder() {
62966 if (input.empty() || !Object.keys(_phoneFormats).length)
62968 var extent = combinedEntityExtent();
62969 var countryCode = extent && iso1A2Code(extent.center());
62970 var format2 = countryCode && _phoneFormats[countryCode.toLowerCase()];
62972 input.attr("placeholder", format2);
62974 function validIdentifierValueForLink() {
62975 const value = utilGetSetValue(input).trim();
62976 if (field.type === "url" && value) {
62978 return new URL(value).href;
62983 if (field.type === "identifier" && field.pattern) {
62984 return value && value.match(new RegExp(field.pattern))?.[0];
62988 function clamped(num) {
62989 if (field.minValue !== void 0) {
62990 num = Math.max(num, field.minValue);
62992 if (field.maxValue !== void 0) {
62993 num = Math.min(num, field.maxValue);
62997 function getVals(tags) {
62999 const multiSelection = context.selectedIDs();
63000 tags = multiSelection.length > 1 ? context.selectedIDs().map((id2) => context.graph().entity(id2)).map((entity) => entity.tags) : [tags];
63001 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]));
63003 return new Set([].concat(tags[field.key]));
63006 function change(onInput) {
63007 return function() {
63009 var val = utilGetSetValue(input);
63011 val = context.cleanTagValue(val);
63012 if (!val && getVals(_tags).size > 1)
63014 var displayVal = val;
63015 if (field.type === "number" && val) {
63016 var numbers2 = val.split(";");
63017 numbers2 = numbers2.map(function(v2) {
63018 if (likelyRawNumberFormat.test(v2)) {
63021 var num = parseLocaleFloat(v2);
63022 const fractionDigits = countDecimalPlaces(v2);
63023 return isFinite(num) ? clamped(num).toFixed(fractionDigits) : v2;
63025 val = numbers2.join(";");
63028 utilGetSetValue(input, displayVal);
63029 t2[field.key] = val || void 0;
63031 dispatch14.call("change", this, (tags) => {
63032 if (field.keys.some((key) => tags[key])) {
63033 field.keys.filter((key) => tags[key]).forEach((key) => {
63034 tags[key] = val || void 0;
63037 tags[field.key] = val || void 0;
63042 dispatch14.call("change", this, t2, onInput);
63046 i3.entityIDs = function(val) {
63047 if (!arguments.length)
63052 i3.tags = function(tags) {
63054 const vals = getVals(tags);
63055 const isMixed = vals.size > 1;
63056 var val = vals.size === 1 ? [...vals][0] ?? "" : "";
63058 if (field.type === "number" && val) {
63059 var numbers2 = val.split(";");
63060 var oriNumbers = utilGetSetValue(input).split(";");
63061 if (numbers2.length !== oriNumbers.length)
63062 shouldUpdate = true;
63063 numbers2 = numbers2.map(function(v2) {
63065 var num = Number(v2);
63066 if (!isFinite(num) || v2 === "")
63068 const fractionDigits = v2.includes(".") ? v2.split(".")[1].length : 0;
63069 return formatFloat(num, fractionDigits);
63071 val = numbers2.join(";");
63072 shouldUpdate = (inputValue, setValue) => {
63073 const inputNums = inputValue.split(";").map(
63074 (setVal) => likelyRawNumberFormat.test(setVal) ? parseFloat(setVal) : parseLocaleFloat(setVal)
63076 const setNums = setValue.split(";").map(parseLocaleFloat);
63077 return !isEqual_default(inputNums, setNums);
63080 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);
63081 if (field.type === "number") {
63082 const buttons = wrap2.selectAll(".increment, .decrement");
63084 buttons.attr("disabled", "disabled").classed("disabled", true);
63086 var raw_vals = tags[field.key] || "0";
63087 const canIncDec = raw_vals.split(";").some((val2) => isFinite(Number(val2)) || isDirectionField && cardinal[val2.trim().toLowerCase()]);
63088 buttons.attr("disabled", canIncDec ? null : "disabled").classed("disabled", !canIncDec);
63091 if (field.type === "tel")
63092 updatePhonePlaceholder();
63093 if (field.type === "colour")
63094 updateColourPreview();
63095 if (field.type === "date")
63097 if (outlinkButton && !outlinkButton.empty()) {
63098 var disabled = !validIdentifierValueForLink();
63099 outlinkButton.classed("disabled", disabled);
63102 _lengthIndicator.update(tags[field.key]);
63105 i3.focus = function() {
63106 var node = input.node();
63110 function combinedEntityExtent() {
63111 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
63113 return utilRebind(i3, dispatch14, "on");
63116 // modules/ui/fields/access.js
63117 function uiFieldAccess(field, context) {
63118 var dispatch14 = dispatch_default("change");
63119 var items = select_default2(null);
63121 function access(selection2) {
63122 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63123 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63124 var list = wrap2.selectAll("ul").data([0]);
63125 list = list.enter().append("ul").attr("class", "rows").merge(list);
63126 items = list.selectAll("li").data(field.keys);
63127 var enter = items.enter().append("li").attr("class", function(d2) {
63128 return "labeled-input preset-access-" + d2;
63130 enter.append("span").attr("class", "label preset-label-access").attr("for", function(d2) {
63131 return "preset-input-access-" + d2;
63132 }).html(function(d2) {
63133 return field.t.html("types." + d2);
63135 enter.append("div").attr("class", "preset-input-access-wrap").append("input").attr("type", "text").attr("class", function(d2) {
63136 return "preset-input-access preset-input-access-" + d2;
63137 }).call(utilNoAuto).each(function(d2) {
63138 select_default2(this).call(
63139 uiCombobox(context, "access-" + d2).data(access.options(d2))
63142 items = items.merge(enter);
63143 wrap2.selectAll(".preset-input-access").on("change", change).on("blur", change);
63145 function change(d3_event, d2) {
63147 var value = context.cleanTagValue(utilGetSetValue(select_default2(this)));
63148 if (!value && typeof _tags[d2] !== "string")
63150 tag[d2] = value || void 0;
63151 dispatch14.call("change", this, tag);
63153 access.options = function(type2) {
63165 if (type2 === "access") {
63166 options2 = options2.filter((v2) => v2 !== "yes" && v2 !== "designated");
63168 if (type2 === "bicycle") {
63169 options2.splice(options2.length - 4, 0, "dismount");
63171 var stringsField = field.resolveReference("stringsCrossReference");
63172 return options2.map(function(option) {
63174 title: stringsField.t("options." + option + ".description"),
63179 const placeholdersByTag = {
63182 foot: "designated",
63183 motor_vehicle: "no"
63187 motor_vehicle: "no",
63193 motor_vehicle: "no"
63196 motor_vehicle: "no",
63197 bicycle: "designated"
63200 motor_vehicle: "no",
63201 horse: "designated"
63205 motor_vehicle: "no",
63211 motor_vehicle: "yes",
63216 motor_vehicle: "yes"
63220 motor_vehicle: "yes",
63226 motor_vehicle: "yes",
63232 motor_vehicle: "yes",
63238 motor_vehicle: "yes",
63244 motor_vehicle: "yes",
63250 motor_vehicle: "yes",
63256 motor_vehicle: "yes",
63261 motor_vehicle: "yes"
63265 motor_vehicle: "yes",
63271 motor_vehicle: "yes",
63277 motor_vehicle: "yes",
63292 motor_vehicle: "no",
63304 motor_vehicle: "no"
63321 motorcycle_barrier: {
63322 motor_vehicle: "no"
63329 access.tags = function(tags) {
63331 utilGetSetValue(items.selectAll(".preset-input-access"), function(d2) {
63332 return typeof tags[d2] === "string" ? tags[d2] : "";
63333 }).classed("mixed", function(d2) {
63334 return tags[d2] && Array.isArray(tags[d2]);
63335 }).attr("title", function(d2) {
63336 return tags[d2] && Array.isArray(tags[d2]) && tags[d2].filter(Boolean).join("\n");
63337 }).attr("placeholder", function(d2) {
63338 if (tags[d2] && Array.isArray(tags[d2])) {
63339 return _t("inspector.multiple_values");
63341 if (d2 === "bicycle" || d2 === "motor_vehicle") {
63342 if (tags.vehicle && typeof tags.vehicle === "string") {
63343 return tags.vehicle;
63346 if (tags.access && typeof tags.access === "string") {
63347 return tags.access;
63349 function getPlaceholdersByTag(key, placeholdersByKey) {
63350 if (typeof tags[key] === "string") {
63351 if (placeholdersByKey[tags[key]] && placeholdersByKey[tags[key]][d2]) {
63352 return placeholdersByKey[tags[key]][d2];
63355 var impliedAccesses = tags[key].filter(Boolean).map(function(val) {
63356 return placeholdersByKey[val] && placeholdersByKey[val][d2];
63357 }).filter(Boolean);
63358 if (impliedAccesses.length === tags[key].length && new Set(impliedAccesses).size === 1) {
63359 return impliedAccesses[0];
63363 for (const key in placeholdersByTag) {
63365 const impliedAccess = getPlaceholdersByTag(key, placeholdersByTag[key]);
63366 if (impliedAccess) {
63367 return impliedAccess;
63371 if (d2 === "access" && !tags.barrier) {
63374 return field.placeholder();
63377 access.focus = function() {
63378 items.selectAll(".preset-input-access").node().focus();
63380 return utilRebind(access, dispatch14, "on");
63383 // modules/ui/fields/address.js
63384 function uiFieldAddress(field, context) {
63385 var dispatch14 = dispatch_default("change");
63386 var _selection = select_default2(null);
63387 var _wrap = select_default2(null);
63388 var addrField = _mainPresetIndex.field("address");
63389 var _entityIDs = [];
63392 var _addressFormats = [{
63394 ["housenumber", "street"],
63395 ["city", "postcode"]
63398 _mainFileFetcher.get("address_formats").then(function(d2) {
63399 _addressFormats = d2;
63400 if (!_selection.empty()) {
63401 _selection.call(address);
63403 }).catch(function() {
63405 function getNear(isAddressable, type2, searchRadius, resultProp) {
63406 var extent = combinedEntityExtent();
63407 var l2 = extent.center();
63408 var box = geoExtent(l2).padByMeters(searchRadius);
63409 var features = context.history().intersects(box).filter(isAddressable).map((d2) => {
63410 let dist = geoSphericalDistance(d2.extent(context.graph()).center(), l2);
63411 if (d2.geometry(context.graph()) === "line") {
63412 var loc = context.projection([
63413 (extent[0][0] + extent[1][0]) / 2,
63414 (extent[0][1] + extent[1][1]) / 2
63416 var choice = geoChooseEdge(context.graph().childNodes(d2), loc, context.projection);
63417 dist = geoSphericalDistance(choice.loc, l2);
63419 const value = resultProp && d2.tags[resultProp] ? d2.tags[resultProp] : d2.tags.name;
63421 if (type2 === "street") {
63422 title = `${addrField.t("placeholders.street")}: ${title}`;
63423 } else if (type2 === "place") {
63424 title = `${addrField.t("placeholders.place")}: ${title}`;
63431 klass: `address-${type2}`
63433 }).sort(function(a2, b2) {
63434 return a2.dist - b2.dist;
63436 return utilArrayUniqBy(features, "value");
63438 function getNearStreets() {
63439 function isAddressable(d2) {
63440 return d2.tags.highway && d2.tags.name && d2.type === "way";
63442 return getNear(isAddressable, "street", 200);
63444 function getNearPlaces() {
63445 function isAddressable(d2) {
63446 if (d2.tags.name) {
63449 if (d2.tags.boundary === "administrative" && d2.tags.admin_level > 8)
63454 return getNear(isAddressable, "place", 200);
63456 function getNearCities() {
63457 function isAddressable(d2) {
63458 if (d2.tags.name) {
63459 if (d2.tags.boundary === "administrative" && d2.tags.admin_level === "8")
63461 if (d2.tags.border_type === "city")
63463 if (d2.tags.place === "city" || d2.tags.place === "town" || d2.tags.place === "village")
63466 if (d2.tags[`${field.key}:city`])
63470 return getNear(isAddressable, "city", 200, `${field.key}:city`);
63472 function getNearPostcodes() {
63473 return [...new Set([].concat(getNearValues("postcode")).concat(getNear((d2) => d2.tags.postal_code, "postcode", 200, "postal_code")))];
63475 function getNearValues(key) {
63476 const tagKey = `${field.key}:${key}`;
63477 function hasTag(d2) {
63478 return _entityIDs.indexOf(d2.id) === -1 && d2.tags[tagKey];
63480 return getNear(hasTag, key, 200, tagKey);
63482 function updateForCountryCode() {
63486 for (var i3 = 0; i3 < _addressFormats.length; i3++) {
63487 var format2 = _addressFormats[i3];
63488 if (!format2.countryCodes) {
63489 addressFormat = format2;
63490 } else if (format2.countryCodes.indexOf(_countryCode) !== -1) {
63491 addressFormat = format2;
63495 var dropdowns = addressFormat.dropdowns || [
63512 var widths = addressFormat.widths || {
63513 housenumber: 1 / 5,
63522 var total = r2.reduce(function(sum, key) {
63523 return sum + (widths[key] || 0.5);
63525 return r2.map(function(key) {
63528 width: (widths[key] || 0.5) / total
63532 var rows = _wrap.selectAll(".addr-row").data(addressFormat.format, function(d2) {
63533 return d2.toString();
63535 rows.exit().remove();
63536 rows.enter().append("div").attr("class", "addr-row").selectAll("input").data(row).enter().append("input").property("type", "text").call(updatePlaceholder).attr("class", function(d2) {
63537 return "addr-" + d2.id;
63538 }).call(utilNoAuto).each(addDropdown).style("width", function(d2) {
63539 return d2.width * 100 + "%";
63541 function addDropdown(d2) {
63542 if (dropdowns.indexOf(d2.id) === -1)
63547 nearValues = getNearStreets;
63550 nearValues = getNearPlaces;
63552 case "street+place":
63553 nearValues = () => [].concat(getNearStreets()).concat(getNearPlaces());
63554 d2.isAutoStreetPlace = true;
63555 d2.id = _tags[`${field.key}:place`] ? "place" : "street";
63558 nearValues = getNearCities;
63561 nearValues = getNearPostcodes;
63564 nearValues = getNearValues;
63566 select_default2(this).call(
63567 uiCombobox(context, `address-${d2.isAutoStreetPlace ? "street-place" : d2.id}`).minItems(1).caseSensitive(true).fetcher(function(typedValue, callback) {
63568 typedValue = typedValue.toLowerCase();
63569 callback(nearValues(d2.id).filter((v2) => v2.value.toLowerCase().indexOf(typedValue) !== -1));
63570 }).on("accept", function(selected) {
63571 if (d2.isAutoStreetPlace) {
63572 d2.id = selected ? selected.type : "street";
63577 _wrap.selectAll("input").on("blur", change()).on("change", change());
63578 _wrap.selectAll("input:not(.combobox-input)").on("input", change(true));
63582 function address(selection2) {
63583 _selection = selection2;
63584 _wrap = selection2.selectAll(".form-field-input-wrap").data([0]);
63585 _wrap = _wrap.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(_wrap);
63586 var extent = combinedEntityExtent();
63589 if (context.inIntro()) {
63590 countryCode = _t("intro.graph.countrycode");
63592 var center = extent.center();
63593 countryCode = iso1A2Code(center);
63596 _countryCode = countryCode.toLowerCase();
63597 updateForCountryCode();
63601 function change(onInput) {
63602 return function() {
63605 _wrap.selectAll("input").each(function(subfield) {
63606 var key = field.key + ":" + subfield.id;
63607 var value = this.value;
63609 value = context.cleanTagValue(value);
63610 if (Array.isArray(_tags[key]) && !value)
63612 if (subfield.isAutoStreetPlace) {
63613 if (subfield.id === "street") {
63614 tags[`${field.key}:place`] = void 0;
63615 } else if (subfield.id === "place") {
63616 tags[`${field.key}:street`] = void 0;
63619 tags[key] = value || void 0;
63621 Object.keys(tags).filter((k2) => tags[k2]).forEach((k2) => _tags[k2] = tags[k2]);
63622 dispatch14.call("change", this, tags, onInput);
63626 function updatePlaceholder(inputSelection) {
63627 return inputSelection.attr("placeholder", function(subfield) {
63628 if (_tags && Array.isArray(_tags[field.key + ":" + subfield.id])) {
63629 return _t("inspector.multiple_values");
63631 if (subfield.isAutoStreetPlace) {
63632 return `${getLocalPlaceholder("street")} / ${getLocalPlaceholder("place")}`;
63634 return getLocalPlaceholder(subfield.id);
63637 function getLocalPlaceholder(key) {
63638 if (_countryCode) {
63639 var localkey = key + "!" + _countryCode;
63640 var tkey = addrField.hasTextForStringId("placeholders." + localkey) ? localkey : key;
63641 return addrField.t("placeholders." + tkey);
63644 function updateTags(tags) {
63645 utilGetSetValue(_wrap.selectAll("input"), (subfield) => {
63647 if (subfield.isAutoStreetPlace) {
63648 const streetKey = `${field.key}:street`;
63649 const placeKey = `${field.key}:place`;
63650 if (tags[streetKey] !== void 0 || tags[placeKey] === void 0) {
63651 val = tags[streetKey];
63652 subfield.id = "street";
63654 val = tags[placeKey];
63655 subfield.id = "place";
63658 val = tags[`${field.key}:${subfield.id}`];
63660 return typeof val === "string" ? val : "";
63661 }).attr("title", function(subfield) {
63662 var val = tags[field.key + ":" + subfield.id];
63663 return val && Array.isArray(val) ? val.filter(Boolean).join("\n") : void 0;
63664 }).classed("mixed", function(subfield) {
63665 return Array.isArray(tags[field.key + ":" + subfield.id]);
63666 }).call(updatePlaceholder);
63668 function combinedEntityExtent() {
63669 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
63671 address.entityIDs = function(val) {
63672 if (!arguments.length)
63677 address.tags = function(tags) {
63681 address.focus = function() {
63682 var node = _wrap.selectAll("input").node();
63686 return utilRebind(address, dispatch14, "on");
63689 // modules/ui/fields/directional_combo.js
63690 function uiFieldDirectionalCombo(field, context) {
63691 var dispatch14 = dispatch_default("change");
63692 var items = select_default2(null);
63693 var wrap2 = select_default2(null);
63696 if (field.type === "cycleway") {
63699 key: field.keys[0],
63700 keys: field.keys.slice(1)
63703 function directionalCombo(selection2) {
63704 function stripcolon(s2) {
63705 return s2.replace(":", "");
63707 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63708 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63709 var div = wrap2.selectAll("ul").data([0]);
63710 div = div.enter().append("ul").attr("class", "rows").merge(div);
63711 items = div.selectAll("li").data(field.keys);
63712 var enter = items.enter().append("li").attr("class", function(d2) {
63713 return "labeled-input preset-directionalcombo-" + stripcolon(d2);
63715 enter.append("span").attr("class", "label preset-label-directionalcombo").attr("for", function(d2) {
63716 return "preset-input-directionalcombo-" + stripcolon(d2);
63717 }).html(function(d2) {
63718 return field.t.html("types." + d2);
63720 enter.append("div").attr("class", "preset-input-directionalcombo-wrap form-field-input-wrap").each(function(key) {
63726 const combo = uiFieldCombo(subField, context);
63727 combo.on("change", (t2) => change(key, t2[key]));
63728 _combos[key] = combo;
63729 select_default2(this).call(combo);
63731 items = items.merge(enter);
63732 wrap2.selectAll(".preset-input-directionalcombo").on("change", change).on("blur", change);
63734 function change(key, newValue) {
63735 const commonKey = field.key;
63736 const otherKey = key === field.keys[0] ? field.keys[1] : field.keys[0];
63737 dispatch14.call("change", this, (tags) => {
63738 const otherValue = tags[otherKey] || tags[commonKey];
63739 if (newValue === otherValue) {
63740 tags[commonKey] = newValue;
63742 delete tags[otherKey];
63744 tags[key] = newValue;
63745 delete tags[commonKey];
63746 tags[otherKey] = otherValue;
63751 directionalCombo.tags = function(tags) {
63753 const commonKey = field.key;
63754 for (let key in _combos) {
63755 const uniqueValues = [...new Set([].concat(_tags[commonKey]).concat(_tags[key]).filter(Boolean))];
63756 _combos[key].tags({ [key]: uniqueValues.length > 1 ? uniqueValues : uniqueValues[0] });
63759 directionalCombo.focus = function() {
63760 var node = wrap2.selectAll("input").node();
63764 return utilRebind(directionalCombo, dispatch14, "on");
63767 // modules/ui/fields/lanes.js
63768 function uiFieldLanes(field, context) {
63769 var dispatch14 = dispatch_default("change");
63770 var LANE_WIDTH = 40;
63771 var LANE_HEIGHT = 200;
63772 var _entityIDs = [];
63773 function lanes(selection2) {
63774 var lanesData = context.entity(_entityIDs[0]).lanes();
63775 if (!context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode) {
63776 selection2.call(lanes.off);
63779 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63780 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63781 var surface = wrap2.selectAll(".surface").data([0]);
63782 var d2 = utilGetDimensions(wrap2);
63783 var freeSpace = d2[0] - lanesData.lanes.length * LANE_WIDTH * 1.5 + LANE_WIDTH * 0.5;
63784 surface = surface.enter().append("svg").attr("width", d2[0]).attr("height", 300).attr("class", "surface").merge(surface);
63785 var lanesSelection = surface.selectAll(".lanes").data([0]);
63786 lanesSelection = lanesSelection.enter().append("g").attr("class", "lanes").merge(lanesSelection);
63787 lanesSelection.attr("transform", function() {
63788 return "translate(" + freeSpace / 2 + ", 0)";
63790 var lane = lanesSelection.selectAll(".lane").data(lanesData.lanes);
63791 lane.exit().remove();
63792 var enter = lane.enter().append("g").attr("class", "lane");
63793 enter.append("g").append("rect").attr("y", 50).attr("width", LANE_WIDTH).attr("height", LANE_HEIGHT);
63794 enter.append("g").attr("class", "forward").append("text").attr("y", 40).attr("x", 14).text("\u25B2");
63795 enter.append("g").attr("class", "bothways").append("text").attr("y", 40).attr("x", 14).text("\u25B2\u25BC");
63796 enter.append("g").attr("class", "backward").append("text").attr("y", 40).attr("x", 14).text("\u25BC");
63797 lane = lane.merge(enter);
63798 lane.attr("transform", function(d4) {
63799 return "translate(" + LANE_WIDTH * d4.index * 1.5 + ", 0)";
63801 lane.select(".forward").style("visibility", function(d4) {
63802 return d4.direction === "forward" ? "visible" : "hidden";
63804 lane.select(".bothways").style("visibility", function(d4) {
63805 return d4.direction === "bothways" ? "visible" : "hidden";
63807 lane.select(".backward").style("visibility", function(d4) {
63808 return d4.direction === "backward" ? "visible" : "hidden";
63811 lanes.entityIDs = function(val) {
63814 lanes.tags = function() {
63816 lanes.focus = function() {
63818 lanes.off = function() {
63820 return utilRebind(lanes, dispatch14, "on");
63822 uiFieldLanes.supportsMultiselection = false;
63824 // modules/ui/fields/localized.js
63825 var _languagesArray = [];
63826 function uiFieldLocalized(field, context) {
63827 var dispatch14 = dispatch_default("change", "input");
63828 var wikipedia = services.wikipedia;
63829 var input = select_default2(null);
63830 var localizedInputs = select_default2(null);
63831 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
63834 _mainFileFetcher.get("languages").then(loadLanguagesArray).catch(function() {
63836 var _territoryLanguages = {};
63837 _mainFileFetcher.get("territory_languages").then(function(d2) {
63838 _territoryLanguages = d2;
63839 }).catch(function() {
63841 var langCombo = uiCombobox(context, "localized-lang").fetcher(fetchLanguages).minItems(0);
63842 var _selection = select_default2(null);
63843 var _multilingual = [];
63844 var _buttonTip = uiTooltip().title(() => _t.append("translate.translate")).placement("left");
63846 var _entityIDs = [];
63847 function loadLanguagesArray(dataLanguages) {
63848 if (_languagesArray.length !== 0)
63850 var replacements = {
63852 // in OSM, `sr` implies Cyrillic
63854 // `sr-Cyrl` isn't used in OSM
63856 for (var code in dataLanguages) {
63857 if (replacements[code] === false)
63859 var metaCode = code;
63860 if (replacements[code])
63861 metaCode = replacements[code];
63862 _languagesArray.push({
63863 localName: _mainLocalizer.languageName(metaCode, { localOnly: true }),
63864 nativeName: dataLanguages[metaCode].nativeName,
63866 label: _mainLocalizer.languageName(metaCode)
63870 function calcLocked() {
63871 var isLocked = field.id === "name" && _entityIDs.length && _entityIDs.some(function(entityID) {
63872 var entity = context.graph().hasEntity(entityID);
63875 if (entity.tags.wikidata)
63877 if (entity.tags["name:etymology:wikidata"])
63879 var preset = _mainPresetIndex.match(entity, context.graph());
63881 var isSuggestion = preset.suggestion;
63882 var fields = preset.fields(entity.extent(context.graph()).center());
63883 var showsBrandField = fields.some(function(d2) {
63884 return d2.id === "brand";
63886 var showsOperatorField = fields.some(function(d2) {
63887 return d2.id === "operator";
63889 var setsName = preset.addTags.name;
63890 var setsBrandWikidata = preset.addTags["brand:wikidata"];
63891 var setsOperatorWikidata = preset.addTags["operator:wikidata"];
63892 return isSuggestion && setsName && (setsBrandWikidata && !showsBrandField || setsOperatorWikidata && !showsOperatorField);
63896 field.locked(isLocked);
63898 function calcMultilingual(tags) {
63899 var existingLangsOrdered = _multilingual.map(function(item2) {
63902 var existingLangs = new Set(existingLangsOrdered.filter(Boolean));
63903 for (var k2 in tags) {
63904 var m2 = k2.match(/^(.*):([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?)$/);
63905 if (m2 && m2[1] === field.key && m2[2]) {
63906 var item = { lang: m2[2], value: tags[k2] };
63907 if (existingLangs.has(item.lang)) {
63908 _multilingual[existingLangsOrdered.indexOf(item.lang)].value = item.value;
63909 existingLangs.delete(item.lang);
63911 _multilingual.push(item);
63915 _multilingual.forEach(function(item2) {
63916 if (item2.lang && existingLangs.has(item2.lang)) {
63921 function localized(selection2) {
63922 _selection = selection2;
63924 var isLocked = field.locked();
63925 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63926 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63927 input = wrap2.selectAll(".localized-main").data([0]);
63928 input = input.enter().append("input").attr("type", "text").attr("id", field.domId).attr("class", "localized-main").call(utilNoAuto).merge(input);
63929 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
63930 wrap2.call(_lengthIndicator);
63931 var translateButton = wrap2.selectAll(".localized-add").data([0]);
63932 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);
63933 translateButton.classed("disabled", !!isLocked).call(isLocked ? _buttonTip.destroy : _buttonTip).on("click", addNew);
63934 if (_tags && !_multilingual.length) {
63935 calcMultilingual(_tags);
63937 localizedInputs = selection2.selectAll(".localized-multilingual").data([0]);
63938 localizedInputs = localizedInputs.enter().append("div").attr("class", "localized-multilingual").merge(localizedInputs);
63939 localizedInputs.call(renderMultilingual);
63940 localizedInputs.selectAll("button, input").classed("disabled", !!isLocked).attr("readonly", isLocked || null);
63941 selection2.selectAll(".combobox-caret").classed("nope", true);
63942 function addNew(d3_event) {
63943 d3_event.preventDefault();
63944 if (field.locked())
63946 var defaultLang = _mainLocalizer.languageCode().toLowerCase();
63947 var langExists = _multilingual.find(function(datum2) {
63948 return datum2.lang === defaultLang;
63950 var isLangEn = defaultLang.indexOf("en") > -1;
63951 if (isLangEn || langExists) {
63953 langExists = _multilingual.find(function(datum2) {
63954 return datum2.lang === defaultLang;
63958 _multilingual.unshift({ lang: defaultLang, value: "" });
63959 localizedInputs.call(renderMultilingual);
63962 function change(onInput) {
63963 return function(d3_event) {
63964 if (field.locked()) {
63965 d3_event.preventDefault();
63968 var val = utilGetSetValue(select_default2(this));
63970 val = context.cleanTagValue(val);
63971 if (!val && Array.isArray(_tags[field.key]))
63974 t2[field.key] = val || void 0;
63975 dispatch14.call("change", this, t2, onInput);
63979 function key(lang) {
63980 return field.key + ":" + lang;
63982 function changeLang(d3_event, d2) {
63984 var lang = utilGetSetValue(select_default2(this)).toLowerCase();
63985 var language = _languagesArray.find(function(d4) {
63986 return d4.label.toLowerCase() === lang || d4.localName && d4.localName.toLowerCase() === lang || d4.nativeName && d4.nativeName.toLowerCase() === lang;
63989 lang = language.code;
63990 if (d2.lang && d2.lang !== lang) {
63991 tags[key(d2.lang)] = void 0;
63993 var newKey = lang && context.cleanTagKey(key(lang));
63994 var value = utilGetSetValue(select_default2(this.parentNode).selectAll(".localized-value"));
63995 if (newKey && value) {
63996 tags[newKey] = value;
63997 } else if (newKey && _wikiTitles && _wikiTitles[d2.lang]) {
63998 tags[newKey] = _wikiTitles[d2.lang];
64001 dispatch14.call("change", this, tags);
64003 function changeValue(d3_event, d2) {
64006 var value = context.cleanTagValue(utilGetSetValue(select_default2(this))) || void 0;
64007 if (!value && Array.isArray(d2.value))
64010 t2[key(d2.lang)] = value;
64012 dispatch14.call("change", this, t2);
64014 function fetchLanguages(value, cb) {
64015 var v2 = value.toLowerCase();
64016 var langCodes = [_mainLocalizer.localeCode(), _mainLocalizer.languageCode()];
64017 if (_countryCode && _territoryLanguages[_countryCode]) {
64018 langCodes = langCodes.concat(_territoryLanguages[_countryCode]);
64020 var langItems = [];
64021 langCodes.forEach(function(code) {
64022 var langItem = _languagesArray.find(function(item) {
64023 return item.code === code;
64026 langItems.push(langItem);
64028 langItems = utilArrayUniq(langItems.concat(_languagesArray));
64029 cb(langItems.filter(function(d2) {
64030 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;
64031 }).map(function(d2) {
64032 return { value: d2.label };
64035 function renderMultilingual(selection2) {
64036 var entries = selection2.selectAll("div.entry").data(_multilingual, function(d2) {
64039 entries.exit().style("top", "0").style("max-height", "240px").transition().duration(200).style("opacity", "0").style("max-height", "0px").remove();
64040 var entriesEnter = entries.enter().append("div").attr("class", "entry").each(function(_2, index) {
64041 var wrap2 = select_default2(this);
64042 var domId = utilUniqueDomId(index);
64043 var label = wrap2.append("label").attr("class", "field-label").attr("for", domId);
64044 var text2 = label.append("span").attr("class", "label-text");
64045 text2.append("span").attr("class", "label-textvalue").call(_t.append("translate.localized_translation_label"));
64046 text2.append("span").attr("class", "label-textannotation");
64047 label.append("button").attr("class", "remove-icon-multilingual").attr("title", _t("icons.remove")).on("click", function(d3_event, d2) {
64048 if (field.locked())
64050 d3_event.preventDefault();
64051 _multilingual.splice(_multilingual.indexOf(d2), 1);
64052 var langKey = d2.lang && key(d2.lang);
64053 if (langKey && langKey in _tags) {
64054 delete _tags[langKey];
64056 t2[langKey] = void 0;
64057 dispatch14.call("change", this, t2);
64060 renderMultilingual(selection2);
64061 }).call(svgIcon("#iD-operation-delete"));
64062 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);
64063 wrap2.append("input").attr("type", "text").attr("class", "localized-value").on("blur", changeValue).on("change", changeValue);
64065 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() {
64066 select_default2(this).style("max-height", "").style("overflow", "visible");
64068 entries = entries.merge(entriesEnter);
64070 entries.classed("present", true);
64071 utilGetSetValue(entries.select(".localized-lang"), function(d2) {
64072 var langItem = _languagesArray.find(function(item) {
64073 return item.code === d2.lang;
64076 return langItem.label;
64079 utilGetSetValue(entries.select(".localized-value"), function(d2) {
64080 return typeof d2.value === "string" ? d2.value : "";
64081 }).attr("title", function(d2) {
64082 return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : null;
64083 }).attr("placeholder", function(d2) {
64084 return Array.isArray(d2.value) ? _t("inspector.multiple_values") : _t("translate.localized_translation_name");
64085 }).classed("mixed", function(d2) {
64086 return Array.isArray(d2.value);
64089 localized.tags = function(tags) {
64091 if (typeof tags.wikipedia === "string" && !_wikiTitles) {
64093 var wm = tags.wikipedia.match(/([^:]+):(.+)/);
64094 if (wm && wm[0] && wm[1]) {
64095 wikipedia.translations(wm[1], wm[2], function(err, d2) {
64102 var isMixed = Array.isArray(tags[field.key]);
64103 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);
64104 calcMultilingual(tags);
64105 _selection.call(localized);
64107 _lengthIndicator.update(tags[field.key]);
64110 localized.focus = function() {
64111 input.node().focus();
64113 localized.entityIDs = function(val) {
64114 if (!arguments.length)
64117 _multilingual = [];
64121 function loadCountryCode() {
64122 var extent = combinedEntityExtent();
64123 var countryCode = extent && iso1A2Code(extent.center());
64124 _countryCode = countryCode && countryCode.toLowerCase();
64126 function combinedEntityExtent() {
64127 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64129 return utilRebind(localized, dispatch14, "on");
64132 // modules/ui/fields/roadheight.js
64133 function uiFieldRoadheight(field, context) {
64134 var dispatch14 = dispatch_default("change");
64135 var primaryUnitInput = select_default2(null);
64136 var primaryInput = select_default2(null);
64137 var secondaryInput = select_default2(null);
64138 var secondaryUnitInput = select_default2(null);
64139 var _entityIDs = [];
64142 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
64143 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
64144 var primaryUnits = [
64147 title: _t("inspector.roadheight.meter")
64151 title: _t("inspector.roadheight.foot")
64154 var unitCombo = uiCombobox(context, "roadheight-unit").data(primaryUnits);
64155 function roadheight(selection2) {
64156 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64157 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64158 primaryInput = wrap2.selectAll("input.roadheight-number").data([0]);
64159 primaryInput = primaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-number").attr("id", field.domId).call(utilNoAuto).merge(primaryInput);
64160 primaryInput.on("change", change).on("blur", change);
64161 var loc = combinedEntityExtent().center();
64162 _isImperial = roadHeightUnit(loc) === "ft";
64163 primaryUnitInput = wrap2.selectAll("input.roadheight-unit").data([0]);
64164 primaryUnitInput = primaryUnitInput.enter().append("input").attr("type", "text").attr("class", "roadheight-unit").call(unitCombo).merge(primaryUnitInput);
64165 primaryUnitInput.on("blur", changeUnits).on("change", changeUnits);
64166 secondaryInput = wrap2.selectAll("input.roadheight-secondary-number").data([0]);
64167 secondaryInput = secondaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-secondary-number").call(utilNoAuto).merge(secondaryInput);
64168 secondaryInput.on("change", change).on("blur", change);
64169 secondaryUnitInput = wrap2.selectAll("input.roadheight-secondary-unit").data([0]);
64170 secondaryUnitInput = secondaryUnitInput.enter().append("input").attr("type", "text").call(utilNoAuto).classed("disabled", true).classed("roadheight-secondary-unit", true).attr("readonly", "readonly").merge(secondaryUnitInput);
64171 function changeUnits() {
64172 var primaryUnit = utilGetSetValue(primaryUnitInput);
64173 if (primaryUnit === "m") {
64174 _isImperial = false;
64175 } else if (primaryUnit === "ft") {
64176 _isImperial = true;
64178 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
64179 setUnitSuggestions();
64183 function setUnitSuggestions() {
64184 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
64186 function change() {
64188 var primaryValue = utilGetSetValue(primaryInput).trim();
64189 var secondaryValue = utilGetSetValue(secondaryInput).trim();
64190 if (!primaryValue && !secondaryValue && Array.isArray(_tags[field.key]))
64192 if (!primaryValue && !secondaryValue) {
64193 tag[field.key] = void 0;
64195 var rawPrimaryValue = likelyRawNumberFormat.test(primaryValue) ? parseFloat(primaryValue) : parseLocaleFloat(primaryValue);
64196 if (isNaN(rawPrimaryValue))
64197 rawPrimaryValue = primaryValue;
64198 var rawSecondaryValue = likelyRawNumberFormat.test(secondaryValue) ? parseFloat(secondaryValue) : parseLocaleFloat(secondaryValue);
64199 if (isNaN(rawSecondaryValue))
64200 rawSecondaryValue = secondaryValue;
64201 if (isNaN(rawPrimaryValue) || isNaN(rawSecondaryValue) || !_isImperial) {
64202 tag[field.key] = context.cleanTagValue(rawPrimaryValue);
64204 if (rawPrimaryValue !== "") {
64205 rawPrimaryValue = rawPrimaryValue + "'";
64207 if (rawSecondaryValue !== "") {
64208 rawSecondaryValue = rawSecondaryValue + '"';
64210 tag[field.key] = context.cleanTagValue(rawPrimaryValue + rawSecondaryValue);
64213 dispatch14.call("change", this, tag);
64215 roadheight.tags = function(tags) {
64217 var primaryValue = tags[field.key];
64218 var secondaryValue;
64219 var isMixed = Array.isArray(primaryValue);
64221 if (primaryValue && (primaryValue.indexOf("'") >= 0 || primaryValue.indexOf('"') >= 0)) {
64222 secondaryValue = primaryValue.match(/(-?[\d.]+)"/);
64223 if (secondaryValue !== null) {
64224 secondaryValue = formatFloat(parseFloat(secondaryValue[1]));
64226 primaryValue = primaryValue.match(/(-?[\d.]+)'/);
64227 if (primaryValue !== null) {
64228 primaryValue = formatFloat(parseFloat(primaryValue[1]));
64230 _isImperial = true;
64231 } else if (primaryValue) {
64232 var rawValue = primaryValue;
64233 primaryValue = parseFloat(rawValue);
64234 if (isNaN(primaryValue)) {
64235 primaryValue = rawValue;
64237 primaryValue = formatFloat(primaryValue);
64239 _isImperial = false;
64242 setUnitSuggestions();
64243 var inchesPlaceholder = formatFloat(0);
64244 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);
64245 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");
64246 secondaryUnitInput.attr("value", _isImperial ? _t("inspector.roadheight.inch") : null);
64248 roadheight.focus = function() {
64249 primaryInput.node().focus();
64251 roadheight.entityIDs = function(val) {
64254 function combinedEntityExtent() {
64255 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64257 return utilRebind(roadheight, dispatch14, "on");
64260 // modules/ui/fields/roadspeed.js
64261 function uiFieldRoadspeed(field, context) {
64262 var dispatch14 = dispatch_default("change");
64263 var unitInput = select_default2(null);
64264 var input = select_default2(null);
64265 var _entityIDs = [];
64268 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
64269 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
64270 var speedCombo = uiCombobox(context, "roadspeed");
64271 var unitCombo = uiCombobox(context, "roadspeed-unit").data(["km/h", "mph"].map(comboValues));
64272 var metricValues = [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120];
64273 var imperialValues = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80];
64274 function roadspeed(selection2) {
64275 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64276 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64277 input = wrap2.selectAll("input.roadspeed-number").data([0]);
64278 input = input.enter().append("input").attr("type", "text").attr("class", "roadspeed-number").attr("id", field.domId).call(utilNoAuto).call(speedCombo).merge(input);
64279 input.on("change", change).on("blur", change);
64280 var loc = combinedEntityExtent().center();
64281 _isImperial = roadSpeedUnit(loc) === "mph";
64282 unitInput = wrap2.selectAll("input.roadspeed-unit").data([0]);
64283 unitInput = unitInput.enter().append("input").attr("type", "text").attr("class", "roadspeed-unit").attr("aria-label", _t("inspector.speed_unit")).call(unitCombo).merge(unitInput);
64284 unitInput.on("blur", changeUnits).on("change", changeUnits);
64285 function changeUnits() {
64286 var unit2 = utilGetSetValue(unitInput);
64287 if (unit2 === "km/h") {
64288 _isImperial = false;
64289 } else if (unit2 === "mph") {
64290 _isImperial = true;
64292 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
64293 setUnitSuggestions();
64297 function setUnitSuggestions() {
64298 speedCombo.data((_isImperial ? imperialValues : metricValues).map(comboValues));
64299 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
64301 function comboValues(d2) {
64303 value: formatFloat(d2),
64304 title: formatFloat(d2)
64307 function change() {
64309 var value = utilGetSetValue(input).trim();
64310 if (!value && Array.isArray(_tags[field.key]))
64313 tag[field.key] = void 0;
64315 var rawValue = likelyRawNumberFormat.test(value) ? parseFloat(value) : parseLocaleFloat(value);
64316 if (isNaN(rawValue))
64318 if (isNaN(rawValue) || !_isImperial) {
64319 tag[field.key] = context.cleanTagValue(rawValue);
64321 tag[field.key] = context.cleanTagValue(rawValue + " mph");
64324 dispatch14.call("change", this, tag);
64326 roadspeed.tags = function(tags) {
64328 var rawValue = tags[field.key];
64329 var value = rawValue;
64330 var isMixed = Array.isArray(value);
64332 if (rawValue && rawValue.indexOf("mph") >= 0) {
64333 _isImperial = true;
64334 } else if (rawValue) {
64335 _isImperial = false;
64337 value = parseInt(value, 10);
64338 if (isNaN(value)) {
64341 value = formatFloat(value);
64344 setUnitSuggestions();
64345 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);
64347 roadspeed.focus = function() {
64348 input.node().focus();
64350 roadspeed.entityIDs = function(val) {
64353 function combinedEntityExtent() {
64354 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64356 return utilRebind(roadspeed, dispatch14, "on");
64359 // modules/ui/fields/radio.js
64360 function uiFieldRadio(field, context) {
64361 var dispatch14 = dispatch_default("change");
64362 var placeholder = select_default2(null);
64363 var wrap2 = select_default2(null);
64364 var labels = select_default2(null);
64365 var radios = select_default2(null);
64366 var radioData = (field.options || field.keys).slice();
64370 var _entityIDs = [];
64371 function selectedKey() {
64372 var node = wrap2.selectAll(".form-field-input-radio label.active input");
64373 return !node.empty() && node.datum();
64375 function radio(selection2) {
64376 selection2.classed("preset-radio", true);
64377 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64378 var enter = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-radio");
64379 enter.append("span").attr("class", "placeholder");
64380 wrap2 = wrap2.merge(enter);
64381 placeholder = wrap2.selectAll(".placeholder");
64382 labels = wrap2.selectAll("label").data(radioData);
64383 enter = labels.enter().append("label");
64384 var stringsField = field.resolveReference("stringsCrossReference");
64385 enter.append("input").attr("type", "radio").attr("name", field.id).attr("value", function(d2) {
64386 return stringsField.t("options." + d2, { "default": d2 });
64387 }).attr("checked", false);
64388 enter.append("span").each(function(d2) {
64389 stringsField.t.append("options." + d2, { "default": d2 })(select_default2(this));
64391 labels = labels.merge(enter);
64392 radios = labels.selectAll("input").on("change", changeRadio);
64394 function structureExtras(selection2, tags) {
64395 var selected = selectedKey() || tags.layer !== void 0;
64396 var type2 = _mainPresetIndex.field(selected);
64397 var layer = _mainPresetIndex.field("layer");
64398 var showLayer = selected === "bridge" || selected === "tunnel" || tags.layer !== void 0;
64399 var extrasWrap = selection2.selectAll(".structure-extras-wrap").data(selected ? [0] : []);
64400 extrasWrap.exit().remove();
64401 extrasWrap = extrasWrap.enter().append("div").attr("class", "structure-extras-wrap").merge(extrasWrap);
64402 var list = extrasWrap.selectAll("ul").data([0]);
64403 list = list.enter().append("ul").attr("class", "rows").merge(list);
64405 if (!typeField || typeField.id !== selected) {
64406 typeField = uiField(context, type2, _entityIDs, { wrap: false }).on("change", changeType);
64408 typeField.tags(tags);
64412 var typeItem = list.selectAll(".structure-type-item").data(typeField ? [typeField] : [], function(d2) {
64415 typeItem.exit().remove();
64416 var typeEnter = typeItem.enter().insert("li", ":first-child").attr("class", "labeled-input structure-type-item");
64417 typeEnter.append("span").attr("class", "label structure-label-type").attr("for", "preset-input-" + selected).call(_t.append("inspector.radio.structure.type"));
64418 typeEnter.append("div").attr("class", "structure-input-type-wrap");
64419 typeItem = typeItem.merge(typeEnter);
64421 typeItem.selectAll(".structure-input-type-wrap").call(typeField.render);
64423 if (layer && showLayer) {
64425 layerField = uiField(context, layer, _entityIDs, { wrap: false }).on("change", changeLayer);
64427 layerField.tags(tags);
64428 field.keys = utilArrayUnion(field.keys, ["layer"]);
64431 field.keys = field.keys.filter(function(k2) {
64432 return k2 !== "layer";
64435 var layerItem = list.selectAll(".structure-layer-item").data(layerField ? [layerField] : []);
64436 layerItem.exit().remove();
64437 var layerEnter = layerItem.enter().append("li").attr("class", "labeled-input structure-layer-item");
64438 layerEnter.append("span").attr("class", "label structure-label-layer").attr("for", "preset-input-layer").call(_t.append("inspector.radio.structure.layer"));
64439 layerEnter.append("div").attr("class", "structure-input-layer-wrap");
64440 layerItem = layerItem.merge(layerEnter);
64442 layerItem.selectAll(".structure-input-layer-wrap").call(layerField.render);
64445 function changeType(t2, onInput) {
64446 var key = selectedKey();
64450 if (val !== "no") {
64451 _oldType[key] = val;
64453 if (field.type === "structureRadio") {
64454 if (val === "no" || key !== "bridge" && key !== "tunnel" || key === "tunnel" && val === "building_passage") {
64457 if (t2.layer === void 0) {
64458 if (key === "bridge" && val !== "no") {
64461 if (key === "tunnel" && val !== "no" && val !== "building_passage") {
64466 dispatch14.call("change", this, t2, onInput);
64468 function changeLayer(t2, onInput) {
64469 if (t2.layer === "0") {
64472 dispatch14.call("change", this, t2, onInput);
64474 function changeRadio() {
64478 t2[field.key] = void 0;
64480 radios.each(function(d2) {
64481 var active = select_default2(this).property("checked");
64486 t2[field.key] = d2;
64488 var val = _oldType[activeKey] || "yes";
64489 t2[d2] = active ? val : void 0;
64492 if (field.type === "structureRadio") {
64493 if (activeKey === "bridge") {
64495 } else if (activeKey === "tunnel" && t2.tunnel !== "building_passage") {
64501 dispatch14.call("change", this, t2);
64503 radio.tags = function(tags) {
64504 function isOptionChecked(d2) {
64506 return tags[field.key] === d2;
64508 return !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
64510 function isMixed(d2) {
64512 return Array.isArray(tags[field.key]) && tags[field.key].includes(d2);
64514 return Array.isArray(tags[d2]);
64516 radios.property("checked", function(d2) {
64517 return isOptionChecked(d2) && (field.key || field.options.filter(isOptionChecked).length === 1);
64519 labels.classed("active", function(d2) {
64521 return Array.isArray(tags[field.key]) && tags[field.key].includes(d2) || tags[field.key] === d2;
64523 return Array.isArray(tags[d2]) && tags[d2].some((v2) => typeof v2 === "string" && v2.toLowerCase() !== "no") || !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
64524 }).classed("mixed", isMixed).attr("title", function(d2) {
64525 return isMixed(d2) ? _t("inspector.unshared_value_tooltip") : null;
64527 var selection2 = radios.filter(function() {
64528 return this.checked;
64530 if (selection2.empty()) {
64531 placeholder.text("");
64532 placeholder.call(_t.append("inspector.none"));
64534 placeholder.text(selection2.attr("value"));
64535 _oldType[selection2.datum()] = tags[selection2.datum()];
64537 if (field.type === "structureRadio") {
64538 if (!!tags.waterway && !_oldType.tunnel) {
64539 _oldType.tunnel = "culvert";
64541 wrap2.call(structureExtras, tags);
64544 radio.focus = function() {
64545 radios.node().focus();
64547 radio.entityIDs = function(val) {
64548 if (!arguments.length)
64554 radio.isAllowed = function() {
64555 return _entityIDs.length === 1;
64557 return utilRebind(radio, dispatch14, "on");
64560 // modules/ui/fields/restrictions.js
64561 function uiFieldRestrictions(field, context) {
64562 var dispatch14 = dispatch_default("change");
64563 var breathe = behaviorBreathe(context);
64564 corePreferences("turn-restriction-via-way", null);
64565 var storedViaWay = corePreferences("turn-restriction-via-way0");
64566 var storedDistance = corePreferences("turn-restriction-distance");
64567 var _maxViaWay = storedViaWay !== null ? +storedViaWay : 0;
64568 var _maxDistance = storedDistance ? +storedDistance : 30;
64569 var _initialized3 = false;
64570 var _parent = select_default2(null);
64571 var _container = select_default2(null);
64578 function restrictions(selection2) {
64579 _parent = selection2;
64580 if (_vertexID && (context.graph() !== _graph || !_intersection)) {
64581 _graph = context.graph();
64582 _intersection = osmIntersection(_graph, _vertexID, _maxDistance);
64584 var isOK = _intersection && _intersection.vertices.length && // has vertices
64585 _intersection.vertices.filter(function(vertex) {
64586 return vertex.id === _vertexID;
64587 }).length && _intersection.ways.length > 2 && // has more than 2 ways
64588 _intersection.ways.filter(function(way) {
64591 select_default2(selection2.node().parentNode).classed("hide", !isOK);
64592 if (!isOK || !context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode || !selection2.node().parentNode.parentNode) {
64593 selection2.call(restrictions.off);
64596 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64597 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64598 var container = wrap2.selectAll(".restriction-container").data([0]);
64599 var containerEnter = container.enter().append("div").attr("class", "restriction-container");
64600 containerEnter.append("div").attr("class", "restriction-help");
64601 _container = containerEnter.merge(container).call(renderViewer);
64602 var controls = wrap2.selectAll(".restriction-controls").data([0]);
64603 controls.enter().append("div").attr("class", "restriction-controls-container").append("div").attr("class", "restriction-controls").merge(controls).call(renderControls);
64605 function renderControls(selection2) {
64606 var distControl = selection2.selectAll(".restriction-distance").data([0]);
64607 distControl.exit().remove();
64608 var distControlEnter = distControl.enter().append("div").attr("class", "restriction-control restriction-distance");
64609 distControlEnter.append("span").attr("class", "restriction-control-label restriction-distance-label").call(_t.append("restriction.controls.distance", { suffix: ":" }));
64610 distControlEnter.append("input").attr("class", "restriction-distance-input").attr("type", "range").attr("min", "20").attr("max", "50").attr("step", "5");
64611 distControlEnter.append("span").attr("class", "restriction-distance-text");
64612 selection2.selectAll(".restriction-distance-input").property("value", _maxDistance).on("input", function() {
64613 var val = select_default2(this).property("value");
64614 _maxDistance = +val;
64615 _intersection = null;
64616 _container.selectAll(".layer-osm .layer-turns *").remove();
64617 corePreferences("turn-restriction-distance", _maxDistance);
64618 _parent.call(restrictions);
64620 selection2.selectAll(".restriction-distance-text").call(displayMaxDistance(_maxDistance));
64621 var viaControl = selection2.selectAll(".restriction-via-way").data([0]);
64622 viaControl.exit().remove();
64623 var viaControlEnter = viaControl.enter().append("div").attr("class", "restriction-control restriction-via-way");
64624 viaControlEnter.append("span").attr("class", "restriction-control-label restriction-via-way-label").call(_t.append("restriction.controls.via", { suffix: ":" }));
64625 viaControlEnter.append("input").attr("class", "restriction-via-way-input").attr("type", "range").attr("min", "0").attr("max", "2").attr("step", "1");
64626 viaControlEnter.append("span").attr("class", "restriction-via-way-text");
64627 selection2.selectAll(".restriction-via-way-input").property("value", _maxViaWay).on("input", function() {
64628 var val = select_default2(this).property("value");
64630 _container.selectAll(".layer-osm .layer-turns *").remove();
64631 corePreferences("turn-restriction-via-way0", _maxViaWay);
64632 _parent.call(restrictions);
64634 selection2.selectAll(".restriction-via-way-text").call(displayMaxVia(_maxViaWay));
64636 function renderViewer(selection2) {
64637 if (!_intersection)
64639 var vgraph = _intersection.graph;
64640 var filter2 = utilFunctor(true);
64641 var projection2 = geoRawMercator();
64642 var sdims = utilGetDimensions(context.container().select(".sidebar"));
64643 var d2 = [sdims[0] - 50, 370];
64644 var c2 = geoVecScale(d2, 0.5);
64646 projection2.scale(geoZoomToScale(z2));
64647 var extent = geoExtent();
64648 for (var i3 = 0; i3 < _intersection.vertices.length; i3++) {
64649 extent._extend(_intersection.vertices[i3].extent());
64652 if (_intersection.vertices.length > 1) {
64653 var hPadding = Math.min(160, Math.max(110, d2[0] * 0.4));
64654 var vPadding = 160;
64655 var tl = projection2([extent[0][0], extent[1][1]]);
64656 var br = projection2([extent[1][0], extent[0][1]]);
64657 var hFactor = (br[0] - tl[0]) / (d2[0] - hPadding);
64658 var vFactor = (br[1] - tl[1]) / (d2[1] - vPadding - padTop);
64659 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
64660 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
64661 z2 = z2 - Math.max(hZoomDiff, vZoomDiff);
64662 projection2.scale(geoZoomToScale(z2));
64664 var extentCenter = projection2(extent.center());
64665 extentCenter[1] = extentCenter[1] - padTop / 2;
64666 projection2.translate(geoVecSubtract(c2, extentCenter)).clipExtent([[0, 0], d2]);
64667 var drawLayers = svgLayers(projection2, context).only(["osm", "touch"]).dimensions(d2);
64668 var drawVertices = svgVertices(projection2, context);
64669 var drawLines = svgLines(projection2, context);
64670 var drawTurns = svgTurns(projection2, context);
64671 var firstTime = selection2.selectAll(".surface").empty();
64672 selection2.call(drawLayers);
64673 var surface = selection2.selectAll(".surface").classed("tr", true);
64675 _initialized3 = true;
64676 surface.call(breathe);
64678 if (_fromWayID && !vgraph.hasEntity(_fromWayID)) {
64682 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));
64683 surface.on("click.restrictions", click).on("mouseover.restrictions", mouseover);
64684 surface.selectAll(".selected").classed("selected", false);
64685 surface.selectAll(".related").classed("related", false);
64688 way = vgraph.entity(_fromWayID);
64689 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
64691 document.addEventListener("resizeWindow", function() {
64692 utilSetDimensions(_container, null);
64696 function click(d3_event) {
64697 surface.call(breathe.off).call(breathe);
64698 var datum2 = d3_event.target.__data__;
64699 var entity = datum2 && datum2.properties && datum2.properties.entity;
64703 if (datum2 instanceof osmWay && (datum2.__from || datum2.__via)) {
64704 _fromWayID = datum2.id;
64707 } else if (datum2 instanceof osmTurn) {
64708 var actions, extraActions, turns, i4;
64709 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
64710 if (datum2.restrictionID && !datum2.direct) {
64712 } else if (datum2.restrictionID && !datum2.only) {
64714 var datumOnly = JSON.parse(JSON.stringify(datum2));
64715 datumOnly.only = true;
64716 restrictionType = restrictionType.replace(/^no/, "only");
64717 turns = _intersection.turns(_fromWayID, 2);
64720 for (i4 = 0; i4 < turns.length; i4++) {
64721 var turn = turns[i4];
64722 if (seen[turn.restrictionID])
64724 if (turn.direct && turn.path[1] === datum2.path[1]) {
64725 seen[turns[i4].restrictionID] = true;
64726 turn.restrictionType = osmInferRestriction(vgraph, turn, projection2);
64727 _oldTurns.push(turn);
64728 extraActions.push(actionUnrestrictTurn(turn));
64731 actions = _intersection.actions.concat(extraActions, [
64732 actionRestrictTurn(datumOnly, restrictionType),
64733 _t("operations.restriction.annotation.create")
64735 } else if (datum2.restrictionID) {
64736 turns = _oldTurns || [];
64738 for (i4 = 0; i4 < turns.length; i4++) {
64739 if (turns[i4].key !== datum2.key) {
64740 extraActions.push(actionRestrictTurn(turns[i4], turns[i4].restrictionType));
64744 actions = _intersection.actions.concat(extraActions, [
64745 actionUnrestrictTurn(datum2),
64746 _t("operations.restriction.annotation.delete")
64749 actions = _intersection.actions.concat([
64750 actionRestrictTurn(datum2, restrictionType),
64751 _t("operations.restriction.annotation.create")
64754 context.perform.apply(context, actions);
64755 var s2 = surface.selectAll("." + datum2.key);
64756 datum2 = s2.empty() ? null : s2.datum();
64757 updateHints(datum2);
64764 function mouseover(d3_event) {
64765 var datum2 = d3_event.target.__data__;
64766 updateHints(datum2);
64768 _lastXPos = _lastXPos || sdims[0];
64769 function redraw(minChange) {
64772 xPos = utilGetDimensions(context.container().select(".sidebar"))[0];
64774 if (!minChange || minChange && Math.abs(xPos - _lastXPos) >= minChange) {
64775 if (context.hasEntity(_vertexID)) {
64777 _container.call(renderViewer);
64781 function highlightPathsFrom(wayID) {
64782 surface.selectAll(".related").classed("related", false).classed("allow", false).classed("restrict", false).classed("only", false);
64783 surface.selectAll("." + wayID).classed("related", true);
64785 var turns = _intersection.turns(wayID, _maxViaWay);
64786 for (var i4 = 0; i4 < turns.length; i4++) {
64787 var turn = turns[i4];
64788 var ids = [turn.to.way];
64789 var klass = turn.no ? "restrict" : turn.only ? "only" : "allow";
64790 if (turn.only || turns.length === 1) {
64791 if (turn.via.ways) {
64792 ids = ids.concat(turn.via.ways);
64794 } else if (turn.to.way === wayID) {
64797 surface.selectAll(utilEntitySelector(ids)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
64801 function updateHints(datum2) {
64802 var help = _container.selectAll(".restriction-help").html("");
64803 var placeholders = {};
64804 ["from", "via", "to"].forEach(function(k2) {
64805 placeholders[k2] = { html: '<span class="qualifier">' + _t("restriction.help." + k2) + "</span>" };
64807 var entity = datum2 && datum2.properties && datum2.properties.entity;
64812 way = vgraph.entity(_fromWayID);
64813 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
64815 if (datum2 instanceof osmWay && datum2.__from) {
64817 highlightPathsFrom(_fromWayID ? null : way.id);
64818 surface.selectAll("." + way.id).classed("related", true);
64819 var clickSelect = !_fromWayID || _fromWayID !== way.id;
64820 help.append("div").html(_t.html("restriction.help." + (clickSelect ? "select_from_name" : "from_name"), {
64821 from: placeholders.from,
64822 fromName: displayName(way.id, vgraph)
64824 } else if (datum2 instanceof osmTurn) {
64825 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
64826 var turnType = restrictionType.replace(/^(only|no)\_/, "");
64827 var indirect = datum2.direct === false ? _t.html("restriction.help.indirect") : "";
64828 var klass, turnText, nextText;
64830 klass = "restrict";
64831 turnText = _t.html("restriction.help.turn.no_" + turnType, { indirect: { html: indirect } });
64832 nextText = _t.html("restriction.help.turn.only_" + turnType, { indirect: "" });
64833 } else if (datum2.only) {
64835 turnText = _t.html("restriction.help.turn.only_" + turnType, { indirect: { html: indirect } });
64836 nextText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: "" });
64839 turnText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: { html: indirect } });
64840 nextText = _t.html("restriction.help.turn.no_" + turnType, { indirect: "" });
64842 help.append("div").attr("class", "qualifier " + klass).html(turnText);
64843 help.append("div").html(_t.html("restriction.help.from_name_to_name", {
64844 from: placeholders.from,
64845 fromName: displayName(datum2.from.way, vgraph),
64846 to: placeholders.to,
64847 toName: displayName(datum2.to.way, vgraph)
64849 if (datum2.via.ways && datum2.via.ways.length) {
64851 for (var i4 = 0; i4 < datum2.via.ways.length; i4++) {
64852 var prev = names[names.length - 1];
64853 var curr = displayName(datum2.via.ways[i4], vgraph);
64854 if (!prev || curr !== prev) {
64858 help.append("div").html(_t.html("restriction.help.via_names", {
64859 via: placeholders.via,
64860 viaNames: names.join(", ")
64864 help.append("div").html(_t.html("restriction.help.toggle", { turn: { html: nextText.trim() } }));
64866 highlightPathsFrom(null);
64867 var alongIDs = datum2.path.slice();
64868 surface.selectAll(utilEntitySelector(alongIDs)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
64870 highlightPathsFrom(null);
64872 help.append("div").html(_t.html("restriction.help.from_name", {
64873 from: placeholders.from,
64874 fromName: displayName(_fromWayID, vgraph)
64877 help.append("div").html(_t.html("restriction.help.select_from", {
64878 from: placeholders.from
64884 function displayMaxDistance(maxDist) {
64885 return (selection2) => {
64886 var isImperial = !_mainLocalizer.usesMetric();
64890 // imprecise conversion for prettier display
64899 opts = { distance: _t("units.feet", { quantity: distToFeet }) };
64901 opts = { distance: _t("units.meters", { quantity: maxDist }) };
64903 return selection2.html("").call(_t.append("restriction.controls.distance_up_to", opts));
64906 function displayMaxVia(maxVia) {
64907 return (selection2) => {
64908 selection2 = selection2.html("");
64909 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"));
64912 function displayName(entityID, graph) {
64913 var entity = graph.entity(entityID);
64914 var name = utilDisplayName(entity) || "";
64915 var matched = _mainPresetIndex.match(entity, graph);
64916 var type2 = matched && matched.name() || utilDisplayType(entity.id);
64917 return name || type2;
64919 restrictions.entityIDs = function(val) {
64920 _intersection = null;
64923 _vertexID = val[0];
64925 restrictions.tags = function() {
64927 restrictions.focus = function() {
64929 restrictions.off = function(selection2) {
64930 if (!_initialized3)
64932 selection2.selectAll(".surface").call(breathe.off).on("click.restrictions", null).on("mouseover.restrictions", null);
64933 select_default2(window).on("resize.restrictions", null);
64935 return utilRebind(restrictions, dispatch14, "on");
64937 uiFieldRestrictions.supportsMultiselection = false;
64939 // modules/ui/fields/textarea.js
64940 function uiFieldTextarea(field, context) {
64941 var dispatch14 = dispatch_default("change");
64942 var input = select_default2(null);
64943 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue()).silent(field.usage === "changeset" && field.key === "comment");
64945 function textarea(selection2) {
64946 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64947 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).style("position", "relative").merge(wrap2);
64948 input = wrap2.selectAll("textarea").data([0]);
64949 input = input.enter().append("textarea").attr("id", field.domId).call(utilNoAuto).on("input", change(true)).on("blur", change()).on("change", change()).merge(input);
64950 wrap2.call(_lengthIndicator);
64951 function change(onInput) {
64952 return function() {
64953 var val = utilGetSetValue(input);
64955 val = context.cleanTagValue(val);
64956 if (!val && Array.isArray(_tags[field.key]))
64959 t2[field.key] = val || void 0;
64960 dispatch14.call("change", this, t2, onInput);
64964 textarea.tags = function(tags) {
64966 var isMixed = Array.isArray(tags[field.key]);
64967 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);
64969 _lengthIndicator.update(tags[field.key]);
64972 textarea.focus = function() {
64973 input.node().focus();
64975 return utilRebind(textarea, dispatch14, "on");
64978 // modules/ui/fields/wikidata.js
64979 function uiFieldWikidata(field, context) {
64980 var wikidata = services.wikidata;
64981 var dispatch14 = dispatch_default("change");
64982 var _selection = select_default2(null);
64983 var _searchInput = select_default2(null);
64985 var _wikidataEntity = null;
64987 var _entityIDs = [];
64988 var _wikipediaKey = field.keys && field.keys.find(function(key) {
64989 return key.includes("wikipedia");
64991 var _hintKey = field.key === "wikidata" ? "name" : field.key.split(":")[0];
64992 var combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(true).minItems(1);
64993 function wiki(selection2) {
64994 _selection = selection2;
64995 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64996 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64997 var list = wrap2.selectAll("ul").data([0]);
64998 list = list.enter().append("ul").attr("class", "rows").merge(list);
64999 var searchRow = list.selectAll("li.wikidata-search").data([0]);
65000 var searchRowEnter = searchRow.enter().append("li").attr("class", "wikidata-search");
65001 searchRowEnter.append("input").attr("type", "text").attr("id", field.domId).style("flex", "1").call(utilNoAuto).on("focus", function() {
65002 var node = select_default2(this).node();
65003 node.setSelectionRange(0, node.value.length);
65004 }).on("blur", function() {
65005 setLabelForEntity();
65006 }).call(combobox.fetcher(fetchWikidataItems));
65007 combobox.on("accept", function(d2) {
65012 }).on("cancel", function() {
65013 setLabelForEntity();
65015 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) {
65016 d3_event.preventDefault();
65018 window.open(_wikiURL, "_blank");
65020 searchRow = searchRow.merge(searchRowEnter);
65021 _searchInput = searchRow.select("input");
65022 var wikidataProperties = ["description", "identifier"];
65023 var items = list.selectAll("li.labeled-input").data(wikidataProperties);
65024 var enter = items.enter().append("li").attr("class", function(d2) {
65025 return "labeled-input preset-wikidata-" + d2;
65027 enter.append("span").attr("class", "label").html(function(d2) {
65028 return _t.html("wikidata." + d2);
65030 enter.append("input").attr("type", "text").call(utilNoAuto).classed("disabled", "true").attr("readonly", "true");
65031 enter.append("button").attr("class", "form-field-button").attr("title", _t("icons.copy")).call(svgIcon("#iD-operation-copy")).on("click", function(d3_event) {
65032 d3_event.preventDefault();
65033 select_default2(this.parentNode).select("input").node().select();
65034 document.execCommand("copy");
65037 function fetchWikidataItems(q2, callback) {
65038 if (!q2 && _hintKey) {
65039 for (var i3 in _entityIDs) {
65040 var entity = context.hasEntity(_entityIDs[i3]);
65041 if (entity.tags[_hintKey]) {
65042 q2 = entity.tags[_hintKey];
65047 wikidata.itemsForSearchQuery(q2, function(err, data) {
65049 if (err !== "No query")
65050 console.error(err);
65053 var result = data.map(function(item) {
65056 value: item.display.label.value + " (" + item.id + ")",
65057 display: (selection2) => selection2.append("span").attr("class", "localized-text").attr("lang", item.display.label.language).text(item.display.label.value),
65058 title: item.display.description && item.display.description.value,
65059 terms: item.aliases
65066 function change() {
65068 syncTags[field.key] = _qid;
65069 dispatch14.call("change", this, syncTags);
65070 var initGraph = context.graph();
65071 var initEntityIDs = _entityIDs;
65072 wikidata.entityByQID(_qid, function(err, entity) {
65075 if (context.graph() !== initGraph)
65077 if (!entity.sitelinks)
65079 var langs = wikidata.languagesToQuery();
65080 ["labels", "descriptions"].forEach(function(key) {
65083 var valueLangs = Object.keys(entity[key]);
65084 if (valueLangs.length === 0)
65086 var valueLang = valueLangs[0];
65087 if (langs.indexOf(valueLang) === -1) {
65088 langs.push(valueLang);
65091 var newWikipediaValue;
65092 if (_wikipediaKey) {
65093 var foundPreferred;
65094 for (var i3 in langs) {
65095 var lang = langs[i3];
65096 var siteID = lang.replace("-", "_") + "wiki";
65097 if (entity.sitelinks[siteID]) {
65098 foundPreferred = true;
65099 newWikipediaValue = lang + ":" + entity.sitelinks[siteID].title;
65103 if (!foundPreferred) {
65104 var wikiSiteKeys = Object.keys(entity.sitelinks).filter(function(site) {
65105 return site.endsWith("wiki");
65107 if (wikiSiteKeys.length === 0) {
65108 newWikipediaValue = null;
65110 var wikiLang = wikiSiteKeys[0].slice(0, -4).replace("_", "-");
65111 var wikiTitle = entity.sitelinks[wikiSiteKeys[0]].title;
65112 newWikipediaValue = wikiLang + ":" + wikiTitle;
65116 if (newWikipediaValue) {
65117 newWikipediaValue = context.cleanTagValue(newWikipediaValue);
65119 if (typeof newWikipediaValue === "undefined")
65121 var actions = initEntityIDs.map(function(entityID) {
65122 var entity2 = context.hasEntity(entityID);
65125 var currTags = Object.assign({}, entity2.tags);
65126 if (newWikipediaValue === null) {
65127 if (!currTags[_wikipediaKey])
65129 delete currTags[_wikipediaKey];
65131 currTags[_wikipediaKey] = newWikipediaValue;
65133 return actionChangeTags(entityID, currTags);
65134 }).filter(Boolean);
65135 if (!actions.length)
65138 function actionUpdateWikipediaTags(graph) {
65139 actions.forEach(function(action) {
65140 graph = action(graph);
65144 context.history().undoAnnotation()
65148 function setLabelForEntity() {
65150 if (_wikidataEntity) {
65151 label = entityPropertyForDisplay(_wikidataEntity, "labels");
65152 if (label.length === 0) {
65153 label = _wikidataEntity.id.toString();
65156 utilGetSetValue(_searchInput, label);
65158 wiki.tags = function(tags) {
65159 var isMixed = Array.isArray(tags[field.key]);
65160 _searchInput.attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : "").classed("mixed", isMixed);
65161 _qid = typeof tags[field.key] === "string" && tags[field.key] || "";
65162 if (!/^Q[0-9]*$/.test(_qid)) {
65166 _wikiURL = "https://wikidata.org/wiki/" + _qid;
65167 wikidata.entityByQID(_qid, function(err, entity) {
65172 _wikidataEntity = entity;
65173 setLabelForEntity();
65174 var description = entityPropertyForDisplay(entity, "descriptions");
65175 _selection.select("button.wiki-link").classed("disabled", false);
65176 _selection.select(".preset-wikidata-description").style("display", function() {
65177 return description.length > 0 ? "flex" : "none";
65178 }).select("input").attr("value", description);
65179 _selection.select(".preset-wikidata-identifier").style("display", function() {
65180 return entity.id ? "flex" : "none";
65181 }).select("input").attr("value", entity.id);
65183 function unrecognized() {
65184 _wikidataEntity = null;
65185 setLabelForEntity();
65186 _selection.select(".preset-wikidata-description").style("display", "none");
65187 _selection.select(".preset-wikidata-identifier").style("display", "none");
65188 _selection.select("button.wiki-link").classed("disabled", true);
65189 if (_qid && _qid !== "") {
65190 _wikiURL = "https://wikidata.org/wiki/Special:Search?search=" + _qid;
65196 function entityPropertyForDisplay(wikidataEntity, propKey) {
65197 if (!wikidataEntity[propKey])
65199 var propObj = wikidataEntity[propKey];
65200 var langKeys = Object.keys(propObj);
65201 if (langKeys.length === 0)
65203 var langs = wikidata.languagesToQuery();
65204 for (var i3 in langs) {
65205 var lang = langs[i3];
65206 var valueObj = propObj[lang];
65207 if (valueObj && valueObj.value && valueObj.value.length > 0)
65208 return valueObj.value;
65210 return propObj[langKeys[0]].value;
65212 wiki.entityIDs = function(val) {
65213 if (!arguments.length)
65218 wiki.focus = function() {
65219 _searchInput.node().focus();
65221 return utilRebind(wiki, dispatch14, "on");
65224 // modules/ui/fields/wikipedia.js
65225 function uiFieldWikipedia(field, context) {
65226 const dispatch14 = dispatch_default("change");
65227 const wikipedia = services.wikipedia;
65228 const wikidata = services.wikidata;
65229 let _langInput = select_default2(null);
65230 let _titleInput = select_default2(null);
65234 let _dataWikipedia = [];
65235 _mainFileFetcher.get("wmf_sitematrix").then((d2) => {
65236 _dataWikipedia = d2;
65238 updateForTags(_tags);
65241 const langCombo = uiCombobox(context, "wikipedia-lang").fetcher((value, callback) => {
65242 const v2 = value.toLowerCase();
65244 _dataWikipedia.filter((d2) => {
65245 return d2[0].toLowerCase().indexOf(v2) >= 0 || d2[1].toLowerCase().indexOf(v2) >= 0 || d2[2].toLowerCase().indexOf(v2) >= 0;
65246 }).map((d2) => ({ value: d2[1] }))
65249 const titleCombo = uiCombobox(context, "wikipedia-title").fetcher((value, callback) => {
65252 for (let i3 in _entityIDs) {
65253 let entity = context.hasEntity(_entityIDs[i3]);
65254 if (entity.tags.name) {
65255 value = entity.tags.name;
65260 const searchfn = value.length > 7 ? wikipedia.search : wikipedia.suggestions;
65261 searchfn(language()[2], value, (query, data) => {
65262 callback(data.map((d2) => ({ value: d2 })));
65265 function wiki(selection2) {
65266 let wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
65267 wrap2 = wrap2.enter().append("div").attr("class", `form-field-input-wrap form-field-input-${field.type}`).merge(wrap2);
65268 let langContainer = wrap2.selectAll(".wiki-lang-container").data([0]);
65269 langContainer = langContainer.enter().append("div").attr("class", "wiki-lang-container").merge(langContainer);
65270 _langInput = langContainer.selectAll("input.wiki-lang").data([0]);
65271 _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);
65272 _langInput.on("blur", changeLang).on("change", changeLang);
65273 let titleContainer = wrap2.selectAll(".wiki-title-container").data([0]);
65274 titleContainer = titleContainer.enter().append("div").attr("class", "wiki-title-container").merge(titleContainer);
65275 _titleInput = titleContainer.selectAll("input.wiki-title").data([0]);
65276 _titleInput = _titleInput.enter().append("input").attr("type", "text").attr("class", "wiki-title").attr("id", field.domId).call(utilNoAuto).call(titleCombo).merge(_titleInput);
65277 _titleInput.on("blur", function() {
65279 }).on("change", function() {
65282 let link2 = titleContainer.selectAll(".wiki-link").data([0]);
65283 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);
65284 link2.on("click", (d3_event) => {
65285 d3_event.preventDefault();
65287 window.open(_wikiURL, "_blank");
65290 function defaultLanguageInfo(skipEnglishFallback) {
65291 const langCode = _mainLocalizer.languageCode().toLowerCase();
65292 for (let i3 in _dataWikipedia) {
65293 let d2 = _dataWikipedia[i3];
65294 if (d2[2] === langCode)
65297 return skipEnglishFallback ? ["", "", ""] : ["English", "English", "en"];
65299 function language(skipEnglishFallback) {
65300 const value = utilGetSetValue(_langInput).toLowerCase();
65301 for (let i3 in _dataWikipedia) {
65302 let d2 = _dataWikipedia[i3];
65303 if (d2[0].toLowerCase() === value || d2[1].toLowerCase() === value || d2[2] === value)
65306 return defaultLanguageInfo(skipEnglishFallback);
65308 function changeLang() {
65309 utilGetSetValue(_langInput, language()[1]);
65312 function change(skipWikidata) {
65313 let value = utilGetSetValue(_titleInput);
65314 const m2 = value.match(/https?:\/\/([-a-z]+)\.wikipedia\.org\/(?:wiki|\1-[-a-z]+)\/([^#]+)(?:#(.+))?/);
65315 const langInfo = m2 && _dataWikipedia.find((d2) => m2[1] === d2[2]);
65318 const nativeLangName = langInfo[1];
65319 value = decodeURIComponent(m2[2]).replace(/_/g, " ");
65322 anchor = decodeURIComponent(m2[3]);
65323 value += "#" + anchor.replace(/_/g, " ");
65325 value = value.slice(0, 1).toUpperCase() + value.slice(1);
65326 utilGetSetValue(_langInput, nativeLangName);
65327 utilGetSetValue(_titleInput, value);
65330 syncTags.wikipedia = context.cleanTagValue(language()[2] + ":" + value);
65332 syncTags.wikipedia = void 0;
65334 dispatch14.call("change", this, syncTags);
65335 if (skipWikidata || !value || !language()[2])
65337 const initGraph = context.graph();
65338 const initEntityIDs = _entityIDs;
65339 wikidata.itemsByTitle(language()[2], value, (err, data) => {
65340 if (err || !data || !Object.keys(data).length)
65342 if (context.graph() !== initGraph)
65344 const qids = Object.keys(data);
65345 const value2 = qids && qids.find((id2) => id2.match(/^Q\d+$/));
65346 let actions = initEntityIDs.map((entityID) => {
65347 let entity = context.entity(entityID).tags;
65348 let currTags = Object.assign({}, entity);
65349 if (currTags.wikidata !== value2) {
65350 currTags.wikidata = value2;
65351 return actionChangeTags(entityID, currTags);
65354 }).filter(Boolean);
65355 if (!actions.length)
65358 function actionUpdateWikidataTags(graph) {
65359 actions.forEach(function(action) {
65360 graph = action(graph);
65364 context.history().undoAnnotation()
65368 wiki.tags = (tags) => {
65370 updateForTags(tags);
65372 function updateForTags(tags) {
65373 const value = typeof tags[field.key] === "string" ? tags[field.key] : "";
65374 const m2 = value.match(/([^:]+):([^#]+)(?:#(.+))?/);
65375 const tagLang = m2 && m2[1];
65376 const tagArticleTitle = m2 && m2[2];
65377 let anchor = m2 && m2[3];
65378 const tagLangInfo = tagLang && _dataWikipedia.find((d2) => tagLang === d2[2]);
65380 const nativeLangName = tagLangInfo[1];
65381 utilGetSetValue(_langInput, nativeLangName);
65382 utilGetSetValue(_titleInput, tagArticleTitle + (anchor ? "#" + anchor : ""));
65385 anchor = encodeURIComponent(anchor.replace(/ /g, "_")).replace(/%/g, ".");
65387 anchor = anchor.replace(/ /g, "_");
65390 _wikiURL = "https://" + tagLang + ".wikipedia.org/wiki/" + tagArticleTitle.replace(/ /g, "_") + (anchor ? "#" + anchor : "");
65392 utilGetSetValue(_titleInput, value);
65393 if (value && value !== "") {
65394 utilGetSetValue(_langInput, "");
65395 const defaultLangInfo = defaultLanguageInfo();
65396 _wikiURL = `https://${defaultLangInfo[2]}.wikipedia.org/w/index.php?fulltext=1&search=${value}`;
65398 const shownOrDefaultLangInfo = language(
65400 /* skipEnglishFallback */
65402 utilGetSetValue(_langInput, shownOrDefaultLangInfo[1]);
65407 wiki.entityIDs = (val) => {
65408 if (!arguments.length)
65413 wiki.focus = () => {
65414 _titleInput.node().focus();
65416 return utilRebind(wiki, dispatch14, "on");
65418 uiFieldWikipedia.supportsMultiselection = false;
65420 // modules/ui/fields/index.js
65422 access: uiFieldAccess,
65423 address: uiFieldAddress,
65424 check: uiFieldCheck,
65425 colour: uiFieldText,
65426 combo: uiFieldCombo,
65427 cycleway: uiFieldDirectionalCombo,
65429 defaultCheck: uiFieldCheck,
65430 directionalCombo: uiFieldDirectionalCombo,
65431 email: uiFieldText,
65432 identifier: uiFieldText,
65433 lanes: uiFieldLanes,
65434 localized: uiFieldLocalized,
65435 roadheight: uiFieldRoadheight,
65436 roadspeed: uiFieldRoadspeed,
65437 manyCombo: uiFieldCombo,
65438 multiCombo: uiFieldCombo,
65439 networkCombo: uiFieldCombo,
65440 number: uiFieldText,
65441 onewayCheck: uiFieldCheck,
65442 radio: uiFieldRadio,
65443 restrictions: uiFieldRestrictions,
65444 semiCombo: uiFieldCombo,
65445 structureRadio: uiFieldRadio,
65448 textarea: uiFieldTextarea,
65449 typeCombo: uiFieldCombo,
65451 wikidata: uiFieldWikidata,
65452 wikipedia: uiFieldWikipedia
65455 // modules/ui/field.js
65456 function uiField(context, presetField2, entityIDs, options2) {
65457 options2 = Object.assign({
65464 var dispatch14 = dispatch_default("change", "revert");
65465 var field = Object.assign({}, presetField2);
65466 field.domId = utilUniqueDomId("form-field-" + field.safeid);
65467 var _show = options2.show;
65471 if (entityIDs && entityIDs.length) {
65472 _entityExtent = entityIDs.reduce(function(extent, entityID) {
65473 var entity = context.graph().entity(entityID);
65474 return extent.extend(entity.extent(context.graph()));
65477 var _locked = false;
65478 var _lockedTip = uiTooltip().title(() => _t.append("inspector.lock.suggestion", { label: field.title })).placement("bottom");
65479 if (_show && !field.impl) {
65482 function createField() {
65483 field.impl = uiFields[field.type](field, context).on("change", function(t2, onInput) {
65484 dispatch14.call("change", field, t2, onInput);
65487 field.entityIDs = entityIDs;
65488 if (field.impl.entityIDs) {
65489 field.impl.entityIDs(entityIDs);
65493 function allKeys() {
65494 let keys2 = field.keys || [field.key];
65495 if (field.type === "directionalCombo" && field.key) {
65496 keys2 = keys2.concat(field.key);
65500 function isModified() {
65501 if (!entityIDs || !entityIDs.length)
65503 return entityIDs.some(function(entityID) {
65504 var original = context.graph().base().entities[entityID];
65505 var latest = context.graph().entity(entityID);
65506 return allKeys().some(function(key) {
65507 return original ? latest.tags[key] !== original.tags[key] : latest.tags[key];
65511 function tagsContainFieldKey() {
65512 return allKeys().some(function(key) {
65513 if (field.type === "multiCombo") {
65514 for (var tagKey in _tags) {
65515 if (tagKey.indexOf(key) === 0) {
65521 return _tags[key] !== void 0;
65524 function revert(d3_event, d2) {
65525 d3_event.stopPropagation();
65526 d3_event.preventDefault();
65527 if (!entityIDs || _locked)
65529 dispatch14.call("revert", d2, allKeys());
65531 function remove2(d3_event, d2) {
65532 d3_event.stopPropagation();
65533 d3_event.preventDefault();
65537 allKeys().forEach(function(key) {
65540 dispatch14.call("change", d2, t2);
65542 field.render = function(selection2) {
65543 var container = selection2.selectAll(".form-field").data([field]);
65544 var enter = container.enter().append("div").attr("class", function(d2) {
65545 return "form-field form-field-" + d2.safeid;
65546 }).classed("nowrap", !options2.wrap);
65547 if (options2.wrap) {
65548 var labelEnter = enter.append("label").attr("class", "field-label").attr("for", function(d2) {
65551 var textEnter = labelEnter.append("span").attr("class", "label-text");
65552 textEnter.append("span").attr("class", "label-textvalue").each(function(d2) {
65553 d2.label()(select_default2(this));
65555 textEnter.append("span").attr("class", "label-textannotation");
65556 if (options2.remove) {
65557 labelEnter.append("button").attr("class", "remove-icon").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
65559 if (options2.revert) {
65560 labelEnter.append("button").attr("class", "modified-icon").attr("title", _t("icons.undo")).call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo"));
65563 container = container.merge(enter);
65564 container.select(".field-label > .remove-icon").on("click", remove2);
65565 container.select(".field-label > .modified-icon").on("click", revert);
65566 container.each(function(d2) {
65567 var selection3 = select_default2(this);
65571 var reference, help;
65572 if (options2.wrap && field.type === "restrictions") {
65573 help = uiFieldHelp(context, "restrictions");
65575 if (options2.wrap && options2.info) {
65576 var referenceKey = d2.key || "";
65577 if (d2.type === "multiCombo") {
65578 referenceKey = referenceKey.replace(/:$/, "");
65580 var referenceOptions = d2.reference || {
65582 value: _tags[referenceKey]
65584 reference = uiTagReference(referenceOptions, context);
65585 if (_state === "hover") {
65586 reference.showing(false);
65589 selection3.call(d2.impl);
65591 selection3.call(help.body).select(".field-label").call(help.button);
65594 selection3.call(reference.body).select(".field-label").call(reference.button);
65596 d2.impl.tags(_tags);
65598 container.classed("locked", _locked).classed("modified", isModified()).classed("present", tagsContainFieldKey());
65599 var annotation = container.selectAll(".field-label .label-textannotation");
65600 var icon2 = annotation.selectAll(".icon").data(_locked ? [0] : []);
65601 icon2.exit().remove();
65602 icon2.enter().append("svg").attr("class", "icon").append("use").attr("xlink:href", "#fas-lock");
65603 container.call(_locked ? _lockedTip : _lockedTip.destroy);
65605 field.state = function(val) {
65606 if (!arguments.length)
65611 field.tags = function(val) {
65612 if (!arguments.length)
65615 if (tagsContainFieldKey() && !_show) {
65623 field.locked = function(val) {
65624 if (!arguments.length)
65629 field.show = function() {
65634 if (field.default && field.key && _tags[field.key] !== field.default) {
65636 t2[field.key] = field.default;
65637 dispatch14.call("change", this, t2);
65640 field.isShown = function() {
65643 field.isAllowed = function() {
65644 if (entityIDs && entityIDs.length > 1 && uiFields[field.type].supportsMultiselection === false)
65646 if (field.geometry && !entityIDs.every(function(entityID) {
65647 return field.matchGeometry(context.graph().geometry(entityID));
65650 if (entityIDs && _entityExtent && field.locationSetID) {
65651 var validHere = _sharedLocationManager.locationSetsAt(_entityExtent.center());
65652 if (!validHere[field.locationSetID])
65655 var prerequisiteTag = field.prerequisiteTag;
65656 if (entityIDs && !tagsContainFieldKey() && // ignore tagging prerequisites if a value is already present
65658 if (!entityIDs.every(function(entityID) {
65659 var entity = context.graph().entity(entityID);
65660 if (prerequisiteTag.key) {
65661 var value = entity.tags[prerequisiteTag.key];
65664 if (prerequisiteTag.valueNot) {
65665 return prerequisiteTag.valueNot !== value;
65667 if (prerequisiteTag.value) {
65668 return prerequisiteTag.value === value;
65670 } else if (prerequisiteTag.keyNot) {
65671 if (entity.tags[prerequisiteTag.keyNot])
65680 field.focus = function() {
65682 field.impl.focus();
65685 return utilRebind(field, dispatch14, "on");
65688 // modules/ui/form_fields.js
65689 function uiFormFields(context) {
65690 var moreCombo = uiCombobox(context, "more-fields").minItems(1);
65691 var _fieldsArr = [];
65692 var _lastPlaceholder = "";
65695 function formFields(selection2) {
65696 var allowedFields = _fieldsArr.filter(function(field) {
65697 return field.isAllowed();
65699 var shown = allowedFields.filter(function(field) {
65700 return field.isShown();
65702 var notShown = allowedFields.filter(function(field) {
65703 return !field.isShown();
65705 var container = selection2.selectAll(".form-fields-container").data([0]);
65706 container = container.enter().append("div").attr("class", "form-fields-container " + (_klass || "")).merge(container);
65707 var fields = container.selectAll(".wrap-form-field").data(shown, function(d2) {
65708 return d2.id + (d2.entityIDs ? d2.entityIDs.join() : "");
65710 fields.exit().remove();
65711 var enter = fields.enter().append("div").attr("class", function(d2) {
65712 return "wrap-form-field wrap-form-field-" + d2.safeid;
65714 fields = fields.merge(enter);
65715 fields.order().each(function(d2) {
65716 select_default2(this).call(d2.render);
65719 var moreFields = notShown.map(function(field) {
65720 var title = field.title();
65721 titles.push(title);
65722 var terms = field.terms();
65724 terms.push(field.key);
65726 terms = terms.concat(field.keys);
65728 display: field.label(),
65735 var placeholder = titles.slice(0, 3).join(", ") + (titles.length > 3 ? "\u2026" : "");
65736 var more = selection2.selectAll(".more-fields").data(_state === "hover" || moreFields.length === 0 ? [] : [0]);
65737 more.exit().remove();
65738 var moreEnter = more.enter().append("div").attr("class", "more-fields").append("label");
65739 moreEnter.append("span").call(_t.append("inspector.add_fields"));
65740 more = moreEnter.merge(more);
65741 var input = more.selectAll(".value").data([0]);
65742 input.exit().remove();
65743 input = input.enter().append("input").attr("class", "value").attr("type", "text").attr("placeholder", placeholder).call(utilNoAuto).merge(input);
65744 input.call(utilGetSetValue, "").call(
65745 moreCombo.data(moreFields).on("accept", function(d2) {
65748 var field = d2.field;
65750 selection2.call(formFields);
65754 if (_lastPlaceholder !== placeholder) {
65755 input.attr("placeholder", placeholder);
65756 _lastPlaceholder = placeholder;
65759 formFields.fieldsArr = function(val) {
65760 if (!arguments.length)
65762 _fieldsArr = val || [];
65765 formFields.state = function(val) {
65766 if (!arguments.length)
65771 formFields.klass = function(val) {
65772 if (!arguments.length)
65780 // modules/ui/changeset_editor.js
65781 function uiChangesetEditor(context) {
65782 var dispatch14 = dispatch_default("change");
65783 var formFields = uiFormFields(context);
65784 var commentCombo = uiCombobox(context, "comment").caseSensitive(true);
65788 function changesetEditor(selection2) {
65789 render(selection2);
65791 function render(selection2) {
65792 var initial = false;
65795 var presets = _mainPresetIndex;
65797 uiField(context, presets.field("comment"), null, { show: true, revert: false }),
65798 uiField(context, presets.field("source"), null, { show: false, revert: false }),
65799 uiField(context, presets.field("hashtags"), null, { show: false, revert: false })
65801 _fieldsArr.forEach(function(field) {
65802 field.on("change", function(t2, onInput) {
65803 dispatch14.call("change", field, void 0, t2, onInput);
65807 _fieldsArr.forEach(function(field) {
65810 selection2.call(formFields.fieldsArr(_fieldsArr));
65812 var commentField = selection2.select(".form-field-comment textarea");
65813 var commentNode = commentField.node();
65815 commentNode.focus();
65816 commentNode.select();
65818 utilTriggerEvent(commentField, "blur");
65819 var osm = context.connection();
65821 osm.userChangesets(function(err, changesets) {
65824 var comments = changesets.map(function(changeset) {
65825 var comment = changeset.tags.comment;
65826 return comment ? { title: comment, value: comment } : null;
65827 }).filter(Boolean);
65829 commentCombo.data(utilArrayUniqBy(comments, "title"))
65834 const warnings = [];
65835 if (_tags.comment.match(/google/i)) {
65837 id: 'contains "google"',
65838 msg: _t.append("commit.google_warning"),
65839 link: _t("commit.google_warning_link")
65842 const maxChars = context.maxCharsForTagValue();
65843 const strLen = utilUnicodeCharsCount(utilCleanOsmString(_tags.comment, Number.POSITIVE_INFINITY));
65844 if (strLen > maxChars || false) {
65846 id: "message too long",
65847 msg: _t.append("commit.changeset_comment_length_warning", { maxChars })
65850 var commentWarning = selection2.select(".form-field-comment").selectAll(".comment-warning").data(warnings, (d2) => d2.id);
65851 commentWarning.exit().transition().duration(200).style("opacity", 0).remove();
65852 var commentEnter = commentWarning.enter().insert("div", ".comment-warning").attr("class", "comment-warning field-warning").style("opacity", 0);
65853 commentEnter.call(svgIcon("#iD-icon-alert", "inline")).append("span");
65854 commentEnter.transition().duration(200).style("opacity", 1);
65855 commentWarning.merge(commentEnter).selectAll("div > span").text("").each(function(d2) {
65856 let selection3 = select_default2(this);
65858 selection3 = selection3.append("a").attr("target", "_blank").attr("href", d2.link);
65860 selection3.call(d2.msg);
65863 changesetEditor.tags = function(_2) {
65864 if (!arguments.length)
65867 return changesetEditor;
65869 changesetEditor.changesetID = function(_2) {
65870 if (!arguments.length)
65871 return _changesetID;
65872 if (_changesetID === _2)
65873 return changesetEditor;
65876 return changesetEditor;
65878 return utilRebind(changesetEditor, dispatch14, "on");
65881 // modules/ui/commit.js
65882 var import_fast_deep_equal9 = __toESM(require_fast_deep_equal());
65884 // modules/util/jxon.js
65885 var JXON = new function() {
65886 var sValueProp = "keyValue", sAttributesProp = "keyAttributes", sAttrPref = "@", aCache = [], rIsNull = /^\s*$/, rIsBool = /^(?:true|false)$/i;
65887 function parseText(sValue) {
65888 if (rIsNull.test(sValue)) {
65891 if (rIsBool.test(sValue)) {
65892 return sValue.toLowerCase() === "true";
65894 if (isFinite(sValue)) {
65895 return parseFloat(sValue);
65897 if (isFinite(Date.parse(sValue))) {
65898 return new Date(sValue);
65902 function EmptyTree() {
65904 EmptyTree.prototype.toString = function() {
65907 EmptyTree.prototype.valueOf = function() {
65910 function objectify(vValue) {
65911 return vValue === null ? new EmptyTree() : vValue instanceof Object ? vValue : new vValue.constructor(vValue);
65913 function createObjTree(oParentNode, nVerb, bFreeze, bNesteAttr) {
65914 var nLevelStart = aCache.length, bChildren = oParentNode.hasChildNodes(), bAttributes = oParentNode.hasAttributes(), bHighVerb = Boolean(nVerb & 2);
65915 var sProp, vContent, nLength = 0, sCollectedTxt = "", vResult = bHighVerb ? {} : (
65916 /* put here the default value for empty nodes: */
65920 for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) {
65921 oNode = oParentNode.childNodes.item(nItem);
65922 if (oNode.nodeType === 4) {
65923 sCollectedTxt += oNode.nodeValue;
65924 } else if (oNode.nodeType === 3) {
65925 sCollectedTxt += oNode.nodeValue.trim();
65926 } else if (oNode.nodeType === 1 && !oNode.prefix) {
65927 aCache.push(oNode);
65931 var nLevelEnd = aCache.length, vBuiltVal = parseText(sCollectedTxt);
65932 if (!bHighVerb && (bChildren || bAttributes)) {
65933 vResult = nVerb === 0 ? objectify(vBuiltVal) : {};
65935 for (var nElId = nLevelStart; nElId < nLevelEnd; nElId++) {
65936 sProp = aCache[nElId].nodeName.toLowerCase();
65937 vContent = createObjTree(aCache[nElId], nVerb, bFreeze, bNesteAttr);
65938 if (vResult.hasOwnProperty(sProp)) {
65939 if (vResult[sProp].constructor !== Array) {
65940 vResult[sProp] = [vResult[sProp]];
65942 vResult[sProp].push(vContent);
65944 vResult[sProp] = vContent;
65949 var nAttrLen = oParentNode.attributes.length, sAPrefix = bNesteAttr ? "" : sAttrPref, oAttrParent = bNesteAttr ? {} : vResult;
65950 for (var oAttrib, nAttrib = 0; nAttrib < nAttrLen; nLength++, nAttrib++) {
65951 oAttrib = oParentNode.attributes.item(nAttrib);
65952 oAttrParent[sAPrefix + oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim());
65956 Object.freeze(oAttrParent);
65958 vResult[sAttributesProp] = oAttrParent;
65959 nLength -= nAttrLen - 1;
65962 if (nVerb === 3 || (nVerb === 2 || nVerb === 1 && nLength > 0) && sCollectedTxt) {
65963 vResult[sValueProp] = vBuiltVal;
65964 } else if (!bHighVerb && nLength === 0 && sCollectedTxt) {
65965 vResult = vBuiltVal;
65967 if (bFreeze && (bHighVerb || nLength > 0)) {
65968 Object.freeze(vResult);
65970 aCache.length = nLevelStart;
65973 function loadObjTree(oXMLDoc, oParentEl, oParentObj) {
65974 var vValue, oChild;
65975 if (oParentObj instanceof String || oParentObj instanceof Number || oParentObj instanceof Boolean) {
65976 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString()));
65977 } else if (oParentObj.constructor === Date) {
65978 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString()));
65980 for (var sName in oParentObj) {
65981 vValue = oParentObj[sName];
65982 if (isFinite(sName) || vValue instanceof Function) {
65985 if (sName === sValueProp) {
65986 if (vValue !== null && vValue !== true) {
65987 oParentEl.appendChild(oXMLDoc.createTextNode(vValue.constructor === Date ? vValue.toGMTString() : String(vValue)));
65989 } else if (sName === sAttributesProp) {
65990 for (var sAttrib in vValue) {
65991 oParentEl.setAttribute(sAttrib, vValue[sAttrib]);
65993 } else if (sName.charAt(0) === sAttrPref) {
65994 oParentEl.setAttribute(sName.slice(1), vValue);
65995 } else if (vValue.constructor === Array) {
65996 for (var nItem = 0; nItem < vValue.length; nItem++) {
65997 oChild = oXMLDoc.createElement(sName);
65998 loadObjTree(oXMLDoc, oChild, vValue[nItem]);
65999 oParentEl.appendChild(oChild);
66002 oChild = oXMLDoc.createElement(sName);
66003 if (vValue instanceof Object) {
66004 loadObjTree(oXMLDoc, oChild, vValue);
66005 } else if (vValue !== null && vValue !== true) {
66006 oChild.appendChild(oXMLDoc.createTextNode(vValue.toString()));
66008 oParentEl.appendChild(oChild);
66012 this.build = function(oXMLParent, nVerbosity, bFreeze, bNesteAttributes) {
66013 var _nVerb = arguments.length > 1 && typeof nVerbosity === "number" ? nVerbosity & 3 : (
66014 /* put here the default verbosity level: */
66017 return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3);
66019 this.unbuild = function(oObjTree) {
66020 var oNewDoc = document.implementation.createDocument("", "", null);
66021 loadObjTree(oNewDoc, oNewDoc, oObjTree);
66024 this.stringify = function(oObjTree) {
66025 return new XMLSerializer().serializeToString(JXON.unbuild(oObjTree));
66029 // modules/ui/sections/changes.js
66030 function uiSectionChanges(context) {
66031 var _discardTags = {};
66032 _mainFileFetcher.get("discarded").then(function(d2) {
66034 }).catch(function() {
66036 var section = uiSection("changes-list", context).label(function() {
66037 var history = context.history();
66038 var summary = history.difference().summary();
66039 return _t.append("inspector.title_count", { title: _t("commit.changes"), count: summary.length });
66040 }).disclosureContent(renderDisclosureContent);
66041 function renderDisclosureContent(selection2) {
66042 var history = context.history();
66043 var summary = history.difference().summary();
66044 var container = selection2.selectAll(".commit-section").data([0]);
66045 var containerEnter = container.enter().append("div").attr("class", "commit-section");
66046 containerEnter.append("ul").attr("class", "changeset-list");
66047 container = containerEnter.merge(container);
66048 var items = container.select("ul").selectAll("li").data(summary);
66049 var itemsEnter = items.enter().append("li").attr("class", "change-item");
66050 var buttons = itemsEnter.append("button").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
66051 buttons.each(function(d2) {
66052 select_default2(this).call(svgIcon("#iD-icon-" + d2.entity.geometry(d2.graph), "pre-text " + d2.changeType));
66054 buttons.append("span").attr("class", "change-type").html(function(d2) {
66055 return _t.html("commit." + d2.changeType) + " ";
66057 buttons.append("strong").attr("class", "entity-type").text(function(d2) {
66058 var matched = _mainPresetIndex.match(d2.entity, d2.graph);
66059 return matched && matched.name() || utilDisplayType(d2.entity.id);
66061 buttons.append("span").attr("class", "entity-name").text(function(d2) {
66062 var name = utilDisplayName(d2.entity) || "", string = "";
66066 return string += " " + name;
66068 items = itemsEnter.merge(items);
66069 var changeset = new osmChangeset().update({ id: void 0 });
66070 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
66071 delete changeset.id;
66072 var data = JXON.stringify(changeset.osmChangeJXON(changes));
66073 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
66074 var fileName = "changes.osc";
66075 var linkEnter = container.selectAll(".download-changes").data([0]).enter().append("a").attr("class", "download-changes");
66076 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
66077 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("commit.download_changes"));
66078 function mouseover(d2) {
66080 context.surface().selectAll(
66081 utilEntityOrMemberSelector([d2.entity.id], context.graph())
66082 ).classed("hover", true);
66085 function mouseout() {
66086 context.surface().selectAll(".hover").classed("hover", false);
66088 function click(d3_event, change) {
66089 if (change.changeType !== "deleted") {
66090 var entity = change.entity;
66091 context.map().zoomToEase(entity);
66092 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
66099 // modules/ui/commit_warnings.js
66100 function uiCommitWarnings(context) {
66101 function commitWarnings(selection2) {
66102 var issuesBySeverity = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeDisabledRules: true });
66103 for (var severity in issuesBySeverity) {
66104 var issues = issuesBySeverity[severity];
66105 if (severity !== "error") {
66106 issues = issues.filter(function(issue) {
66107 return issue.type !== "help_request";
66110 var section = severity + "-section";
66111 var issueItem = severity + "-item";
66112 var container = selection2.selectAll("." + section).data(issues.length ? [0] : []);
66113 container.exit().remove();
66114 var containerEnter = container.enter().append("div").attr("class", "modal-section " + section + " fillL2");
66115 containerEnter.append("h3").call(severity === "warning" ? _t.append("commit.warnings") : _t.append("commit.errors"));
66116 containerEnter.append("ul").attr("class", "changeset-list");
66117 container = containerEnter.merge(container);
66118 var items = container.select("ul").selectAll("li").data(issues, function(d2) {
66121 items.exit().remove();
66122 var itemsEnter = items.enter().append("li").attr("class", issueItem);
66123 var buttons = itemsEnter.append("button").on("mouseover", function(d3_event, d2) {
66124 if (d2.entityIds) {
66125 context.surface().selectAll(
66126 utilEntityOrMemberSelector(
66130 ).classed("hover", true);
66132 }).on("mouseout", function() {
66133 context.surface().selectAll(".hover").classed("hover", false);
66134 }).on("click", function(d3_event, d2) {
66135 context.validator().focusIssue(d2);
66137 buttons.call(svgIcon("#iD-icon-alert", "pre-text"));
66138 buttons.append("strong").attr("class", "issue-message");
66139 buttons.filter(function(d2) {
66142 uiTooltip().title(function(d2) {
66144 }).placement("top")
66146 items = itemsEnter.merge(items);
66147 items.selectAll(".issue-message").text("").each(function(d2) {
66148 return d2.message(context)(select_default2(this));
66152 return commitWarnings;
66155 // modules/ui/commit.js
66156 var readOnlyTags = [
66157 /^changesets_count$/,
66166 /^closed:keepright$/,
66167 /^closed:improveosm:/,
66170 var hashtagRegex = /(#[^\u2000-\u206F\u2E00-\u2E7F\s\\'!"#$%()*,.\/:;<=>?@\[\]^`{|}~]+)/g;
66171 function uiCommit(context) {
66172 var dispatch14 = dispatch_default("cancel");
66175 var changesetEditor = uiChangesetEditor(context).on("change", changeTags);
66176 var rawTagEditor = uiSectionRawTagEditor("changeset-tag-editor", context).on("change", changeTags).readOnlyTags(readOnlyTags);
66177 var commitChanges = uiSectionChanges(context);
66178 var commitWarnings = uiCommitWarnings(context);
66179 function commit(selection2) {
66180 _selection = selection2;
66181 if (!context.changeset)
66183 loadDerivedChangesetTags();
66184 selection2.call(render);
66186 function initChangeset() {
66187 var commentDate = +corePreferences("commentDate") || 0;
66188 var currDate = Date.now();
66189 var cutoff = 2 * 86400 * 1e3;
66190 if (commentDate > currDate || currDate - commentDate > cutoff) {
66191 corePreferences("comment", null);
66192 corePreferences("hashtags", null);
66193 corePreferences("source", null);
66195 if (context.defaultChangesetComment()) {
66196 corePreferences("comment", context.defaultChangesetComment());
66197 corePreferences("commentDate", Date.now());
66199 if (context.defaultChangesetSource()) {
66200 corePreferences("source", context.defaultChangesetSource());
66201 corePreferences("commentDate", Date.now());
66203 if (context.defaultChangesetHashtags()) {
66204 corePreferences("hashtags", context.defaultChangesetHashtags());
66205 corePreferences("commentDate", Date.now());
66207 var detected = utilDetect();
66209 comment: corePreferences("comment") || "",
66210 created_by: context.cleanTagValue("iD " + context.version),
66211 host: context.cleanTagValue(detected.host),
66212 locale: context.cleanTagValue(_mainLocalizer.localeCode())
66214 findHashtags(tags, true);
66215 var hashtags = corePreferences("hashtags");
66217 tags.hashtags = hashtags;
66219 var source = corePreferences("source");
66221 tags.source = source;
66223 var photoOverlaysUsed = context.history().photoOverlaysUsed();
66224 if (photoOverlaysUsed.length) {
66225 var sources = (tags.source || "").split(";");
66226 if (sources.indexOf("streetlevel imagery") === -1) {
66227 sources.push("streetlevel imagery");
66229 photoOverlaysUsed.forEach(function(photoOverlay) {
66230 if (sources.indexOf(photoOverlay) === -1) {
66231 sources.push(photoOverlay);
66234 tags.source = context.cleanTagValue(sources.join(";"));
66236 context.changeset = new osmChangeset({ tags });
66238 function loadDerivedChangesetTags() {
66239 var osm = context.connection();
66242 var tags = Object.assign({}, context.changeset.tags);
66243 var imageryUsed = context.cleanTagValue(context.history().imageryUsed().join(";"));
66244 tags.imagery_used = imageryUsed || "None";
66245 var osmClosed = osm.getClosedIDs();
66247 if (osmClosed.length) {
66248 tags["closed:note"] = context.cleanTagValue(osmClosed.join(";"));
66250 if (services.keepRight) {
66251 var krClosed = services.keepRight.getClosedIDs();
66252 if (krClosed.length) {
66253 tags["closed:keepright"] = context.cleanTagValue(krClosed.join(";"));
66256 if (services.improveOSM) {
66257 var iOsmClosed = services.improveOSM.getClosedCounts();
66258 for (itemType in iOsmClosed) {
66259 tags["closed:improveosm:" + itemType] = context.cleanTagValue(iOsmClosed[itemType].toString());
66262 if (services.osmose) {
66263 var osmoseClosed = services.osmose.getClosedCounts();
66264 for (itemType in osmoseClosed) {
66265 tags["closed:osmose:" + itemType] = context.cleanTagValue(osmoseClosed[itemType].toString());
66268 for (var key in tags) {
66269 if (key.match(/(^warnings:)|(^resolved:)/)) {
66273 function addIssueCounts(issues, prefix) {
66274 var issuesByType = utilArrayGroupBy(issues, "type");
66275 for (var issueType in issuesByType) {
66276 var issuesOfType = issuesByType[issueType];
66277 if (issuesOfType[0].subtype) {
66278 var issuesBySubtype = utilArrayGroupBy(issuesOfType, "subtype");
66279 for (var issueSubtype in issuesBySubtype) {
66280 var issuesOfSubtype = issuesBySubtype[issueSubtype];
66281 tags[prefix + ":" + issueType + ":" + issueSubtype] = context.cleanTagValue(issuesOfSubtype.length.toString());
66284 tags[prefix + ":" + issueType] = context.cleanTagValue(issuesOfType.length.toString());
66288 var warnings = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeIgnored: true, includeDisabledRules: true }).warning.filter(function(issue) {
66289 return issue.type !== "help_request";
66291 addIssueCounts(warnings, "warnings");
66292 var resolvedIssues = context.validator().getResolvedIssues();
66293 addIssueCounts(resolvedIssues, "resolved");
66294 context.changeset = context.changeset.update({ tags });
66296 function render(selection2) {
66297 var osm = context.connection();
66300 var header = selection2.selectAll(".header").data([0]);
66301 var headerTitle = header.enter().append("div").attr("class", "header fillL");
66302 headerTitle.append("div").append("h2").call(_t.append("commit.title"));
66303 headerTitle.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
66304 dispatch14.call("cancel", this);
66305 }).call(svgIcon("#iD-icon-close"));
66306 var body = selection2.selectAll(".body").data([0]);
66307 body = body.enter().append("div").attr("class", "body").merge(body);
66308 var changesetSection = body.selectAll(".changeset-editor").data([0]);
66309 changesetSection = changesetSection.enter().append("div").attr("class", "modal-section changeset-editor").merge(changesetSection);
66310 changesetSection.call(
66311 changesetEditor.changesetID(context.changeset.id).tags(context.changeset.tags)
66313 body.call(commitWarnings);
66314 var saveSection = body.selectAll(".save-section").data([0]);
66315 saveSection = saveSection.enter().append("div").attr("class", "modal-section save-section fillL").merge(saveSection);
66316 var prose = saveSection.selectAll(".commit-info").data([0]);
66317 if (prose.enter().size()) {
66318 _userDetails2 = null;
66320 prose = prose.enter().append("p").attr("class", "commit-info").call(_t.append("commit.upload_explanation")).merge(prose);
66321 osm.userDetails(function(err, user) {
66324 if (_userDetails2 === user)
66326 _userDetails2 = user;
66327 var userLink = select_default2(document.createElement("div"));
66328 if (user.image_url) {
66329 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
66331 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
66332 prose.html(_t.html("commit.upload_explanation_with_user", { user: { html: userLink.html() } }));
66334 var requestReview = saveSection.selectAll(".request-review").data([0]);
66335 var requestReviewEnter = requestReview.enter().append("div").attr("class", "request-review");
66336 var requestReviewDomId = utilUniqueDomId("commit-input-request-review");
66337 var labelEnter = requestReviewEnter.append("label").attr("for", requestReviewDomId);
66338 if (!labelEnter.empty()) {
66339 labelEnter.call(uiTooltip().title(() => _t.append("commit.request_review_info")).placement("top"));
66341 labelEnter.append("input").attr("type", "checkbox").attr("id", requestReviewDomId);
66342 labelEnter.append("span").call(_t.append("commit.request_review"));
66343 requestReview = requestReview.merge(requestReviewEnter);
66344 var requestReviewInput = requestReview.selectAll("input").property("checked", isReviewRequested(context.changeset.tags)).on("change", toggleRequestReview);
66345 var buttonSection = saveSection.selectAll(".buttons").data([0]);
66346 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons fillL");
66347 buttonEnter.append("button").attr("class", "secondary-action button cancel-button").append("span").attr("class", "label").call(_t.append("commit.cancel"));
66348 var uploadButton = buttonEnter.append("button").attr("class", "action button save-button");
66349 uploadButton.append("span").attr("class", "label").call(_t.append("commit.save"));
66350 var uploadBlockerTooltipText = getUploadBlockerMessage();
66351 buttonSection = buttonSection.merge(buttonEnter);
66352 buttonSection.selectAll(".cancel-button").on("click.cancel", function() {
66353 dispatch14.call("cancel", this);
66355 buttonSection.selectAll(".save-button").classed("disabled", uploadBlockerTooltipText !== null).on("click.save", function() {
66356 if (!select_default2(this).classed("disabled")) {
66358 for (var key in context.changeset.tags) {
66360 delete context.changeset.tags[key];
66362 context.uploader().save(context.changeset);
66365 uiTooltip().destroyAny(buttonSection.selectAll(".save-button"));
66366 if (uploadBlockerTooltipText) {
66367 buttonSection.selectAll(".save-button").call(uiTooltip().title(() => uploadBlockerTooltipText).placement("top"));
66369 var tagSection = body.selectAll(".tag-section.raw-tag-editor").data([0]);
66370 tagSection = tagSection.enter().append("div").attr("class", "modal-section tag-section raw-tag-editor").merge(tagSection);
66372 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
66374 var changesSection = body.selectAll(".commit-changes-section").data([0]);
66375 changesSection = changesSection.enter().append("div").attr("class", "modal-section commit-changes-section").merge(changesSection);
66376 changesSection.call(commitChanges.render);
66377 function toggleRequestReview() {
66378 var rr = requestReviewInput.property("checked");
66379 updateChangeset({ review_requested: rr ? "yes" : void 0 });
66381 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
66385 function getUploadBlockerMessage() {
66386 var errors = context.validator().getIssuesBySeverity({ what: "edited", where: "all" }).error;
66387 if (errors.length) {
66388 return _t.append("commit.outstanding_errors_message", { count: errors.length });
66390 var hasChangesetComment = context.changeset && context.changeset.tags.comment && context.changeset.tags.comment.trim().length;
66391 if (!hasChangesetComment) {
66392 return _t.append("commit.comment_needed_message");
66397 function changeTags(_2, changed, onInput) {
66398 if (changed.hasOwnProperty("comment")) {
66399 if (changed.comment === void 0) {
66400 changed.comment = "";
66403 corePreferences("comment", changed.comment);
66404 corePreferences("commentDate", Date.now());
66407 if (changed.hasOwnProperty("source")) {
66408 if (changed.source === void 0) {
66409 corePreferences("source", null);
66410 } else if (!onInput) {
66411 corePreferences("source", changed.source);
66412 corePreferences("commentDate", Date.now());
66415 updateChangeset(changed, onInput);
66417 _selection.call(render);
66420 function findHashtags(tags, commentOnly) {
66421 var detectedHashtags = commentHashtags();
66422 if (detectedHashtags.length) {
66423 corePreferences("hashtags", null);
66425 if (!detectedHashtags.length || !commentOnly) {
66426 detectedHashtags = detectedHashtags.concat(hashtagHashtags());
66428 var allLowerCase = /* @__PURE__ */ new Set();
66429 return detectedHashtags.filter(function(hashtag) {
66430 var lowerCase = hashtag.toLowerCase();
66431 if (!allLowerCase.has(lowerCase)) {
66432 allLowerCase.add(lowerCase);
66437 function commentHashtags() {
66438 var matches = (tags.comment || "").replace(/http\S*/g, "").match(hashtagRegex);
66439 return matches || [];
66441 function hashtagHashtags() {
66442 var matches = (tags.hashtags || "").split(/[,;\s]+/).map(function(s2) {
66443 if (s2[0] !== "#") {
66446 var matched = s2.match(hashtagRegex);
66447 return matched && matched[0];
66448 }).filter(Boolean);
66449 return matches || [];
66452 function isReviewRequested(tags) {
66453 var rr = tags.review_requested;
66456 rr = rr.trim().toLowerCase();
66457 return !(rr === "" || rr === "no");
66459 function updateChangeset(changed, onInput) {
66460 var tags = Object.assign({}, context.changeset.tags);
66461 Object.keys(changed).forEach(function(k2) {
66462 var v2 = changed[k2];
66463 k2 = context.cleanTagKey(k2);
66464 if (readOnlyTags.indexOf(k2) !== -1)
66466 if (v2 === void 0) {
66468 } else if (onInput) {
66471 tags[k2] = context.cleanTagValue(v2);
66475 var commentOnly = changed.hasOwnProperty("comment") && changed.comment !== "";
66476 var arr = findHashtags(tags, commentOnly);
66478 tags.hashtags = context.cleanTagValue(arr.join(";"));
66479 corePreferences("hashtags", tags.hashtags);
66481 delete tags.hashtags;
66482 corePreferences("hashtags", null);
66485 if (_userDetails2 && _userDetails2.changesets_count !== void 0) {
66486 var changesetsCount = parseInt(_userDetails2.changesets_count, 10) + 1;
66487 tags.changesets_count = String(changesetsCount);
66488 if (changesetsCount <= 100) {
66490 s2 = corePreferences("walkthrough_completed");
66492 tags["ideditor:walkthrough_completed"] = s2;
66494 s2 = corePreferences("walkthrough_progress");
66496 tags["ideditor:walkthrough_progress"] = s2;
66498 s2 = corePreferences("walkthrough_started");
66500 tags["ideditor:walkthrough_started"] = s2;
66504 delete tags.changesets_count;
66506 if (!(0, import_fast_deep_equal9.default)(context.changeset.tags, tags)) {
66507 context.changeset = context.changeset.update({ tags });
66510 commit.reset = function() {
66511 context.changeset = null;
66513 return utilRebind(commit, dispatch14, "on");
66516 // modules/ui/confirm.js
66517 function uiConfirm(selection2) {
66518 var modalSelection = uiModal(selection2);
66519 modalSelection.select(".modal").classed("modal-alert", true);
66520 var section = modalSelection.select(".content");
66521 section.append("div").attr("class", "modal-section header");
66522 section.append("div").attr("class", "modal-section message-text");
66523 var buttons = section.append("div").attr("class", "modal-section buttons cf");
66524 modalSelection.okButton = function() {
66525 buttons.append("button").attr("class", "button ok-button action").on("click.confirm", function() {
66526 modalSelection.remove();
66527 }).call(_t.append("confirm.okay")).node().focus();
66528 return modalSelection;
66530 return modalSelection;
66533 // modules/ui/conflicts.js
66534 function uiConflicts(context) {
66535 var dispatch14 = dispatch_default("cancel", "save");
66536 var keybinding = utilKeybinding("conflicts");
66539 var _shownConflictIndex;
66540 function keybindingOn() {
66541 select_default2(document).call(keybinding.on("\u238B", cancel, true));
66543 function keybindingOff() {
66544 select_default2(document).call(keybinding.unbind);
66546 function tryAgain() {
66548 dispatch14.call("save");
66550 function cancel() {
66552 dispatch14.call("cancel");
66554 function conflicts(selection2) {
66556 var headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
66557 headerEnter.append("button").attr("class", "fr").attr("title", _t("icons.close")).on("click", cancel).call(svgIcon("#iD-icon-close"));
66558 headerEnter.append("h2").call(_t.append("save.conflict.header"));
66559 var bodyEnter = selection2.selectAll(".body").data([0]).enter().append("div").attr("class", "body fillL");
66560 var conflictsHelpEnter = bodyEnter.append("div").attr("class", "conflicts-help").call(_t.append("save.conflict.help"));
66561 var changeset = new osmChangeset();
66562 delete changeset.id;
66563 var data = JXON.stringify(changeset.osmChangeJXON(_origChanges));
66564 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
66565 var fileName = "changes.osc";
66566 var linkEnter = conflictsHelpEnter.selectAll(".download-changes").append("a").attr("class", "download-changes");
66567 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
66568 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("save.conflict.download_changes"));
66569 bodyEnter.append("div").attr("class", "conflict-container fillL3").call(showConflict, 0);
66570 bodyEnter.append("div").attr("class", "conflicts-done").attr("opacity", 0).style("display", "none").call(_t.append("save.conflict.done"));
66571 var buttonsEnter = bodyEnter.append("div").attr("class", "buttons col12 joined conflicts-buttons");
66572 buttonsEnter.append("button").attr("disabled", _conflictList.length > 1).attr("class", "action conflicts-button col6").call(_t.append("save.title")).on("click.try_again", tryAgain);
66573 buttonsEnter.append("button").attr("class", "secondary-action conflicts-button col6").call(_t.append("confirm.cancel")).on("click.cancel", cancel);
66575 function showConflict(selection2, index) {
66576 index = utilWrap(index, _conflictList.length);
66577 _shownConflictIndex = index;
66578 var parent = select_default2(selection2.node().parentNode);
66579 if (index === _conflictList.length - 1) {
66580 window.setTimeout(function() {
66581 parent.select(".conflicts-button").attr("disabled", null);
66582 parent.select(".conflicts-done").transition().attr("opacity", 1).style("display", "block");
66585 var conflict = selection2.selectAll(".conflict").data([_conflictList[index]]);
66586 conflict.exit().remove();
66587 var conflictEnter = conflict.enter().append("div").attr("class", "conflict");
66588 conflictEnter.append("h4").attr("class", "conflict-count").call(_t.append("save.conflict.count", { num: index + 1, total: _conflictList.length }));
66589 conflictEnter.append("a").attr("class", "conflict-description").attr("href", "#").text(function(d2) {
66591 }).on("click", function(d3_event, d2) {
66592 d3_event.preventDefault();
66593 zoomToEntity(d2.id);
66595 var details = conflictEnter.append("div").attr("class", "conflict-detail-container");
66596 details.append("ul").attr("class", "conflict-detail-list").selectAll("li").data(function(d2) {
66597 return d2.details || [];
66598 }).enter().append("li").attr("class", "conflict-detail-item").html(function(d2) {
66601 details.append("div").attr("class", "conflict-choices").call(addChoices);
66602 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) {
66603 return i3 === 0 && index === 0 || i3 === 1 && index === _conflictList.length - 1 || null;
66604 }).on("click", function(d3_event, d2) {
66605 d3_event.preventDefault();
66606 var container = parent.selectAll(".conflict-container");
66607 var sign2 = d2 === "previous" ? -1 : 1;
66608 container.selectAll(".conflict").remove();
66609 container.call(showConflict, index + sign2);
66610 }).each(function(d2) {
66611 _t.append("save.conflict." + d2)(select_default2(this));
66614 function addChoices(selection2) {
66615 var choices = selection2.append("ul").attr("class", "layer-list").selectAll("li").data(function(d2) {
66616 return d2.choices || [];
66618 var choicesEnter = choices.enter().append("li").attr("class", "layer");
66619 var labelEnter = choicesEnter.append("label");
66620 labelEnter.append("input").attr("type", "radio").attr("name", function(d2) {
66622 }).on("change", function(d3_event, d2) {
66623 var ul = this.parentNode.parentNode.parentNode;
66624 ul.__data__.chosen = d2.id;
66625 choose(d3_event, ul, d2);
66627 labelEnter.append("span").text(function(d2) {
66630 choicesEnter.merge(choices).each(function(d2) {
66631 var ul = this.parentNode;
66632 if (ul.__data__.chosen === d2.id) {
66633 choose(null, ul, d2);
66637 function choose(d3_event, ul, datum2) {
66639 d3_event.preventDefault();
66640 select_default2(ul).selectAll("li").classed("active", function(d2) {
66641 return d2 === datum2;
66642 }).selectAll("input").property("checked", function(d2) {
66643 return d2 === datum2;
66645 var extent = geoExtent();
66647 entity = context.graph().hasEntity(datum2.id);
66649 extent._extend(entity.extent(context.graph()));
66651 entity = context.graph().hasEntity(datum2.id);
66653 extent._extend(entity.extent(context.graph()));
66654 zoomToEntity(datum2.id, extent);
66656 function zoomToEntity(id2, extent) {
66657 context.surface().selectAll(".hover").classed("hover", false);
66658 var entity = context.graph().hasEntity(id2);
66661 context.map().trimmedExtent(extent);
66663 context.map().zoomToEase(entity);
66665 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
66668 conflicts.conflictList = function(_2) {
66669 if (!arguments.length)
66670 return _conflictList;
66671 _conflictList = _2;
66674 conflicts.origChanges = function(_2) {
66675 if (!arguments.length)
66676 return _origChanges;
66680 conflicts.shownEntityIds = function() {
66681 if (_conflictList && typeof _shownConflictIndex === "number") {
66682 return [_conflictList[_shownConflictIndex].id];
66686 return utilRebind(conflicts, dispatch14, "on");
66689 // modules/ui/entity_editor.js
66690 var import_fast_deep_equal10 = __toESM(require_fast_deep_equal());
66692 // modules/ui/sections/entity_issues.js
66693 function uiSectionEntityIssues(context) {
66694 var preference = corePreferences("entity-issues.reference.expanded");
66695 var _expanded = preference === null ? true : preference === "true";
66696 var _entityIDs = [];
66698 var _activeIssueID;
66699 var section = uiSection("entity-issues", context).shouldDisplay(function() {
66700 return _issues.length > 0;
66701 }).label(function() {
66702 return _t.append("inspector.title_count", { title: _t("issues.list_title"), count: _issues.length });
66703 }).disclosureContent(renderDisclosureContent);
66704 context.validator().on("validated.entity_issues", function() {
66706 section.reRender();
66707 }).on("focusedIssue.entity_issues", function(issue) {
66708 makeActiveIssue(issue.id);
66710 function reloadIssues() {
66711 _issues = context.validator().getSharedEntityIssues(_entityIDs, { includeDisabledRules: true });
66713 function makeActiveIssue(issueID) {
66714 _activeIssueID = issueID;
66715 section.selection().selectAll(".issue-container").classed("active", function(d2) {
66716 return d2.id === _activeIssueID;
66719 function renderDisclosureContent(selection2) {
66720 selection2.classed("grouped-items-area", true);
66721 _activeIssueID = _issues.length > 0 ? _issues[0].id : null;
66722 var containers = selection2.selectAll(".issue-container").data(_issues, function(d2) {
66725 containers.exit().remove();
66726 var containersEnter = containers.enter().append("div").attr("class", "issue-container");
66727 var itemsEnter = containersEnter.append("div").attr("class", function(d2) {
66728 return "issue severity-" + d2.severity;
66729 }).on("mouseover.highlight", function(d3_event, d2) {
66730 var ids = d2.entityIds.filter(function(e3) {
66731 return _entityIDs.indexOf(e3) === -1;
66733 utilHighlightEntities(ids, true, context);
66734 }).on("mouseout.highlight", function(d3_event, d2) {
66735 var ids = d2.entityIds.filter(function(e3) {
66736 return _entityIDs.indexOf(e3) === -1;
66738 utilHighlightEntities(ids, false, context);
66740 var labelsEnter = itemsEnter.append("div").attr("class", "issue-label");
66741 var textEnter = labelsEnter.append("button").attr("class", "issue-text").on("click", function(d3_event, d2) {
66742 makeActiveIssue(d2.id);
66743 var extent = d2.extent(context.graph());
66745 var setZoom = Math.max(context.map().zoom(), 19);
66746 context.map().unobscuredCenterZoomEase(extent.center(), setZoom);
66749 textEnter.each(function(d2) {
66750 var iconName = "#iD-icon-" + (d2.severity === "warning" ? "alert" : "error");
66751 select_default2(this).call(svgIcon(iconName, "issue-icon"));
66753 textEnter.append("span").attr("class", "issue-message");
66754 var infoButton = labelsEnter.append("button").attr("class", "issue-info-button").attr("title", _t("icons.information")).call(svgIcon("#iD-icon-inspect"));
66755 infoButton.on("click", function(d3_event) {
66756 d3_event.stopPropagation();
66757 d3_event.preventDefault();
66759 var container = select_default2(this.parentNode.parentNode.parentNode);
66760 var info = container.selectAll(".issue-info");
66761 var isExpanded = info.classed("expanded");
66762 _expanded = !isExpanded;
66763 corePreferences("entity-issues.reference.expanded", _expanded);
66765 info.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
66766 info.classed("expanded", false);
66769 info.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1").on("end", function() {
66770 info.style("max-height", null);
66774 itemsEnter.append("ul").attr("class", "issue-fix-list");
66775 containersEnter.append("div").attr("class", "issue-info" + (_expanded ? " expanded" : "")).style("max-height", _expanded ? null : "0").style("opacity", _expanded ? "1" : "0").each(function(d2) {
66776 if (typeof d2.reference === "function") {
66777 select_default2(this).call(d2.reference);
66779 select_default2(this).call(_t.append("inspector.no_documentation_key"));
66782 containers = containers.merge(containersEnter).classed("active", function(d2) {
66783 return d2.id === _activeIssueID;
66785 containers.selectAll(".issue-message").text("").each(function(d2) {
66786 return d2.message(context)(select_default2(this));
66788 var fixLists = containers.selectAll(".issue-fix-list");
66789 var fixes = fixLists.selectAll(".issue-fix-item").data(function(d2) {
66790 return d2.fixes ? d2.fixes(context) : [];
66794 fixes.exit().remove();
66795 var fixesEnter = fixes.enter().append("li").attr("class", "issue-fix-item");
66796 var buttons = fixesEnter.append("button").on("click", function(d3_event, d2) {
66797 if (select_default2(this).attr("disabled") || !d2.onClick)
66799 if (d2.issue.dateLastRanFix && /* @__PURE__ */ new Date() - d2.issue.dateLastRanFix < 1e3)
66801 d2.issue.dateLastRanFix = /* @__PURE__ */ new Date();
66802 utilHighlightEntities(d2.issue.entityIds.concat(d2.entityIds), false, context);
66803 new Promise(function(resolve, reject) {
66804 d2.onClick(context, resolve, reject);
66805 if (d2.onClick.length <= 1) {
66808 }).then(function() {
66809 context.validator().validate();
66811 }).on("mouseover.highlight", function(d3_event, d2) {
66812 utilHighlightEntities(d2.entityIds, true, context);
66813 }).on("mouseout.highlight", function(d3_event, d2) {
66814 utilHighlightEntities(d2.entityIds, false, context);
66816 buttons.each(function(d2) {
66817 var iconName = d2.icon || "iD-icon-wrench";
66818 if (iconName.startsWith("maki")) {
66821 select_default2(this).call(svgIcon("#" + iconName, "fix-icon"));
66823 buttons.append("span").attr("class", "fix-message").each(function(d2) {
66824 return d2.title(select_default2(this));
66826 fixesEnter.merge(fixes).selectAll("button").classed("actionable", function(d2) {
66828 }).attr("disabled", function(d2) {
66829 return d2.onClick ? null : "true";
66830 }).attr("title", function(d2) {
66831 if (d2.disabledReason) {
66832 return d2.disabledReason;
66837 section.entityIDs = function(val) {
66838 if (!arguments.length)
66840 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
66842 _activeIssueID = null;
66850 // modules/ui/preset_icon.js
66851 function uiPresetIcon() {
66854 function presetIcon(selection2) {
66855 selection2.each(render);
66857 function getIcon(p2, geom) {
66858 if (p2.isFallback && p2.isFallback())
66859 return geom === "vertex" ? "" : "iD-icon-" + p2.id;
66862 if (geom === "line")
66863 return "iD-other-line";
66864 if (geom === "vertex")
66865 return "temaki-vertex";
66866 return "maki-marker-stroked";
66868 function renderPointBorder(container, drawPoint) {
66869 let pointBorder = container.selectAll(".preset-icon-point-border").data(drawPoint ? [0] : []);
66870 pointBorder.exit().remove();
66871 let pointBorderEnter = pointBorder.enter();
66874 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");
66875 pointBorder = pointBorderEnter.merge(pointBorder);
66877 function renderCategoryBorder(container, category) {
66878 let categoryBorder = container.selectAll(".preset-icon-category-border").data(category ? [0] : []);
66879 categoryBorder.exit().remove();
66880 let categoryBorderEnter = categoryBorder.enter();
66882 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}`);
66883 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");
66884 categoryBorder = categoryBorderEnter.merge(categoryBorder);
66886 categoryBorder.selectAll("path").attr("class", `area ${category.id}`);
66889 function renderCircleFill(container, drawVertex) {
66890 let vertexFill = container.selectAll(".preset-icon-fill-vertex").data(drawVertex ? [0] : []);
66891 vertexFill.exit().remove();
66892 let vertexFillEnter = vertexFill.enter();
66896 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);
66897 vertexFill = vertexFillEnter.merge(vertexFill);
66899 function renderSquareFill(container, drawArea, tagClasses) {
66900 let fill = container.selectAll(".preset-icon-fill-area").data(drawArea ? [0] : []);
66901 fill.exit().remove();
66902 let fillEnter = fill.enter();
66906 const l2 = d2 * 2 / 3;
66907 const c1 = (w2 - l2) / 2;
66908 const c2 = c1 + l2;
66909 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}`);
66910 ["fill", "stroke"].forEach((klass) => {
66911 fillEnter.append("path").attr("d", `M${c1} ${c1} L${c1} ${c2} L${c2} ${c2} L${c2} ${c1} Z`).attr("class", `area ${klass}`);
66913 const rVertex = 2.5;
66914 [[c1, c1], [c1, c2], [c2, c2], [c2, c1]].forEach((point2) => {
66915 fillEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", rVertex);
66917 const rMidpoint = 1.25;
66918 [[c1, w2 / 2], [c2, w2 / 2], [h2 / 2, c1], [h2 / 2, c2]].forEach((point2) => {
66919 fillEnter.append("circle").attr("class", "midpoint").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", rMidpoint);
66921 fill = fillEnter.merge(fill);
66922 fill.selectAll("path.stroke").attr("class", `area stroke ${tagClasses}`);
66923 fill.selectAll("path.fill").attr("class", `area fill ${tagClasses}`);
66925 function renderLine(container, drawLine, tagClasses) {
66926 let line = container.selectAll(".preset-icon-line").data(drawLine ? [0] : []);
66927 line.exit().remove();
66928 let lineEnter = line.enter();
66932 const y2 = Math.round(d2 * 0.72);
66933 const l2 = Math.round(d2 * 0.6);
66935 const x12 = (w2 - l2) / 2;
66936 const x2 = x12 + l2;
66937 lineEnter = lineEnter.append("svg").attr("class", "preset-icon-line").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`);
66938 ["casing", "stroke"].forEach((klass) => {
66939 lineEnter.append("path").attr("d", `M${x12} ${y2} L${x2} ${y2}`).attr("class", `line ${klass}`);
66941 [[x12 - 1, y2], [x2 + 1, y2]].forEach((point2) => {
66942 lineEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", r2);
66944 line = lineEnter.merge(line);
66945 line.selectAll("path.stroke").attr("class", `line stroke ${tagClasses}`);
66946 line.selectAll("path.casing").attr("class", `line casing ${tagClasses}`);
66948 function renderRoute(container, drawRoute, p2) {
66949 let route = container.selectAll(".preset-icon-route").data(drawRoute ? [0] : []);
66950 route.exit().remove();
66951 let routeEnter = route.enter();
66955 const y12 = Math.round(d2 * 0.8);
66956 const y2 = Math.round(d2 * 0.68);
66957 const l2 = Math.round(d2 * 0.6);
66959 const x12 = (w2 - l2) / 2;
66960 const x2 = x12 + l2 / 3;
66961 const x3 = x2 + l2 / 3;
66962 const x4 = x3 + l2 / 3;
66963 routeEnter = routeEnter.append("svg").attr("class", "preset-icon-route").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`);
66964 ["casing", "stroke"].forEach((klass) => {
66965 routeEnter.append("path").attr("d", `M${x12} ${y12} L${x2} ${y2}`).attr("class", `segment0 line ${klass}`);
66966 routeEnter.append("path").attr("d", `M${x2} ${y2} L${x3} ${y12}`).attr("class", `segment1 line ${klass}`);
66967 routeEnter.append("path").attr("d", `M${x3} ${y12} L${x4} ${y2}`).attr("class", `segment2 line ${klass}`);
66969 [[x12, y12], [x2, y2], [x3, y12], [x4, y2]].forEach((point2) => {
66970 routeEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", r2);
66972 route = routeEnter.merge(route);
66974 let routeType = p2.tags.type === "waterway" ? "waterway" : p2.tags.route;
66975 const segmentPresetIDs = routeSegments[routeType];
66976 for (let i3 in segmentPresetIDs) {
66977 const segmentPreset = _mainPresetIndex.item(segmentPresetIDs[i3]);
66978 const segmentTagClasses = svgTagClasses().getClassesString(segmentPreset.tags, "");
66979 route.selectAll(`path.stroke.segment${i3}`).attr("class", `segment${i3} line stroke ${segmentTagClasses}`);
66980 route.selectAll(`path.casing.segment${i3}`).attr("class", `segment${i3} line casing ${segmentTagClasses}`);
66984 function renderSvgIcon(container, picon, geom, isFramed, category, tagClasses) {
66985 const isMaki = picon && /^maki-/.test(picon);
66986 const isTemaki = picon && /^temaki-/.test(picon);
66987 const isFa = picon && /^fa[srb]-/.test(picon);
66988 const isR\u00F6ntgen = picon && /^roentgen-/.test(picon);
66989 const isiDIcon = picon && !(isMaki || isTemaki || isFa || isR\u00F6ntgen);
66990 let icon2 = container.selectAll(".preset-icon").data(picon ? [0] : []);
66991 icon2.exit().remove();
66992 icon2 = icon2.enter().append("div").attr("class", "preset-icon").call(svgIcon("")).merge(icon2);
66993 icon2.attr("class", "preset-icon " + (geom ? geom + "-geom" : "")).classed("category", category).classed("framed", isFramed).classed("preset-icon-iD", isiDIcon);
66994 icon2.selectAll("svg").attr("class", "icon " + picon + " " + (!isiDIcon && geom !== "line" ? "" : tagClasses));
66995 icon2.selectAll("use").attr("href", "#" + picon);
66997 function renderImageIcon(container, imageURL) {
66998 let imageIcon = container.selectAll("img.image-icon").data(imageURL ? [0] : []);
66999 imageIcon.exit().remove();
67000 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);
67001 imageIcon.attr("src", imageURL);
67003 const routeSegments = {
67004 bicycle: ["highway/cycleway", "highway/cycleway", "highway/cycleway"],
67005 bus: ["highway/unclassified", "highway/secondary", "highway/primary"],
67006 trolleybus: ["highway/unclassified", "highway/secondary", "highway/primary"],
67007 detour: ["highway/tertiary", "highway/residential", "highway/unclassified"],
67008 ferry: ["route/ferry", "route/ferry", "route/ferry"],
67009 foot: ["highway/footway", "highway/footway", "highway/footway"],
67010 hiking: ["highway/path", "highway/path", "highway/path"],
67011 horse: ["highway/bridleway", "highway/bridleway", "highway/bridleway"],
67012 light_rail: ["railway/light_rail", "railway/light_rail", "railway/light_rail"],
67013 monorail: ["railway/monorail", "railway/monorail", "railway/monorail"],
67014 mtb: ["highway/path", "highway/track", "highway/bridleway"],
67015 pipeline: ["man_made/pipeline", "man_made/pipeline", "man_made/pipeline"],
67016 piste: ["piste/downhill", "piste/hike", "piste/nordic"],
67017 power: ["power/line", "power/line", "power/line"],
67018 road: ["highway/secondary", "highway/primary", "highway/trunk"],
67019 subway: ["railway/subway", "railway/subway", "railway/subway"],
67020 train: ["railway/rail", "railway/rail", "railway/rail"],
67021 tram: ["railway/tram", "railway/tram", "railway/tram"],
67022 waterway: ["waterway/stream", "waterway/stream", "waterway/stream"]
67024 function render() {
67025 let p2 = _preset.apply(this, arguments);
67026 let geom = _geometry ? _geometry.apply(this, arguments) : null;
67027 if (geom === "relation" && p2.tags && (p2.tags.type === "route" && p2.tags.route && routeSegments[p2.tags.route] || p2.tags.type === "waterway")) {
67030 const showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
67031 const isFallback = p2.isFallback && p2.isFallback();
67032 const imageURL = showThirdPartyIcons === "true" && p2.imageURL;
67033 const picon = getIcon(p2, geom);
67034 const isCategory = !p2.setTags;
67035 const drawPoint = false;
67036 const drawVertex = picon !== null && geom === "vertex";
67037 const drawLine = picon && geom === "line" && !isFallback && !isCategory;
67038 const drawArea = picon && geom === "area" && !isFallback && !isCategory;
67039 const drawRoute = picon && geom === "route";
67040 const isFramed = drawVertex || drawArea || drawLine || drawRoute || isCategory;
67041 let tags = !isCategory ? p2.setTags({}, geom) : {};
67042 for (let k2 in tags) {
67043 if (tags[k2] === "*") {
67047 let tagClasses = svgTagClasses().getClassesString(tags, "");
67048 let selection2 = select_default2(this);
67049 let container = selection2.selectAll(".preset-icon-container").data([0]);
67050 container = container.enter().append("div").attr("class", "preset-icon-container").merge(container);
67051 container.classed("showing-img", !!imageURL).classed("fallback", isFallback);
67052 renderCategoryBorder(container, isCategory && p2);
67053 renderPointBorder(container, drawPoint);
67054 renderCircleFill(container, drawVertex);
67055 renderSquareFill(container, drawArea, tagClasses);
67056 renderLine(container, drawLine, tagClasses);
67057 renderRoute(container, drawRoute, p2);
67058 renderSvgIcon(container, picon, geom, isFramed, isCategory, tagClasses);
67059 renderImageIcon(container, imageURL);
67061 presetIcon.preset = function(val) {
67062 if (!arguments.length)
67064 _preset = utilFunctor(val);
67067 presetIcon.geometry = function(val) {
67068 if (!arguments.length)
67070 _geometry = utilFunctor(val);
67076 // modules/ui/sections/feature_type.js
67077 function uiSectionFeatureType(context) {
67078 var dispatch14 = dispatch_default("choose");
67079 var _entityIDs = [];
67082 var section = uiSection("feature-type", context).label(() => _t.append("inspector.feature_type")).disclosureContent(renderDisclosureContent);
67083 function renderDisclosureContent(selection2) {
67084 selection2.classed("preset-list-item", true);
67085 selection2.classed("mixed-types", _presets.length > 1);
67086 var presetButtonWrap = selection2.selectAll(".preset-list-button-wrap").data([0]).enter().append("div").attr("class", "preset-list-button-wrap");
67087 var presetButton = presetButtonWrap.append("button").attr("class", "preset-list-button preset-reset").call(
67088 uiTooltip().title(() => _t.append("inspector.back_tooltip")).placement("bottom")
67090 presetButton.append("div").attr("class", "preset-icon-container");
67091 presetButton.append("div").attr("class", "label").append("div").attr("class", "label-inner");
67092 presetButtonWrap.append("div").attr("class", "accessory-buttons");
67093 var tagReferenceBodyWrap = selection2.selectAll(".tag-reference-body-wrap").data([0]);
67094 tagReferenceBodyWrap = tagReferenceBodyWrap.enter().append("div").attr("class", "tag-reference-body-wrap").merge(tagReferenceBodyWrap);
67095 if (_tagReference) {
67096 selection2.selectAll(".preset-list-button-wrap .accessory-buttons").style("display", _presets.length === 1 ? null : "none").call(_tagReference.button);
67097 tagReferenceBodyWrap.style("display", _presets.length === 1 ? null : "none").call(_tagReference.body);
67099 selection2.selectAll(".preset-reset").on("click", function() {
67100 dispatch14.call("choose", this, _presets);
67101 }).on("pointerdown pointerup mousedown mouseup", function(d3_event) {
67102 d3_event.preventDefault();
67103 d3_event.stopPropagation();
67105 var geometries = entityGeometries();
67106 selection2.select(".preset-list-item button").call(
67107 uiPresetIcon().geometry(_presets.length === 1 ? geometries.length === 1 && geometries[0] : null).preset(_presets.length === 1 ? _presets[0] : _mainPresetIndex.item("point"))
67109 var names = _presets.length === 1 ? [
67110 _presets[0].nameLabel(),
67111 _presets[0].subtitleLabel()
67112 ].filter(Boolean) : [_t.append("inspector.multiple_types")];
67113 var label = selection2.select(".label-inner");
67114 var nameparts = label.selectAll(".namepart").data(names, (d2) => d2.stringId);
67115 nameparts.exit().remove();
67116 nameparts.enter().append("div").attr("class", "namepart").text("").each(function(d2) {
67117 d2(select_default2(this));
67120 section.entityIDs = function(val) {
67121 if (!arguments.length)
67126 section.presets = function(val) {
67127 if (!arguments.length)
67129 if (!utilArrayIdentical(val, _presets)) {
67131 if (_presets.length === 1) {
67132 _tagReference = uiTagReference(_presets[0].reference(), context).showing(false);
67137 function entityGeometries() {
67139 for (var i3 in _entityIDs) {
67140 var geometry = context.graph().geometry(_entityIDs[i3]);
67141 if (!counts[geometry])
67142 counts[geometry] = 0;
67143 counts[geometry] += 1;
67145 return Object.keys(counts).sort(function(geom1, geom2) {
67146 return counts[geom2] - counts[geom1];
67149 return utilRebind(section, dispatch14, "on");
67152 // modules/ui/sections/preset_fields.js
67153 function uiSectionPresetFields(context) {
67154 var section = uiSection("preset-fields", context).label(() => _t.append("inspector.fields")).disclosureContent(renderDisclosureContent);
67155 var dispatch14 = dispatch_default("change", "revert");
67156 var formFields = uiFormFields(context);
67162 function renderDisclosureContent(selection2) {
67164 var graph = context.graph();
67165 var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) {
67166 geoms[graph.entity(entityID).geometry(graph)] = true;
67169 const loc = _entityIDs.reduce(function(extent, entityID) {
67170 var entity = context.graph().entity(entityID);
67171 return extent.extend(entity.extent(context.graph()));
67172 }, geoExtent()).center();
67173 var presetsManager = _mainPresetIndex;
67174 var allFields = [];
67175 var allMoreFields = [];
67176 var sharedTotalFields;
67177 _presets.forEach(function(preset) {
67178 var fields = preset.fields(loc);
67179 var moreFields = preset.moreFields(loc);
67180 allFields = utilArrayUnion(allFields, fields);
67181 allMoreFields = utilArrayUnion(allMoreFields, moreFields);
67182 if (!sharedTotalFields) {
67183 sharedTotalFields = utilArrayUnion(fields, moreFields);
67185 sharedTotalFields = sharedTotalFields.filter(function(field) {
67186 return fields.indexOf(field) !== -1 || moreFields.indexOf(field) !== -1;
67190 var sharedFields = allFields.filter(function(field) {
67191 return sharedTotalFields.indexOf(field) !== -1;
67193 var sharedMoreFields = allMoreFields.filter(function(field) {
67194 return sharedTotalFields.indexOf(field) !== -1;
67197 sharedFields.forEach(function(field) {
67198 if (field.matchAllGeometry(geometries)) {
67200 uiField(context, field, _entityIDs)
67204 var singularEntity = _entityIDs.length === 1 && graph.hasEntity(_entityIDs[0]);
67205 if (singularEntity && singularEntity.isHighwayIntersection(graph) && presetsManager.field("restrictions")) {
67207 uiField(context, presetsManager.field("restrictions"), _entityIDs)
67210 var additionalFields = utilArrayUnion(sharedMoreFields, presetsManager.universal());
67211 additionalFields.sort(function(field1, field2) {
67212 return field1.title().localeCompare(field2.title(), _mainLocalizer.localeCode());
67214 additionalFields.forEach(function(field) {
67215 if (sharedFields.indexOf(field) === -1 && field.matchAllGeometry(geometries)) {
67217 uiField(context, field, _entityIDs, { show: false })
67221 _fieldsArr.forEach(function(field) {
67222 field.on("change", function(t2, onInput) {
67223 dispatch14.call("change", field, _entityIDs, t2, onInput);
67224 }).on("revert", function(keys2) {
67225 dispatch14.call("revert", field, keys2);
67229 _fieldsArr.forEach(function(field) {
67230 field.state(_state).tags(_tags);
67233 formFields.fieldsArr(_fieldsArr).state(_state).klass("grouped-items-area")
67236 section.presets = function(val) {
67237 if (!arguments.length)
67239 if (!_presets || !val || !utilArrayIdentical(_presets, val)) {
67245 section.state = function(val) {
67246 if (!arguments.length)
67251 section.tags = function(val) {
67252 if (!arguments.length)
67257 section.entityIDs = function(val) {
67258 if (!arguments.length)
67260 if (!val || !_entityIDs || !utilArrayIdentical(_entityIDs, val)) {
67266 return utilRebind(section, dispatch14, "on");
67269 // modules/ui/sections/raw_member_editor.js
67270 function uiSectionRawMemberEditor(context) {
67271 var section = uiSection("raw-member-editor", context).shouldDisplay(function() {
67272 if (!_entityIDs || _entityIDs.length !== 1)
67274 var entity = context.hasEntity(_entityIDs[0]);
67275 return entity && entity.type === "relation";
67276 }).label(function() {
67277 var entity = context.hasEntity(_entityIDs[0]);
67280 var gt2 = entity.members.length > _maxMembers ? ">" : "";
67281 var count = gt2 + entity.members.slice(0, _maxMembers).length;
67282 return _t.append("inspector.title_count", { title: _t("inspector.members"), count });
67283 }).disclosureContent(renderDisclosureContent);
67284 var taginfo = services.taginfo;
67286 var _maxMembers = 1e3;
67287 function downloadMember(d3_event, d2) {
67288 d3_event.preventDefault();
67289 select_default2(this.parentNode).classed("tag-reference-loading", true);
67290 context.loadEntity(d2.id, function() {
67291 section.reRender();
67294 function zoomToMember(d3_event, d2) {
67295 d3_event.preventDefault();
67296 var entity = context.entity(d2.id);
67297 context.map().zoomToEase(entity);
67298 utilHighlightEntities([d2.id], true, context);
67300 function selectMember(d3_event, d2) {
67301 d3_event.preventDefault();
67302 utilHighlightEntities([d2.id], false, context);
67303 var entity = context.entity(d2.id);
67304 var mapExtent = context.map().extent();
67305 if (!entity.intersects(mapExtent, context.graph())) {
67306 context.map().zoomToEase(entity);
67308 context.enter(modeSelect(context, [d2.id]));
67310 function changeRole(d3_event, d2) {
67311 var oldRole = d2.role;
67312 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
67313 if (oldRole !== newRole) {
67314 var member = { id: d2.id, type: d2.type, role: newRole };
67316 actionChangeMember(d2.relation.id, member, d2.index),
67317 _t("operations.change_role.annotation", {
67321 context.validator().validate();
67324 function deleteMember(d3_event, d2) {
67325 utilHighlightEntities([d2.id], false, context);
67327 actionDeleteMember(d2.relation.id, d2.index),
67328 _t("operations.delete_member.annotation", {
67332 if (!context.hasEntity(d2.relation.id)) {
67333 context.enter(modeBrowse(context));
67335 context.validator().validate();
67338 function renderDisclosureContent(selection2) {
67339 var entityID = _entityIDs[0];
67340 var memberships = [];
67341 var entity = context.entity(entityID);
67342 entity.members.slice(0, _maxMembers).forEach(function(member, index) {
67349 member: context.hasEntity(member.id),
67350 domId: utilUniqueDomId(entityID + "-member-" + index)
67353 var list = selection2.selectAll(".member-list").data([0]);
67354 list = list.enter().append("ul").attr("class", "member-list").merge(list);
67355 var items = list.selectAll("li").data(memberships, function(d2) {
67356 return osmEntity.key(d2.relation) + "," + d2.index + "," + (d2.member ? osmEntity.key(d2.member) : "incomplete");
67358 items.exit().each(unbind).remove();
67359 var itemsEnter = items.enter().append("li").attr("class", "member-row form-field").classed("member-incomplete", function(d2) {
67362 itemsEnter.each(function(d2) {
67363 var item = select_default2(this);
67364 var label = item.append("label").attr("class", "field-label").attr("for", d2.domId);
67366 item.on("mouseover", function() {
67367 utilHighlightEntities([d2.id], true, context);
67368 }).on("mouseout", function() {
67369 utilHighlightEntities([d2.id], false, context);
67371 var labelLink = label.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectMember);
67372 labelLink.append("span").attr("class", "member-entity-type").text(function(d4) {
67373 var matched = _mainPresetIndex.match(d4.member, context.graph());
67374 return matched && matched.name() || utilDisplayType(d4.member.id);
67376 labelLink.append("span").attr("class", "member-entity-name").text(function(d4) {
67377 return utilDisplayName(d4.member);
67379 label.append("button").attr("title", _t("icons.remove")).attr("class", "remove member-delete").call(svgIcon("#iD-operation-delete"));
67380 label.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToMember);
67382 var labelText = label.append("span").attr("class", "label-text");
67383 labelText.append("span").attr("class", "member-entity-type").call(_t.append("inspector." + d2.type, { id: d2.id }));
67384 labelText.append("span").attr("class", "member-entity-name").call(_t.append("inspector.incomplete", { id: d2.id }));
67385 label.append("button").attr("class", "member-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMember);
67388 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67389 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
67391 }).property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
67393 wrapEnter.each(bindTypeahead);
67395 items = items.merge(itemsEnter).order();
67396 items.select("input.member-role").property("value", function(d2) {
67398 }).on("blur", changeRole).on("change", changeRole);
67399 items.select("button.member-delete").on("click", deleteMember);
67400 var dragOrigin, targetIndex;
67402 drag_default().on("start", function(d3_event) {
67407 targetIndex = null;
67408 }).on("drag", function(d3_event) {
67409 var x2 = d3_event.x - dragOrigin.x, y2 = d3_event.y - dragOrigin.y;
67410 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
67411 Math.sqrt(Math.pow(x2, 2) + Math.pow(y2, 2)) <= 5)
67413 var index = items.nodes().indexOf(this);
67414 select_default2(this).classed("dragging", true);
67415 targetIndex = null;
67416 selection2.selectAll("li.member-row").style("transform", function(d2, index2) {
67417 var node = select_default2(this).node();
67418 if (index === index2) {
67419 return "translate(" + x2 + "px, " + y2 + "px)";
67420 } else if (index2 > index && d3_event.y > node.offsetTop) {
67421 if (targetIndex === null || index2 > targetIndex) {
67422 targetIndex = index2;
67424 return "translateY(-100%)";
67425 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
67426 if (targetIndex === null || index2 < targetIndex) {
67427 targetIndex = index2;
67429 return "translateY(100%)";
67433 }).on("end", function(d3_event, d2) {
67434 if (!select_default2(this).classed("dragging"))
67436 var index = items.nodes().indexOf(this);
67437 select_default2(this).classed("dragging", false);
67438 selection2.selectAll("li.member-row").style("transform", null);
67439 if (targetIndex !== null) {
67441 actionMoveMember(d2.relation.id, index, targetIndex),
67442 _t("operations.reorder_members.annotation")
67444 context.validator().validate();
67448 function bindTypeahead(d2) {
67449 var row = select_default2(this);
67450 var role = row.selectAll("input.member-role");
67451 var origValue = role.property("value");
67452 function sort(value, data) {
67453 var sameletter = [];
67455 for (var i3 = 0; i3 < data.length; i3++) {
67456 if (data[i3].value.substring(0, value.length) === value) {
67457 sameletter.push(data[i3]);
67459 other.push(data[i3]);
67462 return sameletter.concat(other);
67465 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
67468 geometry = context.graph().geometry(d2.member.id);
67469 } else if (d2.type === "relation") {
67470 geometry = "relation";
67471 } else if (d2.type === "way") {
67474 geometry = "point";
67476 var rtype = entity.tags.type;
67479 rtype: rtype || "",
67482 }, function(err, data) {
67484 callback(sort(role2, data));
67486 }).on("cancel", function() {
67487 role.property("value", origValue);
67491 function unbind() {
67492 var row = select_default2(this);
67493 row.selectAll("input.member-role").call(uiCombobox.off, context);
67496 section.entityIDs = function(val) {
67497 if (!arguments.length)
67505 // modules/actions/delete_members.js
67506 function actionDeleteMembers(relationId, memberIndexes) {
67507 return function(graph) {
67508 memberIndexes.sort((a2, b2) => b2 - a2);
67509 for (var i3 in memberIndexes) {
67510 graph = actionDeleteMember(relationId, memberIndexes[i3])(graph);
67516 // modules/ui/sections/raw_membership_editor.js
67517 function uiSectionRawMembershipEditor(context) {
67518 var section = uiSection("raw-membership-editor", context).shouldDisplay(function() {
67519 return _entityIDs && _entityIDs.length;
67520 }).label(function() {
67521 var parents = getSharedParentRelations();
67522 var gt2 = parents.length > _maxMemberships ? ">" : "";
67523 var count = gt2 + parents.slice(0, _maxMemberships).length;
67524 return _t.append("inspector.title_count", { title: _t("inspector.relations"), count });
67525 }).disclosureContent(renderDisclosureContent);
67526 var taginfo = services.taginfo;
67527 var nearbyCombo = uiCombobox(context, "parent-relation").minItems(1).fetcher(fetchNearbyRelations).itemsMouseEnter(function(d3_event, d2) {
67529 utilHighlightEntities([d2.relation.id], true, context);
67530 }).itemsMouseLeave(function(d3_event, d2) {
67532 utilHighlightEntities([d2.relation.id], false, context);
67534 var _inChange = false;
67535 var _entityIDs = [];
67537 var _maxMemberships = 1e3;
67538 function getSharedParentRelations() {
67540 for (var i3 = 0; i3 < _entityIDs.length; i3++) {
67541 var entity = context.graph().hasEntity(_entityIDs[i3]);
67545 parents = context.graph().parentRelations(entity);
67547 parents = utilArrayIntersection(parents, context.graph().parentRelations(entity));
67549 if (!parents.length)
67554 function getMemberships() {
67555 var memberships = [];
67556 var relations = getSharedParentRelations().slice(0, _maxMemberships);
67557 var isMultiselect = _entityIDs.length > 1;
67558 var i3, relation, membership, index, member, indexedMember;
67559 for (i3 = 0; i3 < relations.length; i3++) {
67560 relation = relations[i3];
67564 hash: osmEntity.key(relation)
67566 for (index = 0; index < relation.members.length; index++) {
67567 member = relation.members[index];
67568 if (_entityIDs.indexOf(member.id) !== -1) {
67569 indexedMember = Object.assign({}, member, { index });
67570 membership.members.push(indexedMember);
67571 membership.hash += "," + index.toString();
67572 if (!isMultiselect) {
67573 memberships.push(membership);
67577 hash: osmEntity.key(relation)
67582 if (membership.members.length)
67583 memberships.push(membership);
67585 memberships.forEach(function(membership2) {
67586 membership2.domId = utilUniqueDomId("membership-" + membership2.relation.id);
67588 membership2.members.forEach(function(member2) {
67589 if (roles.indexOf(member2.role) === -1)
67590 roles.push(member2.role);
67592 membership2.role = roles.length === 1 ? roles[0] : roles;
67594 return memberships;
67596 function selectRelation(d3_event, d2) {
67597 d3_event.preventDefault();
67598 utilHighlightEntities([d2.relation.id], false, context);
67599 context.enter(modeSelect(context, [d2.relation.id]));
67601 function zoomToRelation(d3_event, d2) {
67602 d3_event.preventDefault();
67603 var entity = context.entity(d2.relation.id);
67604 context.map().zoomToEase(entity);
67605 utilHighlightEntities([d2.relation.id], true, context);
67607 function changeRole(d3_event, d2) {
67612 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
67613 if (!newRole.trim() && typeof d2.role !== "string")
67615 var membersToUpdate = d2.members.filter(function(member) {
67616 return member.role !== newRole;
67618 if (membersToUpdate.length) {
67621 function actionChangeMemberRoles(graph) {
67622 membersToUpdate.forEach(function(member) {
67623 var newMember = Object.assign({}, member, { role: newRole });
67624 delete newMember.index;
67625 graph = actionChangeMember(d2.relation.id, newMember, member.index)(graph);
67629 _t("operations.change_role.annotation", {
67630 n: membersToUpdate.length
67633 context.validator().validate();
67637 function addMembership(d2, role) {
67639 _showBlank = false;
67640 function actionAddMembers(relationId, ids, role2) {
67641 return function(graph) {
67642 for (var i3 in ids) {
67643 var member = { id: ids[i3], type: graph.entity(ids[i3]).type, role: role2 };
67644 graph = actionAddMember(relationId, member)(graph);
67651 actionAddMembers(d2.relation.id, _entityIDs, role),
67652 _t("operations.add_member.annotation", {
67653 n: _entityIDs.length
67656 context.validator().validate();
67658 var relation = osmRelation();
67660 actionAddEntity(relation),
67661 actionAddMembers(relation.id, _entityIDs, role),
67662 _t("operations.add.annotation.relation")
67664 context.enter(modeSelect(context, [relation.id]).newFeature(true));
67667 function deleteMembership(d3_event, d2) {
67671 utilHighlightEntities([d2.relation.id], false, context);
67672 var indexes = d2.members.map(function(member) {
67673 return member.index;
67676 actionDeleteMembers(d2.relation.id, indexes),
67677 _t("operations.delete_member.annotation", {
67678 n: _entityIDs.length
67681 context.validator().validate();
67683 function fetchNearbyRelations(q2, callback) {
67684 var newRelation = {
67686 value: _t("inspector.new_relation"),
67687 display: _t.append("inspector.new_relation")
67689 var entityID = _entityIDs[0];
67691 var graph = context.graph();
67692 function baseDisplayLabel(entity) {
67693 var matched = _mainPresetIndex.match(entity, graph);
67694 var presetName = matched && matched.name() || _t("inspector.relation");
67695 var entityName = utilDisplayName(entity) || "";
67696 return presetName + " " + entityName;
67698 var explicitRelation = q2 && context.hasEntity(q2.toLowerCase());
67699 if (explicitRelation && explicitRelation.type === "relation" && explicitRelation.id !== entityID) {
67701 relation: explicitRelation,
67702 value: baseDisplayLabel(explicitRelation) + " " + explicitRelation.id
67705 context.history().intersects(context.map().extent()).forEach(function(entity) {
67706 if (entity.type !== "relation" || entity.id === entityID)
67708 var value = baseDisplayLabel(entity);
67709 if (q2 && (value + " " + entity.id).toLowerCase().indexOf(q2.toLowerCase()) === -1)
67711 result.push({ relation: entity, value });
67713 result.sort(function(a2, b2) {
67714 return osmRelation.creationOrder(a2.relation, b2.relation);
67716 var dupeGroups = Object.values(utilArrayGroupBy(result, "value")).filter(function(v2) {
67717 return v2.length > 1;
67719 dupeGroups.forEach(function(group) {
67720 group.forEach(function(obj) {
67721 obj.value += " " + obj.relation.id;
67725 result.forEach(function(obj) {
67726 obj.title = obj.value;
67728 result.unshift(newRelation);
67731 function renderDisclosureContent(selection2) {
67732 var memberships = getMemberships();
67733 var list = selection2.selectAll(".member-list").data([0]);
67734 list = list.enter().append("ul").attr("class", "member-list").merge(list);
67735 var items = list.selectAll("li.member-row-normal").data(memberships, function(d2) {
67738 items.exit().each(unbind).remove();
67739 var itemsEnter = items.enter().append("li").attr("class", "member-row member-row-normal form-field");
67740 itemsEnter.on("mouseover", function(d3_event, d2) {
67741 utilHighlightEntities([d2.relation.id], true, context);
67742 }).on("mouseout", function(d3_event, d2) {
67743 utilHighlightEntities([d2.relation.id], false, context);
67745 var labelEnter = itemsEnter.append("label").attr("class", "field-label").attr("for", function(d2) {
67748 var labelLink = labelEnter.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectRelation);
67749 labelLink.append("span").attr("class", "member-entity-type").text(function(d2) {
67750 var matched = _mainPresetIndex.match(d2.relation, context.graph());
67751 return matched && matched.name() || _t.html("inspector.relation");
67753 labelLink.append("span").attr("class", "member-entity-name").text(function(d2) {
67754 return utilDisplayName(d2.relation);
67756 labelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", deleteMembership);
67757 labelEnter.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToRelation);
67758 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67759 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
67761 }).property("type", "text").property("value", function(d2) {
67762 return typeof d2.role === "string" ? d2.role : "";
67763 }).attr("title", function(d2) {
67764 return Array.isArray(d2.role) ? d2.role.filter(Boolean).join("\n") : d2.role;
67765 }).attr("placeholder", function(d2) {
67766 return Array.isArray(d2.role) ? _t("inspector.multiple_roles") : _t("inspector.role");
67767 }).classed("mixed", function(d2) {
67768 return Array.isArray(d2.role);
67769 }).call(utilNoAuto).on("blur", changeRole).on("change", changeRole);
67771 wrapEnter.each(bindTypeahead);
67773 var newMembership = list.selectAll(".member-row-new").data(_showBlank ? [0] : []);
67774 newMembership.exit().remove();
67775 var newMembershipEnter = newMembership.enter().append("li").attr("class", "member-row member-row-new form-field");
67776 var newLabelEnter = newMembershipEnter.append("label").attr("class", "field-label");
67777 newLabelEnter.append("input").attr("placeholder", _t("inspector.choose_relation")).attr("type", "text").attr("class", "member-entity-input").call(utilNoAuto);
67778 newLabelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", function() {
67779 list.selectAll(".member-row-new").remove();
67781 var newWrapEnter = newMembershipEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67782 newWrapEnter.append("input").attr("class", "member-role").property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
67783 newMembership = newMembership.merge(newMembershipEnter);
67784 newMembership.selectAll(".member-entity-input").on("blur", cancelEntity).call(
67785 nearbyCombo.on("accept", acceptEntity).on("cancel", cancelEntity)
67787 var addRow = selection2.selectAll(".add-row").data([0]);
67788 var addRowEnter = addRow.enter().append("div").attr("class", "add-row");
67789 var addRelationButton = addRowEnter.append("button").attr("class", "add-relation").attr("aria-label", _t("inspector.add_to_relation"));
67790 addRelationButton.call(svgIcon("#iD-icon-plus", "light"));
67791 addRelationButton.call(uiTooltip().title(() => _t.append("inspector.add_to_relation")).placement(_mainLocalizer.textDirection() === "ltr" ? "right" : "left"));
67792 addRowEnter.append("div").attr("class", "space-value");
67793 addRowEnter.append("div").attr("class", "space-buttons");
67794 addRow = addRow.merge(addRowEnter);
67795 addRow.select(".add-relation").on("click", function() {
67797 section.reRender();
67798 list.selectAll(".member-entity-input").node().focus();
67800 function acceptEntity(d2) {
67806 utilHighlightEntities([d2.relation.id], false, context);
67807 var role = context.cleanRelationRole(list.selectAll(".member-row-new .member-role").property("value"));
67808 addMembership(d2, role);
67810 function cancelEntity() {
67811 var input = newMembership.selectAll(".member-entity-input");
67812 input.property("value", "");
67813 context.surface().selectAll(".highlighted").classed("highlighted", false);
67815 function bindTypeahead(d2) {
67816 var row = select_default2(this);
67817 var role = row.selectAll("input.member-role");
67818 var origValue = role.property("value");
67819 function sort(value, data) {
67820 var sameletter = [];
67822 for (var i3 = 0; i3 < data.length; i3++) {
67823 if (data[i3].value.substring(0, value.length) === value) {
67824 sameletter.push(data[i3]);
67826 other.push(data[i3]);
67829 return sameletter.concat(other);
67832 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
67833 var rtype = d2.relation.tags.type;
67836 rtype: rtype || "",
67837 geometry: context.graph().geometry(_entityIDs[0]),
67839 }, function(err, data) {
67841 callback(sort(role2, data));
67843 }).on("cancel", function() {
67844 role.property("value", origValue);
67848 function unbind() {
67849 var row = select_default2(this);
67850 row.selectAll("input.member-role").call(uiCombobox.off, context);
67853 section.entityIDs = function(val) {
67854 if (!arguments.length)
67857 _showBlank = false;
67863 // modules/ui/sections/selection_list.js
67864 function uiSectionSelectionList(context) {
67865 var _selectedIDs = [];
67866 var section = uiSection("selected-features", context).shouldDisplay(function() {
67867 return _selectedIDs.length > 1;
67868 }).label(function() {
67869 return _t.append("inspector.title_count", { title: _t("inspector.features"), count: _selectedIDs.length });
67870 }).disclosureContent(renderDisclosureContent);
67871 context.history().on("change.selectionList", function(difference) {
67873 section.reRender();
67876 section.entityIDs = function(val) {
67877 if (!arguments.length)
67878 return _selectedIDs;
67879 _selectedIDs = val;
67882 function selectEntity(d3_event, entity) {
67883 context.enter(modeSelect(context, [entity.id]));
67885 function deselectEntity(d3_event, entity) {
67886 var selectedIDs = _selectedIDs.slice();
67887 var index = selectedIDs.indexOf(entity.id);
67889 selectedIDs.splice(index, 1);
67890 context.enter(modeSelect(context, selectedIDs));
67893 function renderDisclosureContent(selection2) {
67894 var list = selection2.selectAll(".feature-list").data([0]);
67895 list = list.enter().append("ul").attr("class", "feature-list").merge(list);
67896 var entities = _selectedIDs.map(function(id2) {
67897 return context.hasEntity(id2);
67898 }).filter(Boolean);
67899 var items = list.selectAll(".feature-list-item").data(entities, osmEntity.key);
67900 items.exit().remove();
67901 var enter = items.enter().append("li").attr("class", "feature-list-item").each(function(d2) {
67902 select_default2(this).on("mouseover", function() {
67903 utilHighlightEntities([d2.id], true, context);
67904 }).on("mouseout", function() {
67905 utilHighlightEntities([d2.id], false, context);
67908 var label = enter.append("button").attr("class", "label").on("click", selectEntity);
67909 label.append("span").attr("class", "entity-geom-icon").call(svgIcon("", "pre-text"));
67910 label.append("span").attr("class", "entity-type");
67911 label.append("span").attr("class", "entity-name");
67912 enter.append("button").attr("class", "close").attr("title", _t("icons.deselect")).on("click", deselectEntity).call(svgIcon("#iD-icon-close"));
67913 items = items.merge(enter);
67914 items.selectAll(".entity-geom-icon use").attr("href", function() {
67915 var entity = this.parentNode.parentNode.__data__;
67916 return "#iD-icon-" + entity.geometry(context.graph());
67918 items.selectAll(".entity-type").text(function(entity) {
67919 return _mainPresetIndex.match(entity, context.graph()).name();
67921 items.selectAll(".entity-name").text(function(d2) {
67922 var entity = context.entity(d2.id);
67923 return utilDisplayName(entity);
67929 // modules/ui/entity_editor.js
67930 function uiEntityEditor(context) {
67931 var dispatch14 = dispatch_default("choose");
67932 var _state = "select";
67933 var _coalesceChanges = false;
67934 var _modified = false;
67937 var _activePresets = [];
67940 function entityEditor(selection2) {
67941 var combinedTags = utilCombinedTags(_entityIDs, context.graph());
67942 var header = selection2.selectAll(".header").data([0]);
67943 var headerEnter = header.enter().append("div").attr("class", "header fillL");
67944 var direction = _mainLocalizer.textDirection() === "rtl" ? "forward" : "backward";
67945 headerEnter.append("button").attr("class", "preset-reset preset-choose").attr("title", _t("inspector.back_tooltip")).call(svgIcon(`#iD-icon-${direction}`));
67946 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
67947 context.enter(modeBrowse(context));
67948 }).call(svgIcon(_modified ? "#iD-icon-apply" : "#iD-icon-close"));
67949 headerEnter.append("h2");
67950 header = header.merge(headerEnter);
67951 header.selectAll("h2").text("").call(_entityIDs.length === 1 ? _t.append("inspector.edit") : _t.append("inspector.edit_features"));
67952 header.selectAll(".preset-reset").on("click", function() {
67953 dispatch14.call("choose", this, _activePresets);
67955 var body = selection2.selectAll(".inspector-body").data([0]);
67956 var bodyEnter = body.enter().append("div").attr("class", "entity-editor inspector-body sep-top");
67957 body = body.merge(bodyEnter);
67960 uiSectionSelectionList(context),
67961 uiSectionFeatureType(context).on("choose", function(presets) {
67962 dispatch14.call("choose", this, presets);
67964 uiSectionEntityIssues(context),
67965 uiSectionPresetFields(context).on("change", changeTags).on("revert", revertTags),
67966 uiSectionRawTagEditor("raw-tag-editor", context).on("change", changeTags),
67967 uiSectionRawMemberEditor(context),
67968 uiSectionRawMembershipEditor(context)
67971 _sections.forEach(function(section) {
67972 if (section.entityIDs) {
67973 section.entityIDs(_entityIDs);
67975 if (section.presets) {
67976 section.presets(_activePresets);
67978 if (section.tags) {
67979 section.tags(combinedTags);
67981 if (section.state) {
67982 section.state(_state);
67984 body.call(section.render);
67986 context.history().on("change.entity-editor", historyChanged);
67987 function historyChanged(difference) {
67988 if (selection2.selectAll(".entity-editor").empty())
67990 if (_state === "hide")
67992 var significant = !difference || difference.didChange.properties || difference.didChange.addition || difference.didChange.deletion;
67995 _entityIDs = _entityIDs.filter(context.hasEntity);
67996 if (!_entityIDs.length)
67998 var priorActivePreset = _activePresets.length === 1 && _activePresets[0];
67999 loadActivePresets();
68000 var graph = context.graph();
68001 entityEditor.modified(_base !== graph);
68002 entityEditor(selection2);
68003 if (priorActivePreset && _activePresets.length === 1 && priorActivePreset !== _activePresets[0]) {
68004 context.container().selectAll(".entity-editor button.preset-reset .label").style("background-color", "#fff").transition().duration(750).style("background-color", null);
68008 function changeTags(entityIDs, changed, onInput) {
68010 for (var i3 in entityIDs) {
68011 var entityID = entityIDs[i3];
68012 var entity = context.entity(entityID);
68013 var tags = Object.assign({}, entity.tags);
68014 if (typeof changed === "function") {
68015 tags = changed(tags);
68017 for (var k2 in changed) {
68020 var v2 = changed[k2];
68021 if (typeof v2 === "object") {
68022 tags[k2] = tags[v2.oldKey];
68023 } else if (v2 !== void 0 || tags.hasOwnProperty(k2)) {
68029 tags = utilCleanTags(tags);
68031 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
68032 actions.push(actionChangeTags(entityID, tags));
68035 if (actions.length) {
68036 var combinedAction = function(graph) {
68037 actions.forEach(function(action) {
68038 graph = action(graph);
68042 var annotation = _t("operations.change_tags.annotation");
68043 if (_coalesceChanges) {
68044 context.overwrite(combinedAction, annotation);
68046 context.perform(combinedAction, annotation);
68047 _coalesceChanges = !!onInput;
68051 context.validator().validate();
68054 function revertTags(keys2) {
68056 for (var i3 in _entityIDs) {
68057 var entityID = _entityIDs[i3];
68058 var original = context.graph().base().entities[entityID];
68060 for (var j3 in keys2) {
68061 var key = keys2[j3];
68062 changed[key] = original ? original.tags[key] : void 0;
68064 var entity = context.entity(entityID);
68065 var tags = Object.assign({}, entity.tags);
68066 for (var k2 in changed) {
68069 var v2 = changed[k2];
68070 if (v2 !== void 0 || tags.hasOwnProperty(k2)) {
68074 tags = utilCleanTags(tags);
68075 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
68076 actions.push(actionChangeTags(entityID, tags));
68079 if (actions.length) {
68080 var combinedAction = function(graph) {
68081 actions.forEach(function(action) {
68082 graph = action(graph);
68086 var annotation = _t("operations.change_tags.annotation");
68087 if (_coalesceChanges) {
68088 context.overwrite(combinedAction, annotation);
68090 context.perform(combinedAction, annotation);
68091 _coalesceChanges = false;
68094 context.validator().validate();
68096 entityEditor.modified = function(val) {
68097 if (!arguments.length)
68100 return entityEditor;
68102 entityEditor.state = function(val) {
68103 if (!arguments.length)
68106 return entityEditor;
68108 entityEditor.entityIDs = function(val) {
68109 if (!arguments.length)
68111 _base = context.graph();
68112 _coalesceChanges = false;
68113 if (val && _entityIDs && utilArrayIdentical(_entityIDs, val))
68114 return entityEditor;
68116 loadActivePresets(true);
68117 return entityEditor.modified(false);
68119 entityEditor.newFeature = function(val) {
68120 if (!arguments.length)
68121 return _newFeature;
68123 return entityEditor;
68125 function loadActivePresets(isForNewSelection) {
68126 var graph = context.graph();
68128 for (var i3 in _entityIDs) {
68129 var entity = graph.hasEntity(_entityIDs[i3]);
68132 var match = _mainPresetIndex.match(entity, graph);
68133 if (!counts[match.id])
68134 counts[match.id] = 0;
68135 counts[match.id] += 1;
68137 var matches = Object.keys(counts).sort(function(p1, p2) {
68138 return counts[p2] - counts[p1];
68139 }).map(function(pID) {
68140 return _mainPresetIndex.item(pID);
68142 if (!isForNewSelection) {
68143 var weakPreset = _activePresets.length === 1 && !_activePresets[0].isFallback() && Object.keys(_activePresets[0].addTags || {}).length === 0;
68144 if (weakPreset && matches.length === 1 && matches[0].isFallback())
68147 entityEditor.presets(matches);
68149 entityEditor.presets = function(val) {
68150 if (!arguments.length)
68151 return _activePresets;
68152 if (!utilArrayIdentical(val, _activePresets)) {
68153 _activePresets = val;
68155 return entityEditor;
68157 return utilRebind(entityEditor, dispatch14, "on");
68160 // modules/ui/feature_list.js
68161 var sexagesimal = __toESM(require_sexagesimal());
68162 function uiFeatureList(context) {
68163 var _geocodeResults;
68164 function featureList(selection2) {
68165 var header = selection2.append("div").attr("class", "header fillL");
68166 header.append("h2").call(_t.append("inspector.feature_list"));
68167 var searchWrap = selection2.append("div").attr("class", "search-header");
68168 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
68169 var search = searchWrap.append("input").attr("placeholder", _t("inspector.search")).attr("type", "search").call(utilNoAuto).on("keypress", keypress).on("keydown", keydown).on("input", inputevent);
68170 var listWrap = selection2.append("div").attr("class", "inspector-body");
68171 var list = listWrap.append("div").attr("class", "feature-list");
68172 context.on("exit.feature-list", clearSearch);
68173 context.map().on("drawn.feature-list", mapDrawn);
68174 context.keybinding().on(uiCmd("\u2318F"), focusSearch);
68175 function focusSearch(d3_event) {
68176 var mode = context.mode() && context.mode().id;
68177 if (mode !== "browse")
68179 d3_event.preventDefault();
68180 search.node().focus();
68182 function keydown(d3_event) {
68183 if (d3_event.keyCode === 27) {
68184 search.node().blur();
68187 function keypress(d3_event) {
68188 var q2 = search.property("value"), items = list.selectAll(".feature-list-item");
68189 if (d3_event.keyCode === 13 && // ↩ Return
68190 q2.length && items.size()) {
68191 click(d3_event, items.datum());
68194 function inputevent() {
68195 _geocodeResults = void 0;
68198 function clearSearch() {
68199 search.property("value", "");
68202 function mapDrawn(e3) {
68207 function features() {
68209 var graph = context.graph();
68210 var visibleCenter = context.map().extent().center();
68211 var q2 = search.property("value").toLowerCase();
68214 var locationMatch = sexagesimal.pair(q2.toUpperCase()) || q2.match(/^(-?\d+\.?\d*)\s+(-?\d+\.?\d*)$/);
68215 if (locationMatch) {
68216 var loc = [Number(locationMatch[0]), Number(locationMatch[1])];
68220 type: _t("inspector.location"),
68221 name: dmsCoordinatePair([loc[1], loc[0]]),
68225 var idMatch = !locationMatch && q2.match(/(?:^|\W)(node|way|relation|[nwr])\W{0,2}0*([1-9]\d*)(?:\W|$)/i);
68227 var elemType = idMatch[1].charAt(0);
68228 var elemId = idMatch[2];
68230 id: elemType + elemId,
68231 geometry: elemType === "n" ? "point" : elemType === "w" ? "line" : "relation",
68232 type: elemType === "n" ? _t("inspector.node") : elemType === "w" ? _t("inspector.way") : _t("inspector.relation"),
68236 var allEntities = graph.entities;
68237 var localResults = [];
68238 for (var id2 in allEntities) {
68239 var entity = allEntities[id2];
68242 var name = utilDisplayName(entity) || "";
68243 if (name.toLowerCase().indexOf(q2) < 0)
68245 var matched = _mainPresetIndex.match(entity, graph);
68246 var type2 = matched && matched.name() || utilDisplayType(entity.id);
68247 var extent = entity.extent(graph);
68248 var distance = extent ? geoSphericalDistance(visibleCenter, extent.center()) : 0;
68249 localResults.push({
68252 geometry: entity.geometry(graph),
68257 if (localResults.length > 100)
68260 localResults = localResults.sort(function byDistance(a2, b2) {
68261 return a2.distance - b2.distance;
68263 result = result.concat(localResults);
68264 (_geocodeResults || []).forEach(function(d2) {
68265 if (d2.osm_type && d2.osm_id) {
68266 var id3 = osmEntity.id.fromOSM(d2.osm_type, d2.osm_id);
68268 tags[d2.class] = d2.type;
68269 var attrs = { id: id3, type: d2.osm_type, tags };
68270 if (d2.osm_type === "way") {
68271 attrs.nodes = ["a", "a"];
68273 var tempEntity = osmEntity(attrs);
68274 var tempGraph = coreGraph([tempEntity]);
68275 var matched2 = _mainPresetIndex.match(tempEntity, tempGraph);
68276 var type3 = matched2 && matched2.name() || utilDisplayType(id3);
68279 geometry: tempEntity.geometry(tempGraph),
68281 name: d2.display_name,
68282 extent: new geoExtent(
68283 [Number(d2.boundingbox[3]), Number(d2.boundingbox[0])],
68284 [Number(d2.boundingbox[2]), Number(d2.boundingbox[1])]
68289 if (q2.match(/^[0-9]+$/)) {
68293 type: _t("inspector.node"),
68299 type: _t("inspector.way"),
68304 geometry: "relation",
68305 type: _t("inspector.relation"),
68311 function drawList() {
68312 var value = search.property("value");
68313 var results = features();
68314 list.classed("filtered", value.length);
68315 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"));
68316 resultsIndicator.append("span").attr("class", "entity-name");
68317 list.selectAll(".no-results-item .entity-name").html("").call(_t.append("geocoder.no_results_worldwide"));
68318 if (services.geocoder) {
68319 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"));
68321 list.selectAll(".no-results-item").style("display", value.length && !results.length ? "block" : "none");
68322 list.selectAll(".geocode-item").style("display", value && _geocodeResults === void 0 ? "block" : "none");
68323 list.selectAll(".feature-list-item").data([-1]).remove();
68324 var items = list.selectAll(".feature-list-item").data(results, function(d2) {
68327 var enter = items.enter().insert("button", ".geocode-item").attr("class", "feature-list-item").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
68328 var label = enter.append("div").attr("class", "label");
68329 label.each(function(d2) {
68330 select_default2(this).call(svgIcon("#iD-icon-" + d2.geometry, "pre-text"));
68332 label.append("span").attr("class", "entity-type").text(function(d2) {
68335 label.append("span").attr("class", "entity-name").text(function(d2) {
68338 enter.style("opacity", 0).transition().style("opacity", 1);
68340 items.exit().remove();
68342 function mouseover(d3_event, d2) {
68345 utilHighlightEntities([d2.id], true, context);
68347 function mouseout(d3_event, d2) {
68350 utilHighlightEntities([d2.id], false, context);
68352 function click(d3_event, d2) {
68353 d3_event.preventDefault();
68355 context.map().centerZoomEase([d2.location[1], d2.location[0]], 19);
68356 } else if (d2.entity) {
68357 utilHighlightEntities([d2.id], false, context);
68358 context.enter(modeSelect(context, [d2.entity.id]));
68359 context.map().zoomToEase(d2.entity);
68361 context.zoomToEntity(d2.id);
68364 function geocoderSearch() {
68365 services.geocoder.search(search.property("value"), function(err, resp) {
68366 _geocodeResults = resp || [];
68371 return featureList;
68374 // modules/ui/improveOSM_comments.js
68375 function uiImproveOsmComments() {
68377 function issueComments(selection2) {
68378 let comments = selection2.selectAll(".comments-container").data([0]);
68379 comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
68380 services.improveOSM.getComments(_qaItem).then((d2) => {
68383 const commentEnter = comments.selectAll(".comment").data(d2.comments).enter().append("div").attr("class", "comment");
68384 commentEnter.append("div").attr("class", "comment-avatar").call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
68385 const mainEnter = commentEnter.append("div").attr("class", "comment-main");
68386 const metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
68387 metadataEnter.append("div").attr("class", "comment-author").each(function(d4) {
68388 const osm = services.osm;
68389 let selection3 = select_default2(this);
68390 if (osm && d4.username) {
68391 selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d4.username)).attr("target", "_blank");
68393 selection3.text((d5) => d5.username);
68395 metadataEnter.append("div").attr("class", "comment-date").html((d4) => _t.html("note.status.commented", { when: localeDateString2(d4.timestamp) }));
68396 mainEnter.append("div").attr("class", "comment-text").append("p").text((d4) => d4.text);
68397 }).catch((err) => {
68401 function localeDateString2(s2) {
68404 const options2 = { day: "numeric", month: "short", year: "numeric" };
68405 const d2 = new Date(s2 * 1e3);
68406 if (isNaN(d2.getTime()))
68408 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
68410 issueComments.issue = function(val) {
68411 if (!arguments.length)
68414 return issueComments;
68416 return issueComments;
68419 // modules/ui/improveOSM_details.js
68420 function uiImproveOsmDetails(context) {
68422 function issueDetail(d2) {
68425 const issueKey = d2.issueKey;
68426 d2.replacements = d2.replacements || {};
68427 d2.replacements.default = { html: _t.html("inspector.unknown") };
68428 return _t.html(`QA.improveOSM.error_types.${issueKey}.description`, d2.replacements);
68430 function improveOsmDetails(selection2) {
68431 const details = selection2.selectAll(".error-details").data(
68432 _qaItem ? [_qaItem] : [],
68433 (d2) => `${d2.id}-${d2.status || 0}`
68435 details.exit().remove();
68436 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
68437 const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
68438 descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
68439 descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
68440 let relatedEntities = [];
68441 descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
68442 const link2 = select_default2(this);
68443 const isObjectLink = link2.classed("error_object_link");
68444 const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
68445 const entity = context.hasEntity(entityID);
68446 relatedEntities.push(entityID);
68447 link2.on("mouseenter", () => {
68448 utilHighlightEntities([entityID], true, context);
68449 }).on("mouseleave", () => {
68450 utilHighlightEntities([entityID], false, context);
68451 }).on("click", (d3_event) => {
68452 d3_event.preventDefault();
68453 utilHighlightEntities([entityID], false, context);
68454 const osmlayer = context.layers().layer("osm");
68455 if (!osmlayer.enabled()) {
68456 osmlayer.enabled(true);
68458 context.map().centerZoom(_qaItem.loc, 20);
68460 context.enter(modeSelect(context, [entityID]));
68462 context.loadEntity(entityID, (err, result) => {
68465 const entity2 = result.data.find((e3) => e3.id === entityID);
68467 context.enter(modeSelect(context, [entityID]));
68472 let name = utilDisplayName(entity);
68473 if (!name && !isObjectLink) {
68474 const preset = _mainPresetIndex.match(entity, context.graph());
68475 name = preset && !preset.isFallback() && preset.name();
68478 this.innerText = name;
68482 context.features().forceVisible(relatedEntities);
68483 context.map().pan([0, 0]);
68485 improveOsmDetails.issue = function(val) {
68486 if (!arguments.length)
68489 return improveOsmDetails;
68491 return improveOsmDetails;
68494 // modules/ui/improveOSM_header.js
68495 function uiImproveOsmHeader() {
68497 function issueTitle(d2) {
68498 const issueKey = d2.issueKey;
68499 d2.replacements = d2.replacements || {};
68500 d2.replacements.default = { html: _t.html("inspector.unknown") };
68501 return _t.html(`QA.improveOSM.error_types.${issueKey}.title`, d2.replacements);
68503 function improveOsmHeader(selection2) {
68504 const header = selection2.selectAll(".qa-header").data(
68505 _qaItem ? [_qaItem] : [],
68506 (d2) => `${d2.id}-${d2.status || 0}`
68508 header.exit().remove();
68509 const headerEnter = header.enter().append("div").attr("class", "qa-header");
68510 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}`);
68511 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");
68512 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 : "");
68513 headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
68515 improveOsmHeader.issue = function(val) {
68516 if (!arguments.length)
68519 return improveOsmHeader;
68521 return improveOsmHeader;
68524 // modules/ui/improveOSM_editor.js
68525 function uiImproveOsmEditor(context) {
68526 const dispatch14 = dispatch_default("change");
68527 const qaDetails = uiImproveOsmDetails(context);
68528 const qaComments = uiImproveOsmComments(context);
68529 const qaHeader = uiImproveOsmHeader(context);
68531 function improveOsmEditor(selection2) {
68532 const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
68533 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
68534 headerEnter.append("h2").call(_t.append("QA.improveOSM.title"));
68535 let body = selection2.selectAll(".body").data([0]);
68536 body = body.enter().append("div").attr("class", "body").merge(body);
68537 const editor = body.selectAll(".qa-editor").data([0]);
68538 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);
68540 function improveOsmSaveSection(selection2) {
68541 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
68542 const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
68543 let saveSection = selection2.selectAll(".qa-save").data(
68544 isShown ? [_qaItem] : [],
68545 (d2) => `${d2.id}-${d2.status || 0}`
68547 saveSection.exit().remove();
68548 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
68549 saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("note.newComment"));
68550 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);
68551 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
68552 function changeInput() {
68553 const input = select_default2(this);
68554 let val = input.property("value").trim();
68558 _qaItem = _qaItem.update({ newComment: val });
68559 const qaService = services.improveOSM;
68561 qaService.replaceItem(_qaItem);
68563 saveSection.call(qaSaveButtons);
68566 function qaSaveButtons(selection2) {
68567 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
68568 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
68569 buttonSection.exit().remove();
68570 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
68571 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
68572 buttonEnter.append("button").attr("class", "button close-button action");
68573 buttonEnter.append("button").attr("class", "button ignore-button action");
68574 buttonSection = buttonSection.merge(buttonEnter);
68575 buttonSection.select(".comment-button").attr("disabled", (d2) => d2.newComment ? null : true).on("click.comment", function(d3_event, d2) {
68577 const qaService = services.improveOSM;
68579 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68582 buttonSection.select(".close-button").html((d2) => {
68583 const andComment = d2.newComment ? "_comment" : "";
68584 return _t.html(`QA.keepRight.close${andComment}`);
68585 }).on("click.close", function(d3_event, d2) {
68587 const qaService = services.improveOSM;
68589 d2.newStatus = "SOLVED";
68590 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68593 buttonSection.select(".ignore-button").html((d2) => {
68594 const andComment = d2.newComment ? "_comment" : "";
68595 return _t.html(`QA.keepRight.ignore${andComment}`);
68596 }).on("click.ignore", function(d3_event, d2) {
68598 const qaService = services.improveOSM;
68600 d2.newStatus = "INVALID";
68601 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68605 improveOsmEditor.error = function(val) {
68606 if (!arguments.length)
68609 return improveOsmEditor;
68611 return utilRebind(improveOsmEditor, dispatch14, "on");
68614 // modules/ui/preset_list.js
68615 function uiPresetList(context) {
68616 var dispatch14 = dispatch_default("cancel", "choose");
68619 var _currentPresets;
68620 var _autofocus = false;
68621 function presetList(selection2) {
68624 var presets = _mainPresetIndex.matchAllGeometry(entityGeometries());
68625 selection2.html("");
68626 var messagewrap = selection2.append("div").attr("class", "header fillL");
68627 var message = messagewrap.append("h2").call(_t.append("inspector.choose"));
68628 var direction = _mainLocalizer.textDirection() === "rtl" ? "backward" : "forward";
68629 messagewrap.append("button").attr("class", "preset-choose").attr("title", _entityIDs.length === 1 ? _t("inspector.edit") : _t("inspector.edit_features")).on("click", function() {
68630 dispatch14.call("cancel", this);
68631 }).call(svgIcon(`#iD-icon-${direction}`));
68632 function initialKeydown(d3_event) {
68633 if (search.property("value").length === 0 && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
68634 d3_event.preventDefault();
68635 d3_event.stopPropagation();
68636 operationDelete(context, _entityIDs)();
68637 } else if (search.property("value").length === 0 && (d3_event.ctrlKey || d3_event.metaKey) && d3_event.keyCode === utilKeybinding.keyCodes.z) {
68638 d3_event.preventDefault();
68639 d3_event.stopPropagation();
68641 } else if (!d3_event.ctrlKey && !d3_event.metaKey) {
68642 select_default2(this).on("keydown", keydown);
68643 keydown.call(this, d3_event);
68646 function keydown(d3_event) {
68647 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"] && // if insertion point is at the end of the string
68648 search.node().selectionStart === search.property("value").length) {
68649 d3_event.preventDefault();
68650 d3_event.stopPropagation();
68651 var buttons = list.selectAll(".preset-list-button");
68652 if (!buttons.empty())
68653 buttons.nodes()[0].focus();
68656 function keypress(d3_event) {
68657 var value = search.property("value");
68658 if (d3_event.keyCode === 13 && // ↩ Return
68660 list.selectAll(".preset-list-item:first-child").each(function(d2) {
68661 d2.choose.call(this);
68665 function inputevent() {
68666 var value = search.property("value");
68667 list.classed("filtered", value.length);
68668 var results, messageText;
68669 if (value.length) {
68670 results = presets.search(value, entityGeometries()[0], _currLoc);
68671 messageText = _t.html("inspector.results", {
68672 n: results.collection.length,
68676 var entityPresets2 = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
68677 results = _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets2);
68678 messageText = _t.html("inspector.choose");
68680 list.call(drawList, results);
68681 message.html(messageText);
68683 var searchWrap = selection2.append("div").attr("class", "search-header");
68684 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
68685 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));
68687 search.node().focus();
68688 setTimeout(function() {
68689 search.node().focus();
68692 var listWrap = selection2.append("div").attr("class", "inspector-body");
68693 var entityPresets = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
68694 var list = listWrap.append("div").attr("class", "preset-list").call(drawList, _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets));
68695 context.features().on("change.preset-list", updateForFeatureHiddenState);
68697 function drawList(list, presets) {
68698 presets = presets.matchAllGeometry(entityGeometries());
68699 var collection = presets.collection.reduce(function(collection2, preset) {
68701 return collection2;
68702 if (preset.members) {
68703 if (preset.members.collection.filter(function(preset2) {
68704 return preset2.addable();
68706 collection2.push(CategoryItem(preset));
68708 } else if (preset.addable()) {
68709 collection2.push(PresetItem(preset));
68711 return collection2;
68713 var items = list.selectAll(".preset-list-item").data(collection, function(d2) {
68714 return d2.preset.id;
68717 items.exit().remove();
68718 items.enter().append("div").attr("class", function(item) {
68719 return "preset-list-item preset-" + item.preset.id.replace("/", "-");
68720 }).classed("current", function(item) {
68721 return _currentPresets.indexOf(item.preset) !== -1;
68722 }).each(function(item) {
68723 select_default2(this).call(item);
68724 }).style("opacity", 0).transition().style("opacity", 1);
68725 updateForFeatureHiddenState();
68727 function itemKeydown(d3_event) {
68728 var item = select_default2(this.closest(".preset-list-item"));
68729 var parentItem = select_default2(item.node().parentNode.closest(".preset-list-item"));
68730 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"]) {
68731 d3_event.preventDefault();
68732 d3_event.stopPropagation();
68733 var nextItem = select_default2(item.node().nextElementSibling);
68734 if (nextItem.empty()) {
68735 if (!parentItem.empty()) {
68736 nextItem = select_default2(parentItem.node().nextElementSibling);
68738 } else if (select_default2(this).classed("expanded")) {
68739 nextItem = item.select(".subgrid .preset-list-item:first-child");
68741 if (!nextItem.empty()) {
68742 nextItem.select(".preset-list-button").node().focus();
68744 } else if (d3_event.keyCode === utilKeybinding.keyCodes["\u2191"]) {
68745 d3_event.preventDefault();
68746 d3_event.stopPropagation();
68747 var previousItem = select_default2(item.node().previousElementSibling);
68748 if (previousItem.empty()) {
68749 if (!parentItem.empty()) {
68750 previousItem = parentItem;
68752 } else if (previousItem.select(".preset-list-button").classed("expanded")) {
68753 previousItem = previousItem.select(".subgrid .preset-list-item:last-child");
68755 if (!previousItem.empty()) {
68756 previousItem.select(".preset-list-button").node().focus();
68758 var search = select_default2(this.closest(".preset-list-pane")).select(".preset-search-input");
68759 search.node().focus();
68761 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
68762 d3_event.preventDefault();
68763 d3_event.stopPropagation();
68764 if (!parentItem.empty()) {
68765 parentItem.select(".preset-list-button").node().focus();
68767 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
68768 d3_event.preventDefault();
68769 d3_event.stopPropagation();
68770 item.datum().choose.call(select_default2(this).node());
68773 function CategoryItem(preset) {
68774 var box, sublist, shown = false;
68775 function item(selection2) {
68776 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap category");
68778 var isExpanded = select_default2(this).classed("expanded");
68779 var iconName = isExpanded ? _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward" : "#iD-icon-down";
68780 select_default2(this).classed("expanded", !isExpanded).attr("title", !isExpanded ? _t("icons.collapse") : _t("icons.expand"));
68781 select_default2(this).selectAll("div.label-inner svg.icon use").attr("href", iconName);
68784 var geometries = entityGeometries();
68785 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) {
68786 if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
68787 d3_event.preventDefault();
68788 d3_event.stopPropagation();
68789 if (!select_default2(this).classed("expanded")) {
68790 click.call(this, d3_event);
68792 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
68793 d3_event.preventDefault();
68794 d3_event.stopPropagation();
68795 if (select_default2(this).classed("expanded")) {
68796 click.call(this, d3_event);
68799 itemKeydown.call(this, d3_event);
68802 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
68803 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");
68804 box = selection2.append("div").attr("class", "subgrid").style("max-height", "0px").style("opacity", 0);
68805 box.append("div").attr("class", "arrow");
68806 sublist = box.append("div").attr("class", "preset-list fillL3");
68808 item.choose = function() {
68809 if (!box || !sublist)
68813 box.transition().duration(200).style("opacity", "0").style("max-height", "0px").style("padding-bottom", "0px");
68816 var members = preset.members.matchAllGeometry(entityGeometries());
68817 sublist.call(drawList, members);
68818 box.transition().duration(200).style("opacity", "1").style("max-height", 200 + members.collection.length * 190 + "px").style("padding-bottom", "10px");
68821 item.preset = preset;
68824 function PresetItem(preset) {
68825 function item(selection2) {
68826 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap");
68827 var geometries = entityGeometries();
68828 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);
68829 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
68831 preset.nameLabel(),
68832 preset.subtitleLabel()
68834 label.selectAll(".namepart").data(nameparts, (d2) => d2.stringId).enter().append("div").attr("class", "namepart").text("").each(function(d2) {
68835 d2(select_default2(this));
68837 wrap2.call(item.reference.button);
68838 selection2.call(item.reference.body);
68840 item.choose = function() {
68841 if (select_default2(this).classed("disabled"))
68843 if (!context.inIntro()) {
68844 _mainPresetIndex.setMostRecent(preset, entityGeometries()[0]);
68848 for (var i3 in _entityIDs) {
68849 var entityID = _entityIDs[i3];
68850 var oldPreset = _mainPresetIndex.match(graph.entity(entityID), graph);
68851 graph = actionChangePreset(entityID, oldPreset, preset)(graph);
68855 _t("operations.change_tags.annotation")
68857 context.validator().validate();
68858 dispatch14.call("choose", this, preset);
68860 item.help = function(d3_event) {
68861 d3_event.stopPropagation();
68862 item.reference.toggle();
68864 item.preset = preset;
68865 item.reference = uiTagReference(preset.reference(), context);
68868 function updateForFeatureHiddenState() {
68869 if (!_entityIDs.every(context.hasEntity))
68871 var geometries = entityGeometries();
68872 var button = context.container().selectAll(".preset-list .preset-list-button");
68873 button.call(uiTooltip().destroyAny);
68874 button.each(function(item, index) {
68875 var hiddenPresetFeaturesId;
68876 for (var i3 in geometries) {
68877 hiddenPresetFeaturesId = context.features().isHiddenPreset(item.preset, geometries[i3]);
68878 if (hiddenPresetFeaturesId)
68881 var isHiddenPreset = !context.inIntro() && !!hiddenPresetFeaturesId && (_currentPresets.length !== 1 || item.preset !== _currentPresets[0]);
68882 select_default2(this).classed("disabled", isHiddenPreset);
68883 if (isHiddenPreset) {
68884 var isAutoHidden = context.features().autoHidden(hiddenPresetFeaturesId);
68885 select_default2(this).call(
68886 uiTooltip().title(() => _t.append("inspector.hidden_preset." + (isAutoHidden ? "zoom" : "manual"), {
68887 features: _t("feature." + hiddenPresetFeaturesId + ".description")
68888 })).placement(index < 2 ? "bottom" : "top")
68893 presetList.autofocus = function(val) {
68894 if (!arguments.length)
68899 presetList.entityIDs = function(val) {
68900 if (!arguments.length)
68904 if (_entityIDs && _entityIDs.length) {
68905 const extent = _entityIDs.reduce(function(extent2, entityID) {
68906 var entity = context.graph().entity(entityID);
68907 return extent2.extend(entity.extent(context.graph()));
68909 _currLoc = extent.center();
68910 var presets = _entityIDs.map(function(entityID) {
68911 return _mainPresetIndex.match(context.entity(entityID), context.graph());
68913 presetList.presets(presets);
68917 presetList.presets = function(val) {
68918 if (!arguments.length)
68919 return _currentPresets;
68920 _currentPresets = val;
68923 function entityGeometries() {
68925 for (var i3 in _entityIDs) {
68926 var entityID = _entityIDs[i3];
68927 var entity = context.entity(entityID);
68928 var geometry = entity.geometry(context.graph());
68929 if (geometry === "vertex" && entity.isOnAddressLine(context.graph())) {
68930 geometry = "point";
68932 if (!counts[geometry])
68933 counts[geometry] = 0;
68934 counts[geometry] += 1;
68936 return Object.keys(counts).sort(function(geom1, geom2) {
68937 return counts[geom2] - counts[geom1];
68940 return utilRebind(presetList, dispatch14, "on");
68943 // modules/ui/view_on_osm.js
68944 function uiViewOnOSM(context) {
68946 function viewOnOSM(selection2) {
68948 if (_what instanceof osmEntity) {
68949 url = context.connection().entityURL(_what);
68950 } else if (_what instanceof osmNote) {
68951 url = context.connection().noteURL(_what);
68953 var data = !_what || _what.isNew() ? [] : [_what];
68954 var link2 = selection2.selectAll(".view-on-osm").data(data, function(d2) {
68957 link2.exit().remove();
68958 var linkEnter = link2.enter().append("a").attr("class", "view-on-osm").attr("target", "_blank").attr("href", url).call(svgIcon("#iD-icon-out-link", "inline"));
68959 linkEnter.append("span").call(_t.append("inspector.view_on_osm"));
68961 viewOnOSM.what = function(_2) {
68962 if (!arguments.length)
68970 // modules/ui/inspector.js
68971 function uiInspector(context) {
68972 var presetList = uiPresetList(context);
68973 var entityEditor = uiEntityEditor(context);
68974 var wrap2 = select_default2(null), presetPane = select_default2(null), editorPane = select_default2(null);
68975 var _state = "select";
68977 var _newFeature = false;
68978 function inspector(selection2) {
68979 presetList.entityIDs(_entityIDs).autofocus(_newFeature).on("choose", inspector.setPreset).on("cancel", function() {
68980 inspector.setPreset();
68982 entityEditor.state(_state).entityIDs(_entityIDs).on("choose", inspector.showList);
68983 wrap2 = selection2.selectAll(".panewrap").data([0]);
68984 var enter = wrap2.enter().append("div").attr("class", "panewrap");
68985 enter.append("div").attr("class", "preset-list-pane pane");
68986 enter.append("div").attr("class", "entity-editor-pane pane");
68987 wrap2 = wrap2.merge(enter);
68988 presetPane = wrap2.selectAll(".preset-list-pane");
68989 editorPane = wrap2.selectAll(".entity-editor-pane");
68990 function shouldDefaultToPresetList() {
68991 if (_state !== "select")
68993 if (_entityIDs.length !== 1)
68995 var entityID = _entityIDs[0];
68996 var entity = context.hasEntity(entityID);
68999 if (entity.hasNonGeometryTags())
69003 if (entity.geometry(context.graph()) !== "vertex")
69005 if (context.graph().parentRelations(entity).length)
69007 if (context.validator().getEntityIssues(entityID).length)
69009 if (entity.isHighwayIntersection(context.graph()))
69013 if (shouldDefaultToPresetList()) {
69014 wrap2.style("right", "-100%");
69015 editorPane.classed("hide", true);
69016 presetPane.classed("hide", false).call(presetList);
69018 wrap2.style("right", "0%");
69019 presetPane.classed("hide", true);
69020 editorPane.classed("hide", false).call(entityEditor);
69022 var footer = selection2.selectAll(".footer").data([0]);
69023 footer = footer.enter().append("div").attr("class", "footer").merge(footer);
69025 uiViewOnOSM(context).what(context.hasEntity(_entityIDs.length === 1 && _entityIDs[0]))
69028 inspector.showList = function(presets) {
69029 presetPane.classed("hide", false);
69030 wrap2.transition().styleTween("right", function() {
69031 return value_default("0%", "-100%");
69032 }).on("end", function() {
69033 editorPane.classed("hide", true);
69036 presetList.presets(presets);
69038 presetPane.call(presetList.autofocus(true));
69040 inspector.setPreset = function(preset) {
69041 if (preset && preset.id === "type/multipolygon") {
69042 presetPane.call(presetList.autofocus(true));
69044 editorPane.classed("hide", false);
69045 wrap2.transition().styleTween("right", function() {
69046 return value_default("-100%", "0%");
69047 }).on("end", function() {
69048 presetPane.classed("hide", true);
69051 entityEditor.presets([preset]);
69053 editorPane.call(entityEditor);
69056 inspector.state = function(val) {
69057 if (!arguments.length)
69060 entityEditor.state(_state);
69061 context.container().selectAll(".field-help-body").remove();
69064 inspector.entityIDs = function(val) {
69065 if (!arguments.length)
69070 inspector.newFeature = function(val) {
69071 if (!arguments.length)
69072 return _newFeature;
69079 // modules/ui/keepRight_details.js
69080 function uiKeepRightDetails(context) {
69082 function issueDetail(d2) {
69083 const { itemType, parentIssueType } = d2;
69084 const unknown = { html: _t.html("inspector.unknown") };
69085 let replacements = d2.replacements || {};
69086 replacements.default = unknown;
69087 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
69088 return _t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
69090 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
69093 function keepRightDetails(selection2) {
69094 const details = selection2.selectAll(".error-details").data(
69095 _qaItem ? [_qaItem] : [],
69096 (d2) => `${d2.id}-${d2.status || 0}`
69098 details.exit().remove();
69099 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
69100 const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
69101 descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
69102 descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
69103 let relatedEntities = [];
69104 descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
69105 const link2 = select_default2(this);
69106 const isObjectLink = link2.classed("error_object_link");
69107 const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
69108 const entity = context.hasEntity(entityID);
69109 relatedEntities.push(entityID);
69110 link2.on("mouseenter", () => {
69111 utilHighlightEntities([entityID], true, context);
69112 }).on("mouseleave", () => {
69113 utilHighlightEntities([entityID], false, context);
69114 }).on("click", (d3_event) => {
69115 d3_event.preventDefault();
69116 utilHighlightEntities([entityID], false, context);
69117 const osmlayer = context.layers().layer("osm");
69118 if (!osmlayer.enabled()) {
69119 osmlayer.enabled(true);
69121 context.map().centerZoomEase(_qaItem.loc, 20);
69123 context.enter(modeSelect(context, [entityID]));
69125 context.loadEntity(entityID, (err, result) => {
69128 const entity2 = result.data.find((e3) => e3.id === entityID);
69130 context.enter(modeSelect(context, [entityID]));
69135 let name = utilDisplayName(entity);
69136 if (!name && !isObjectLink) {
69137 const preset = _mainPresetIndex.match(entity, context.graph());
69138 name = preset && !preset.isFallback() && preset.name();
69141 this.innerText = name;
69145 context.features().forceVisible(relatedEntities);
69146 context.map().pan([0, 0]);
69148 keepRightDetails.issue = function(val) {
69149 if (!arguments.length)
69152 return keepRightDetails;
69154 return keepRightDetails;
69157 // modules/ui/keepRight_header.js
69158 function uiKeepRightHeader() {
69160 function issueTitle(d2) {
69161 const { itemType, parentIssueType } = d2;
69162 const unknown = _t.html("inspector.unknown");
69163 let replacements = d2.replacements || {};
69164 replacements.default = { html: unknown };
69165 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
69166 return _t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
69168 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
69171 function keepRightHeader(selection2) {
69172 const header = selection2.selectAll(".qa-header").data(
69173 _qaItem ? [_qaItem] : [],
69174 (d2) => `${d2.id}-${d2.status || 0}`
69176 header.exit().remove();
69177 const headerEnter = header.enter().append("div").attr("class", "qa-header");
69178 const iconEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0);
69179 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"));
69180 headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
69182 keepRightHeader.issue = function(val) {
69183 if (!arguments.length)
69186 return keepRightHeader;
69188 return keepRightHeader;
69191 // modules/ui/view_on_keepRight.js
69192 function uiViewOnKeepRight() {
69194 function viewOnKeepRight(selection2) {
69196 if (services.keepRight && _qaItem instanceof QAItem) {
69197 url = services.keepRight.issueURL(_qaItem);
69199 const link2 = selection2.selectAll(".view-on-keepRight").data(url ? [url] : []);
69200 link2.exit().remove();
69201 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"));
69202 linkEnter.append("span").call(_t.append("inspector.view_on_keepRight"));
69204 viewOnKeepRight.what = function(val) {
69205 if (!arguments.length)
69208 return viewOnKeepRight;
69210 return viewOnKeepRight;
69213 // modules/ui/keepRight_editor.js
69214 function uiKeepRightEditor(context) {
69215 const dispatch14 = dispatch_default("change");
69216 const qaDetails = uiKeepRightDetails(context);
69217 const qaHeader = uiKeepRightHeader(context);
69219 function keepRightEditor(selection2) {
69220 const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
69221 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
69222 headerEnter.append("h2").call(_t.append("QA.keepRight.title"));
69223 let body = selection2.selectAll(".body").data([0]);
69224 body = body.enter().append("div").attr("class", "body").merge(body);
69225 const editor = body.selectAll(".qa-editor").data([0]);
69226 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(keepRightSaveSection);
69227 const footer = selection2.selectAll(".footer").data([0]);
69228 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnKeepRight(context).what(_qaItem));
69230 function keepRightSaveSection(selection2) {
69231 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
69232 const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
69233 let saveSection = selection2.selectAll(".qa-save").data(
69234 isShown ? [_qaItem] : [],
69235 (d2) => `${d2.id}-${d2.status || 0}`
69237 saveSection.exit().remove();
69238 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
69239 saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("QA.keepRight.comment"));
69240 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);
69241 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
69242 function changeInput() {
69243 const input = select_default2(this);
69244 let val = input.property("value").trim();
69245 if (val === _qaItem.comment) {
69248 _qaItem = _qaItem.update({ newComment: val });
69249 const qaService = services.keepRight;
69251 qaService.replaceItem(_qaItem);
69253 saveSection.call(qaSaveButtons);
69256 function qaSaveButtons(selection2) {
69257 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
69258 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
69259 buttonSection.exit().remove();
69260 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
69261 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
69262 buttonEnter.append("button").attr("class", "button close-button action");
69263 buttonEnter.append("button").attr("class", "button ignore-button action");
69264 buttonSection = buttonSection.merge(buttonEnter);
69265 buttonSection.select(".comment-button").attr("disabled", (d2) => d2.newComment ? null : true).on("click.comment", function(d3_event, d2) {
69267 const qaService = services.keepRight;
69269 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69272 buttonSection.select(".close-button").html((d2) => {
69273 const andComment = d2.newComment ? "_comment" : "";
69274 return _t.html(`QA.keepRight.close${andComment}`);
69275 }).on("click.close", function(d3_event, d2) {
69277 const qaService = services.keepRight;
69279 d2.newStatus = "ignore_t";
69280 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69283 buttonSection.select(".ignore-button").html((d2) => {
69284 const andComment = d2.newComment ? "_comment" : "";
69285 return _t.html(`QA.keepRight.ignore${andComment}`);
69286 }).on("click.ignore", function(d3_event, d2) {
69288 const qaService = services.keepRight;
69290 d2.newStatus = "ignore";
69291 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69295 keepRightEditor.error = function(val) {
69296 if (!arguments.length)
69299 return keepRightEditor;
69301 return utilRebind(keepRightEditor, dispatch14, "on");
69304 // modules/ui/lasso.js
69305 function uiLasso(context) {
69306 var group, polygon2;
69307 lasso.coordinates = [];
69308 function lasso(selection2) {
69309 context.container().classed("lasso", true);
69310 group = selection2.append("g").attr("class", "lasso hide");
69311 polygon2 = group.append("path").attr("class", "lasso-path");
69312 group.call(uiToggle(true));
69316 polygon2.data([lasso.coordinates]).attr("d", function(d2) {
69317 return "M" + d2.join(" L") + " Z";
69321 lasso.extent = function() {
69322 return lasso.coordinates.reduce(function(extent, point2) {
69323 return extent.extend(geoExtent(point2));
69326 lasso.p = function(_2) {
69327 if (!arguments.length)
69329 lasso.coordinates.push(_2);
69333 lasso.close = function() {
69335 group.call(uiToggle(false, function() {
69336 select_default2(this).remove();
69339 context.container().classed("lasso", false);
69344 // modules/ui/note_comments.js
69345 function uiNoteComments() {
69347 function noteComments(selection2) {
69350 var comments = selection2.selectAll(".comments-container").data([0]);
69351 comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
69352 var commentEnter = comments.selectAll(".comment").data(_note.comments).enter().append("div").attr("class", "comment");
69353 commentEnter.append("div").attr("class", function(d2) {
69354 return "comment-avatar user-" + d2.uid;
69355 }).call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
69356 var mainEnter = commentEnter.append("div").attr("class", "comment-main");
69357 var metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
69358 metadataEnter.append("div").attr("class", "comment-author").each(function(d2) {
69359 var selection3 = select_default2(this);
69360 var osm = services.osm;
69361 if (osm && d2.user) {
69362 selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d2.user)).attr("target", "_blank");
69365 selection3.text(d2.user);
69367 selection3.call(_t.append("note.anonymous"));
69370 metadataEnter.append("div").attr("class", "comment-date").html(function(d2) {
69371 return _t.html("note.status." + d2.action, { when: localeDateString2(d2.date) });
69373 mainEnter.append("div").attr("class", "comment-text").html(function(d2) {
69375 }).selectAll("a").attr("rel", "noopener nofollow").attr("target", "_blank");
69376 comments.call(replaceAvatars);
69378 function replaceAvatars(selection2) {
69379 var showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
69380 var osm = services.osm;
69381 if (showThirdPartyIcons !== "true" || !osm)
69384 _note.comments.forEach(function(d2) {
69386 uids[d2.uid] = true;
69388 Object.keys(uids).forEach(function(uid) {
69389 osm.loadUser(uid, function(err, user) {
69390 if (!user || !user.image_url)
69392 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);
69396 function localeDateString2(s2) {
69399 var options2 = { day: "numeric", month: "short", year: "numeric" };
69400 s2 = s2.replace(/-/g, "/");
69401 var d2 = new Date(s2);
69402 if (isNaN(d2.getTime()))
69404 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
69406 noteComments.note = function(val) {
69407 if (!arguments.length)
69410 return noteComments;
69412 return noteComments;
69415 // modules/ui/note_header.js
69416 function uiNoteHeader() {
69418 function noteHeader(selection2) {
69419 var header = selection2.selectAll(".note-header").data(
69420 _note ? [_note] : [],
69422 return d2.status + d2.id;
69425 header.exit().remove();
69426 var headerEnter = header.enter().append("div").attr("class", "note-header");
69427 var iconEnter = headerEnter.append("div").attr("class", function(d2) {
69428 return "note-header-icon " + d2.status;
69429 }).classed("new", function(d2) {
69432 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-note", "note-fill"));
69433 iconEnter.each(function(d2) {
69436 statusIcon = "#iD-icon-plus";
69437 } else if (d2.status === "open") {
69438 statusIcon = "#iD-icon-close";
69440 statusIcon = "#iD-icon-apply";
69442 iconEnter.append("div").attr("class", "note-icon-annotation").attr("title", _t("icons.close")).call(svgIcon(statusIcon, "icon-annotation"));
69444 headerEnter.append("div").attr("class", "note-header-label").html(function(d2) {
69445 if (_note.isNew()) {
69446 return _t.html("note.new");
69448 return _t.html("note.note") + " " + d2.id + " " + (d2.status === "closed" ? _t.html("note.closed") : "");
69451 noteHeader.note = function(val) {
69452 if (!arguments.length)
69460 // modules/ui/note_report.js
69461 function uiNoteReport() {
69463 function noteReport(selection2) {
69465 if (services.osm && _note instanceof osmNote && !_note.isNew()) {
69466 url = services.osm.noteReportURL(_note);
69468 var link2 = selection2.selectAll(".note-report").data(url ? [url] : []);
69469 link2.exit().remove();
69470 var linkEnter = link2.enter().append("a").attr("class", "note-report").attr("target", "_blank").attr("href", function(d2) {
69472 }).call(svgIcon("#iD-icon-out-link", "inline"));
69473 linkEnter.append("span").call(_t.append("note.report"));
69475 noteReport.note = function(val) {
69476 if (!arguments.length)
69484 // modules/ui/note_editor.js
69485 function uiNoteEditor(context) {
69486 var dispatch14 = dispatch_default("change");
69487 var noteComments = uiNoteComments(context);
69488 var noteHeader = uiNoteHeader();
69491 function noteEditor(selection2) {
69492 var header = selection2.selectAll(".header").data([0]);
69493 var headerEnter = header.enter().append("div").attr("class", "header fillL");
69494 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
69495 context.enter(modeBrowse(context));
69496 }).call(svgIcon("#iD-icon-close"));
69497 headerEnter.append("h2").call(_t.append("note.title"));
69498 var body = selection2.selectAll(".body").data([0]);
69499 body = body.enter().append("div").attr("class", "body").merge(body);
69500 var editor = body.selectAll(".note-editor").data([0]);
69501 editor.enter().append("div").attr("class", "modal-section note-editor").merge(editor).call(noteHeader.note(_note)).call(noteComments.note(_note)).call(noteSaveSection);
69502 var footer = selection2.selectAll(".footer").data([0]);
69503 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOSM(context).what(_note)).call(uiNoteReport(context).note(_note));
69504 var osm = services.osm;
69506 osm.on("change.note-save", function() {
69507 selection2.call(noteEditor);
69511 function noteSaveSection(selection2) {
69512 var isSelected = _note && _note.id === context.selectedNoteID();
69513 var noteSave = selection2.selectAll(".note-save").data(isSelected ? [_note] : [], function(d2) {
69514 return d2.status + d2.id;
69516 noteSave.exit().remove();
69517 var noteSaveEnter = noteSave.enter().append("div").attr("class", "note-save save-section cf");
69518 noteSaveEnter.append("h4").attr("class", ".note-save-header").html(function() {
69519 return _note.isNew() ? _t.html("note.newDescription") : _t.html("note.newComment");
69521 var commentTextarea = noteSaveEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("note.inputPlaceholder")).attr("maxlength", 1e3).property("value", function(d2) {
69522 return d2.newComment;
69523 }).call(utilNoAuto).on("keydown.note-input", keydown).on("input.note-input", changeInput).on("blur.note-input", changeInput);
69524 if (!commentTextarea.empty() && _newNote) {
69525 commentTextarea.node().focus();
69527 noteSave = noteSaveEnter.merge(noteSave).call(userDetails).call(noteSaveButtons);
69528 function keydown(d3_event) {
69529 if (!(d3_event.keyCode === 13 && // ↩ Return
69532 var osm = services.osm;
69535 var hasAuth = osm.authenticated();
69538 if (!_note.newComment)
69540 d3_event.preventDefault();
69541 select_default2(this).on("keydown.note-input", null);
69542 window.setTimeout(function() {
69543 if (_note.isNew()) {
69544 noteSave.selectAll(".save-button").node().focus();
69547 noteSave.selectAll(".comment-button").node().focus();
69548 clickComment(_note);
69552 function changeInput() {
69553 var input = select_default2(this);
69554 var val = input.property("value").trim() || void 0;
69555 _note = _note.update({ newComment: val });
69556 var osm = services.osm;
69558 osm.replaceNote(_note);
69560 noteSave.call(noteSaveButtons);
69563 function userDetails(selection2) {
69564 var detailSection = selection2.selectAll(".detail-section").data([0]);
69565 detailSection = detailSection.enter().append("div").attr("class", "detail-section").merge(detailSection);
69566 var osm = services.osm;
69569 var hasAuth = osm.authenticated();
69570 var authWarning = detailSection.selectAll(".auth-warning").data(hasAuth ? [] : [0]);
69571 authWarning.exit().transition().duration(200).style("opacity", 0).remove();
69572 var authEnter = authWarning.enter().insert("div", ".tag-reference-body").attr("class", "field-warning auth-warning").style("opacity", 0);
69573 authEnter.call(svgIcon("#iD-icon-alert", "inline"));
69574 authEnter.append("span").call(_t.append("note.login"));
69575 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) {
69576 d3_event.preventDefault();
69577 osm.authenticate();
69579 authEnter.transition().duration(200).style("opacity", 1);
69580 var prose = detailSection.selectAll(".note-save-prose").data(hasAuth ? [0] : []);
69581 prose.exit().remove();
69582 prose = prose.enter().append("p").attr("class", "note-save-prose").call(_t.append("note.upload_explanation")).merge(prose);
69583 osm.userDetails(function(err, user) {
69586 var userLink = select_default2(document.createElement("div"));
69587 if (user.image_url) {
69588 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
69590 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
69591 prose.html(_t.html("note.upload_explanation_with_user", { user: { html: userLink.html() } }));
69594 function noteSaveButtons(selection2) {
69595 var osm = services.osm;
69596 var hasAuth = osm && osm.authenticated();
69597 var isSelected = _note && _note.id === context.selectedNoteID();
69598 var buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_note] : [], function(d2) {
69599 return d2.status + d2.id;
69601 buttonSection.exit().remove();
69602 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
69603 if (_note.isNew()) {
69604 buttonEnter.append("button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
69605 buttonEnter.append("button").attr("class", "button save-button action").call(_t.append("note.save"));
69607 buttonEnter.append("button").attr("class", "button status-button action");
69608 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("note.comment"));
69610 buttonSection = buttonSection.merge(buttonEnter);
69611 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
69612 buttonSection.select(".save-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
69613 buttonSection.select(".status-button").attr("disabled", hasAuth ? null : true).html(function(d2) {
69614 var action = d2.status === "open" ? "close" : "open";
69615 var andComment = d2.newComment ? "_comment" : "";
69616 return _t.html("note." + action + andComment);
69617 }).on("click.status", clickStatus);
69618 buttonSection.select(".comment-button").attr("disabled", isSaveDisabled).on("click.comment", clickComment);
69619 function isSaveDisabled(d2) {
69620 return hasAuth && d2.status === "open" && d2.newComment ? null : true;
69623 function clickCancel(d3_event, d2) {
69625 var osm = services.osm;
69627 osm.removeNote(d2);
69629 context.enter(modeBrowse(context));
69630 dispatch14.call("change");
69632 function clickSave(d3_event, d2) {
69634 var osm = services.osm;
69636 osm.postNoteCreate(d2, function(err, note) {
69637 dispatch14.call("change", note);
69641 function clickStatus(d3_event, d2) {
69643 var osm = services.osm;
69645 var setStatus = d2.status === "open" ? "closed" : "open";
69646 osm.postNoteUpdate(d2, setStatus, function(err, note) {
69647 dispatch14.call("change", note);
69651 function clickComment(d3_event, d2) {
69653 var osm = services.osm;
69655 osm.postNoteUpdate(d2, d2.status, function(err, note) {
69656 dispatch14.call("change", note);
69660 noteEditor.note = function(val) {
69661 if (!arguments.length)
69666 noteEditor.newNote = function(val) {
69667 if (!arguments.length)
69672 return utilRebind(noteEditor, dispatch14, "on");
69675 // modules/ui/source_switch.js
69676 function uiSourceSwitch(context) {
69678 function click(d3_event) {
69679 d3_event.preventDefault();
69680 var osm = context.connection();
69683 if (context.inIntro())
69685 if (context.history().hasChanges() && !window.confirm(_t("source_switch.lose_changes")))
69687 var isLive = select_default2(this).classed("live");
69689 context.enter(modeBrowse(context));
69690 context.history().clearSaved();
69692 select_default2(this).html(isLive ? _t.html("source_switch.live") : _t.html("source_switch.dev")).classed("live", isLive).classed("chip", isLive);
69693 osm.switch(isLive ? keys2[0] : keys2[1]);
69695 var sourceSwitch = function(selection2) {
69696 selection2.append("a").attr("href", "#").call(_t.append("source_switch.live")).attr("class", "live chip").on("click", click);
69698 sourceSwitch.keys = function(_2) {
69699 if (!arguments.length)
69702 return sourceSwitch;
69704 return sourceSwitch;
69707 // modules/ui/spinner.js
69708 function uiSpinner(context) {
69709 var osm = context.connection();
69710 return function(selection2) {
69711 var img = selection2.append("img").attr("src", context.imagePath("loader-black.gif")).style("opacity", 0);
69713 osm.on("loading.spinner", function() {
69714 img.transition().style("opacity", 1);
69715 }).on("loaded.spinner", function() {
69716 img.transition().style("opacity", 0);
69722 // modules/ui/sections/privacy.js
69723 function uiSectionPrivacy(context) {
69724 let section = uiSection("preferences-third-party", context).label(() => _t.append("preferences.privacy.title")).disclosureContent(renderDisclosureContent);
69725 function renderDisclosureContent(selection2) {
69726 selection2.selectAll(".privacy-options-list").data([0]).enter().append("ul").attr("class", "layer-list privacy-options-list");
69727 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(
69728 uiTooltip().title(() => _t.append("preferences.privacy.third_party_icons.tooltip")).placement("bottom")
69730 thirdPartyIconsEnter.append("input").attr("type", "checkbox").on("change", (d3_event, d2) => {
69731 d3_event.preventDefault();
69732 corePreferences("preferences.privacy.thirdpartyicons", d2 === "true" ? "false" : "true");
69734 thirdPartyIconsEnter.append("span").call(_t.append("preferences.privacy.third_party_icons.description"));
69735 selection2.selectAll(".privacy-third-party-icons-item").classed("active", (d2) => d2 === "true").select("input").property("checked", (d2) => d2 === "true");
69736 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"));
69738 corePreferences.onChange("preferences.privacy.thirdpartyicons", section.reRender);
69742 // modules/ui/splash.js
69743 function uiSplash(context) {
69744 return (selection2) => {
69745 if (context.history().hasRestorableChanges())
69747 let updateMessage = "";
69748 const sawPrivacyVersion = corePreferences("sawPrivacyVersion");
69749 let showSplash = !corePreferences("sawSplash");
69750 if (sawPrivacyVersion !== context.privacyVersion) {
69751 updateMessage = _t("splash.privacy_update");
69756 corePreferences("sawSplash", true);
69757 corePreferences("sawPrivacyVersion", context.privacyVersion);
69758 _mainFileFetcher.get("intro_graph");
69759 let modalSelection = uiModal(selection2);
69760 modalSelection.select(".modal").attr("class", "modal-splash modal");
69761 let introModal = modalSelection.select(".content").append("div").attr("class", "fillL");
69762 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("splash.welcome"));
69763 let modalSection = introModal.append("div").attr("class", "modal-section");
69764 modalSection.append("p").html(_t.html("splash.text", {
69765 version: context.version,
69766 website: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/develop/CHANGELOG.md#whats-new">' + _t.html("splash.changelog") + "</a>" },
69767 github: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/issues">github.com</a>' }
69769 modalSection.append("p").html(_t.html("splash.privacy", {
69771 privacyLink: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/release/PRIVACY.md">' + _t("splash.privacy_policy") + "</a>" }
69773 uiSectionPrivacy(context).label(() => _t.append("splash.privacy_settings")).render(modalSection);
69774 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
69775 let walkthrough = buttonWrap.append("button").attr("class", "walkthrough").on("click", () => {
69776 context.container().call(uiIntro(context));
69777 modalSelection.close();
69779 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
69780 walkthrough.append("div").call(_t.append("splash.walkthrough"));
69781 let startEditing = buttonWrap.append("button").attr("class", "start-editing").on("click", modalSelection.close);
69782 startEditing.append("svg").attr("class", "logo logo-features").append("use").attr("xlink:href", "#iD-logo-features");
69783 startEditing.append("div").call(_t.append("splash.start"));
69784 modalSelection.select("button.close").attr("class", "hide");
69788 // modules/ui/status.js
69789 function uiStatus(context) {
69790 var osm = context.connection();
69791 return function(selection2) {
69794 function update(err, apiStatus) {
69795 selection2.html("");
69797 if (apiStatus === "connectionSwitched") {
69799 } else if (apiStatus === "rateLimited") {
69800 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) {
69801 d3_event.preventDefault();
69802 osm.authenticate();
69805 var throttledRetry = throttle_default(function() {
69806 context.loadTiles(context.projection);
69807 osm.reloadApiStatus();
69809 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) {
69810 d3_event.preventDefault();
69814 } else if (apiStatus === "readonly") {
69815 selection2.call(_t.append("osm_api_status.message.readonly"));
69816 } else if (apiStatus === "offline") {
69817 selection2.call(_t.append("osm_api_status.message.offline"));
69819 selection2.attr("class", "api-status " + (err ? "error" : apiStatus));
69821 osm.on("apiStatusChange.uiStatus", update);
69822 context.history().on("storage_error", () => {
69823 selection2.selectAll("span.local-storage-full").remove();
69824 selection2.append("span").attr("class", "local-storage-full").call(_t.append("osm_api_status.message.local_storage_full"));
69825 selection2.classed("error", true);
69827 window.setInterval(function() {
69828 osm.reloadApiStatus();
69830 osm.reloadApiStatus();
69834 // node_modules/osm-community-index/lib/simplify.js
69835 var import_diacritics2 = __toESM(require_diacritics(), 1);
69836 function simplify(str2) {
69837 if (typeof str2 !== "string")
69839 return import_diacritics2.default.remove(
69840 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()
69844 // node_modules/osm-community-index/lib/resolve_strings.js
69845 function resolveStrings(item, defaults, localizerFn) {
69846 let itemStrings = Object.assign({}, item.strings);
69847 let defaultStrings = Object.assign({}, defaults[item.type]);
69848 const anyToken = new RegExp(/(\{\w+\})/, "gi");
69850 if (itemStrings.community) {
69851 const communityID = simplify(itemStrings.community);
69852 itemStrings.community = localizerFn(`_communities.${communityID}`);
69854 ["name", "description", "extendedDescription"].forEach((prop) => {
69855 if (defaultStrings[prop])
69856 defaultStrings[prop] = localizerFn(`_defaults.${item.type}.${prop}`);
69857 if (itemStrings[prop])
69858 itemStrings[prop] = localizerFn(`${item.id}.${prop}`);
69861 let replacements = {
69862 account: item.account,
69863 community: itemStrings.community,
69864 signupUrl: itemStrings.signupUrl,
69865 url: itemStrings.url
69867 if (!replacements.signupUrl) {
69868 replacements.signupUrl = resolve(itemStrings.signupUrl || defaultStrings.signupUrl);
69870 if (!replacements.url) {
69871 replacements.url = resolve(itemStrings.url || defaultStrings.url);
69874 name: resolve(itemStrings.name || defaultStrings.name),
69875 url: resolve(itemStrings.url || defaultStrings.url),
69876 signupUrl: resolve(itemStrings.signupUrl || defaultStrings.signupUrl),
69877 description: resolve(itemStrings.description || defaultStrings.description),
69878 extendedDescription: resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription)
69880 resolved.nameHTML = linkify(resolved.url, resolved.name);
69881 resolved.urlHTML = linkify(resolved.url);
69882 resolved.signupUrlHTML = linkify(resolved.signupUrl);
69883 resolved.descriptionHTML = resolve(itemStrings.description || defaultStrings.description, true);
69884 resolved.extendedDescriptionHTML = resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription, true);
69886 function resolve(s2, addLinks) {
69890 for (let key in replacements) {
69891 const token = `{${key}}`;
69892 const regex = new RegExp(token, "g");
69893 if (regex.test(result)) {
69894 let replacement = replacements[key];
69895 if (!replacement) {
69896 throw new Error(`Cannot resolve token: ${token}`);
69898 if (addLinks && (key === "signupUrl" || key === "url")) {
69899 replacement = linkify(replacement);
69901 result = result.replace(regex, replacement);
69905 const leftovers = result.match(anyToken);
69907 throw new Error(`Cannot resolve tokens: ${leftovers}`);
69909 if (addLinks && item.type === "reddit") {
69910 result = result.replace(/(\/r\/\w+\/*)/i, (match) => linkify(resolved.url, match));
69914 function linkify(url, text2) {
69917 text2 = text2 || url;
69918 return `<a target="_blank" href="${url}">${text2}</a>`;
69922 // modules/ui/success.js
69924 function uiSuccess(context) {
69925 const MAXEVENTS = 2;
69926 const dispatch14 = dispatch_default("cancel");
69929 ensureOSMCommunityIndex();
69930 function ensureOSMCommunityIndex() {
69931 const data = _mainFileFetcher;
69932 return Promise.all([
69933 data.get("oci_features"),
69934 data.get("oci_resources"),
69935 data.get("oci_defaults")
69936 ]).then((vals) => {
69939 if (vals[0] && Array.isArray(vals[0].features)) {
69940 _sharedLocationManager.mergeCustomGeoJSON(vals[0]);
69942 let ociResources = Object.values(vals[1].resources);
69943 if (ociResources.length) {
69944 return _sharedLocationManager.mergeLocationSets(ociResources).then(() => {
69946 resources: ociResources,
69947 defaults: vals[2].defaults
69955 defaults: vals[2].defaults
69961 function parseEventDate(when) {
69964 let raw = when.trim();
69967 if (!/Z$/.test(raw)) {
69970 const parsed = new Date(raw);
69971 return new Date(parsed.toUTCString().slice(0, 25));
69973 function success(selection2) {
69974 let header = selection2.append("div").attr("class", "header fillL");
69975 header.append("h2").call(_t.append("success.just_edited"));
69976 header.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => dispatch14.call("cancel")).call(svgIcon("#iD-icon-close"));
69977 let body = selection2.append("div").attr("class", "body save-success fillL");
69978 let summary = body.append("div").attr("class", "save-summary");
69979 summary.append("h3").call(_t.append("success.thank_you" + (_location ? "_location" : ""), { where: _location }));
69980 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"));
69981 let osm = context.connection();
69984 let changesetURL = osm.changesetURL(_changeset2.id);
69985 let table = summary.append("table").attr("class", "summary-table");
69986 let row = table.append("tr").attr("class", "summary-row");
69987 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");
69988 let summaryDetail = row.append("td").attr("class", "cell-detail summary-detail");
69989 summaryDetail.append("a").attr("class", "cell-detail summary-view-on-osm").attr("target", "_blank").attr("href", changesetURL).call(_t.append("success.view_on_osm"));
69990 summaryDetail.append("div").html(_t.html("success.changeset_id", {
69991 changeset_id: { html: `<a href="${changesetURL}" target="_blank">${_changeset2.id}</a>` }
69993 ensureOSMCommunityIndex().then((oci) => {
69994 const loc = context.map().center();
69995 const validHere = _sharedLocationManager.locationSetsAt(loc);
69996 let communities = [];
69997 oci.resources.forEach((resource) => {
69998 let area = validHere[resource.locationSetID];
70001 const localizer = (stringID) => _t.html(`community.${stringID}`);
70002 resource.resolved = resolveStrings(resource, oci.defaults, localizer);
70005 order: resource.order || 0,
70009 communities.sort((a2, b2) => a2.area - b2.area || b2.order - a2.order);
70010 body.call(showCommunityLinks, communities.map((c2) => c2.resource));
70013 function showCommunityLinks(selection2, resources) {
70014 let communityLinks = selection2.append("div").attr("class", "save-communityLinks");
70015 communityLinks.append("h3").call(_t.append("success.like_osm"));
70016 let table = communityLinks.append("table").attr("class", "community-table");
70017 let row = table.selectAll(".community-row").data(resources);
70018 let rowEnter = row.enter().append("tr").attr("class", "community-row");
70019 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}`);
70020 let communityDetail = rowEnter.append("td").attr("class", "cell-detail community-detail");
70021 communityDetail.each(showCommunityDetails);
70022 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"));
70024 function showCommunityDetails(d2) {
70025 let selection2 = select_default2(this);
70026 let communityID = d2.id;
70027 selection2.append("div").attr("class", "community-name").html(d2.resolved.nameHTML);
70028 selection2.append("div").attr("class", "community-description").html(d2.resolved.descriptionHTML);
70029 if (d2.resolved.extendedDescriptionHTML || d2.languageCodes && d2.languageCodes.length) {
70030 selection2.append("div").call(
70031 uiDisclosure(context, `community-more-${d2.id}`, false).expanded(false).updatePreference(false).label(() => _t.append("success.more")).content(showMore)
70034 let nextEvents = (d2.events || []).map((event) => {
70035 event.date = parseEventDate(event.when);
70037 }).filter((event) => {
70038 const t2 = event.date.getTime();
70039 const now3 = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
70040 return !isNaN(t2) && t2 >= now3;
70041 }).sort((a2, b2) => {
70042 return a2.date < b2.date ? -1 : a2.date > b2.date ? 1 : 0;
70043 }).slice(0, MAXEVENTS);
70044 if (nextEvents.length) {
70045 selection2.append("div").call(
70046 uiDisclosure(context, `community-events-${d2.id}`, false).expanded(false).updatePreference(false).label(_t.html("success.events")).content(showNextEvents)
70047 ).select(".hide-toggle").append("span").attr("class", "badge-text").text(nextEvents.length);
70049 function showMore(selection3) {
70050 let more = selection3.selectAll(".community-more").data([0]);
70051 let moreEnter = more.enter().append("div").attr("class", "community-more");
70052 if (d2.resolved.extendedDescriptionHTML) {
70053 moreEnter.append("div").attr("class", "community-extended-description").html(d2.resolved.extendedDescriptionHTML);
70055 if (d2.languageCodes && d2.languageCodes.length) {
70056 const languageList = d2.languageCodes.map((code) => _mainLocalizer.languageName(code)).join(", ");
70057 moreEnter.append("div").attr("class", "community-languages").call(_t.append("success.languages", { languages: languageList }));
70060 function showNextEvents(selection3) {
70061 let events = selection3.append("div").attr("class", "community-events");
70062 let item = events.selectAll(".community-event").data(nextEvents);
70063 let itemEnter = item.enter().append("div").attr("class", "community-event");
70064 itemEnter.append("div").attr("class", "community-event-name").append("a").attr("target", "_blank").attr("href", (d4) => d4.url).text((d4) => {
70065 let name = d4.name;
70066 if (d4.i18n && d4.id) {
70067 name = _t(`community.${communityID}.events.${d4.id}.name`, { default: name });
70071 itemEnter.append("div").attr("class", "community-event-when").text((d4) => {
70072 let options2 = { weekday: "short", day: "numeric", month: "short", year: "numeric" };
70073 if (d4.date.getHours() || d4.date.getMinutes()) {
70074 options2.hour = "numeric";
70075 options2.minute = "numeric";
70077 return d4.date.toLocaleString(_mainLocalizer.localeCode(), options2);
70079 itemEnter.append("div").attr("class", "community-event-where").text((d4) => {
70080 let where = d4.where;
70081 if (d4.i18n && d4.id) {
70082 where = _t(`community.${communityID}.events.${d4.id}.where`, { default: where });
70086 itemEnter.append("div").attr("class", "community-event-description").text((d4) => {
70087 let description = d4.description;
70088 if (d4.i18n && d4.id) {
70089 description = _t(`community.${communityID}.events.${d4.id}.description`, { default: description });
70091 return description;
70095 success.changeset = function(val) {
70096 if (!arguments.length)
70097 return _changeset2;
70101 success.location = function(val) {
70102 if (!arguments.length)
70107 return utilRebind(success, dispatch14, "on");
70110 // modules/ui/version.js
70111 var sawVersion = null;
70112 var isNewVersion = false;
70113 var isNewUser = false;
70114 function uiVersion(context) {
70115 var currVersion = context.version;
70116 var matchedVersion = currVersion.match(/\d+\.\d+\.\d+.*/);
70117 if (sawVersion === null && matchedVersion !== null) {
70118 if (corePreferences("sawVersion")) {
70120 isNewVersion = corePreferences("sawVersion") !== currVersion && currVersion.indexOf("-") === -1;
70123 isNewVersion = true;
70125 corePreferences("sawVersion", currVersion);
70126 sawVersion = currVersion;
70128 return function(selection2) {
70129 selection2.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD").text(currVersion);
70130 if (isNewVersion && !isNewUser) {
70131 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(
70132 uiTooltip().title(() => _t.append("version.whats_new", { version: currVersion })).placement("top").scrollContainer(context.container().select(".main-footer-wrap"))
70138 // modules/ui/zoom.js
70139 function uiZoom(context) {
70142 icon: "iD-icon-plus",
70143 title: _t.append("zoom.in"),
70145 disabled: function() {
70146 return !context.map().canZoomIn();
70148 disabledTitle: _t.append("zoom.disabled.in"),
70152 icon: "iD-icon-minus",
70153 title: _t.append("zoom.out"),
70155 disabled: function() {
70156 return !context.map().canZoomOut();
70158 disabledTitle: _t.append("zoom.disabled.out"),
70161 function zoomIn(d3_event) {
70162 if (d3_event.shiftKey)
70164 d3_event.preventDefault();
70165 context.map().zoomIn();
70167 function zoomOut(d3_event) {
70168 if (d3_event.shiftKey)
70170 d3_event.preventDefault();
70171 context.map().zoomOut();
70173 function zoomInFurther(d3_event) {
70174 if (d3_event.shiftKey)
70176 d3_event.preventDefault();
70177 context.map().zoomInFurther();
70179 function zoomOutFurther(d3_event) {
70180 if (d3_event.shiftKey)
70182 d3_event.preventDefault();
70183 context.map().zoomOutFurther();
70185 return function(selection2) {
70186 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function(d2) {
70187 if (d2.disabled()) {
70188 return d2.disabledTitle;
70191 }).keys(function(d2) {
70194 var lastPointerUpType;
70195 var buttons = selection2.selectAll("button").data(zooms).enter().append("button").attr("class", function(d2) {
70197 }).on("pointerup.editor", function(d3_event) {
70198 lastPointerUpType = d3_event.pointerType;
70199 }).on("click.editor", function(d3_event, d2) {
70200 if (!d2.disabled()) {
70201 d2.action(d3_event);
70202 } else if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
70203 context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass("disabled").label(d2.disabledTitle)();
70205 lastPointerUpType = null;
70206 }).call(tooltipBehavior);
70207 buttons.each(function(d2) {
70208 select_default2(this).call(svgIcon("#" + d2.icon, "light"));
70210 utilKeybinding.plusKeys.forEach(function(key) {
70211 context.keybinding().on([key], zoomIn);
70212 context.keybinding().on([uiCmd("\u2325" + key)], zoomInFurther);
70214 utilKeybinding.minusKeys.forEach(function(key) {
70215 context.keybinding().on([key], zoomOut);
70216 context.keybinding().on([uiCmd("\u2325" + key)], zoomOutFurther);
70218 function updateButtonStates() {
70219 buttons.classed("disabled", function(d2) {
70220 return d2.disabled();
70221 }).each(function() {
70222 var selection3 = select_default2(this);
70223 if (!selection3.select(".tooltip.in").empty()) {
70224 selection3.call(tooltipBehavior.updateContent);
70228 updateButtonStates();
70229 context.map().on("move.uiZoom", updateButtonStates);
70233 // modules/ui/sections/raw_tag_editor.js
70234 function uiSectionRawTagEditor(id2, context) {
70235 var section = uiSection(id2, context).classes("raw-tag-editor").label(function() {
70236 var count = Object.keys(_tags).filter(function(d2) {
70239 return _t.append("inspector.title_count", { title: _t("inspector.tags"), count });
70240 }).expandedByDefault(false).disclosureContent(renderDisclosureContent);
70241 var taginfo = services.taginfo;
70242 var dispatch14 = dispatch_default("change");
70243 var availableViews = [
70244 { id: "list", icon: "#fas-th-list" },
70245 { id: "text", icon: "#fas-i-cursor" }
70247 let _discardTags = {};
70248 _mainFileFetcher.get("discarded").then((d2) => {
70252 var _tagView = corePreferences("raw-tag-editor-view") || "list";
70253 var _readOnlyTags = [];
70254 var _orderedKeys = [];
70255 var _showBlank = false;
70256 var _pendingChange = null;
70261 var _didInteract = false;
70262 function interacted() {
70263 _didInteract = true;
70265 function renderDisclosureContent(wrap2) {
70266 _orderedKeys = _orderedKeys.filter(function(key) {
70267 return _tags[key] !== void 0;
70269 var all = Object.keys(_tags).sort();
70270 var missingKeys = utilArrayDifference(all, _orderedKeys);
70271 for (var i3 in missingKeys) {
70272 _orderedKeys.push(missingKeys[i3]);
70274 var rowData = _orderedKeys.map(function(key, i4) {
70275 return { index: i4, key, value: _tags[key] };
70277 if (!rowData.length || _showBlank) {
70278 _showBlank = false;
70279 rowData.push({ index: rowData.length, key: "", value: "" });
70281 var options2 = wrap2.selectAll(".raw-tag-options").data([0]);
70282 options2.exit().remove();
70283 var optionsEnter = options2.enter().insert("div", ":first-child").attr("class", "raw-tag-options").attr("role", "tablist");
70284 var optionEnter = optionsEnter.selectAll(".raw-tag-option").data(availableViews, function(d2) {
70287 optionEnter.append("button").attr("class", function(d2) {
70288 return "raw-tag-option raw-tag-option-" + d2.id + (_tagView === d2.id ? " selected" : "");
70289 }).attr("aria-selected", function(d2) {
70290 return _tagView === d2.id;
70291 }).attr("role", "tab").attr("title", function(d2) {
70292 return _t("icons." + d2.id);
70293 }).on("click", function(d3_event, d2) {
70295 corePreferences("raw-tag-editor-view", d2.id);
70296 wrap2.selectAll(".raw-tag-option").classed("selected", function(datum2) {
70297 return datum2 === d2;
70298 }).attr("aria-selected", function(datum2) {
70299 return datum2 === d2;
70301 wrap2.selectAll(".tag-text").classed("hide", d2.id !== "text").each(setTextareaHeight);
70302 wrap2.selectAll(".tag-list, .add-row").classed("hide", d2.id !== "list");
70303 }).each(function(d2) {
70304 select_default2(this).call(svgIcon(d2.icon));
70306 var textData = rowsToText(rowData);
70307 var textarea = wrap2.selectAll(".tag-text").data([0]);
70308 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);
70309 textarea.call(utilGetSetValue, textData).each(setTextareaHeight).on("input", setTextareaHeight).on("focus", interacted).on("blur", textChanged).on("change", textChanged);
70310 var list = wrap2.selectAll(".tag-list").data([0]);
70311 list = list.enter().append("ul").attr("class", "tag-list" + (_tagView !== "list" ? " hide" : "")).merge(list);
70312 var addRowEnter = wrap2.selectAll(".add-row").data([0]).enter().append("div").attr("class", "add-row" + (_tagView !== "list" ? " hide" : ""));
70313 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);
70314 addRowEnter.append("div").attr("class", "space-value");
70315 addRowEnter.append("div").attr("class", "space-buttons");
70316 var items = list.selectAll(".tag-row").data(rowData, function(d2) {
70319 items.exit().each(unbind).remove();
70320 var itemsEnter = items.enter().append("li").attr("class", "tag-row").classed("readonly", isReadOnly);
70321 var innerWrap = itemsEnter.append("div").attr("class", "inner-wrap");
70322 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);
70323 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);
70324 innerWrap.append("button").attr("class", "form-field-button remove").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
70325 items = items.merge(itemsEnter).sort(function(a2, b2) {
70326 return a2.index - b2.index;
70328 items.each(function(d2) {
70329 var row = select_default2(this);
70330 var key = row.select("input.key");
70331 var value = row.select("input.value");
70332 if (_entityIDs && taginfo && _state !== "hover") {
70333 bindTypeahead(key, value);
70335 var referenceOptions = { key: d2.key };
70336 if (typeof d2.value === "string") {
70337 referenceOptions.value = d2.value;
70339 var reference = uiTagReference(referenceOptions, context);
70340 if (_state === "hover") {
70341 reference.showing(false);
70343 row.select(".inner-wrap").call(reference.button);
70344 row.call(reference.body);
70345 row.select("button.remove");
70347 items.selectAll("input.key").attr("title", function(d2) {
70349 }).call(utilGetSetValue, function(d2) {
70351 }).attr("readonly", function(d2) {
70352 return isReadOnly(d2) || null;
70354 items.selectAll("input.value").attr("title", function(d2) {
70355 return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : d2.value;
70356 }).classed("mixed", function(d2) {
70357 return Array.isArray(d2.value);
70358 }).attr("placeholder", function(d2) {
70359 return typeof d2.value === "string" ? null : _t("inspector.multiple_values");
70360 }).call(utilGetSetValue, function(d2) {
70361 return typeof d2.value === "string" ? d2.value : "";
70362 }).attr("readonly", function(d2) {
70363 return isReadOnly(d2) || null;
70365 items.selectAll("button.remove").on(
70366 ("PointerEvent" in window ? "pointer" : "mouse") + "down",
70367 // 'click' fires too late - #5878
70368 (d3_event, d2) => {
70369 if (d3_event.button !== 0)
70371 removeTag(d3_event, d2);
70375 function isReadOnly(d2) {
70376 for (var i3 = 0; i3 < _readOnlyTags.length; i3++) {
70377 if (d2.key.match(_readOnlyTags[i3]) !== null) {
70383 function setTextareaHeight() {
70384 if (_tagView !== "text")
70386 var selection2 = select_default2(this);
70387 var matches = selection2.node().value.match(/\n/g);
70388 var lineCount = 2 + Number(matches && matches.length);
70389 var lineHeight = 20;
70390 selection2.style("height", lineCount * lineHeight + "px");
70392 function stringify3(s2) {
70393 return JSON.stringify(s2).slice(1, -1);
70395 function unstringify(s2) {
70398 if (s2.length < 1 || s2.charAt(0) !== '"') {
70401 if (s2.length < 2 || s2.charAt(s2.length - 1) !== '"' || s2.charAt(s2.length - 1) === '"' && s2.charAt(s2.length - 2) === "\\") {
70404 return JSON.parse(leading + s2 + trailing);
70406 function rowsToText(rows) {
70407 var str2 = rows.filter(function(row) {
70408 return row.key && row.key.trim() !== "";
70409 }).map(function(row) {
70410 var rawVal = row.value;
70411 if (typeof rawVal !== "string")
70413 var val = rawVal ? stringify3(rawVal) : "";
70414 return stringify3(row.key) + "=" + val;
70416 if (_state !== "hover" && str2.length) {
70417 return str2 + "\n";
70421 function textChanged() {
70422 var newText = this.value.trim();
70424 newText.split("\n").forEach(function(row) {
70425 var m2 = row.match(/^\s*([^=]+)=(.*)$/);
70427 var k2 = context.cleanTagKey(unstringify(m2[1].trim()));
70428 var v2 = context.cleanTagValue(unstringify(m2[2].trim()));
70432 var tagDiff = utilTagDiff(_tags, newTags);
70433 if (!tagDiff.length)
70435 _pendingChange = _pendingChange || {};
70436 tagDiff.forEach(function(change) {
70437 if (isReadOnly({ key: change.key }))
70439 if (change.newVal === "*" && typeof change.oldVal !== "string")
70441 if (change.type === "-") {
70442 _pendingChange[change.key] = void 0;
70443 } else if (change.type === "+") {
70444 _pendingChange[change.key] = change.newVal || "";
70447 if (Object.keys(_pendingChange).length === 0) {
70448 _pendingChange = null;
70453 function pushMore(d3_event) {
70454 if (d3_event.keyCode === 9 && !d3_event.shiftKey && section.selection().selectAll(".tag-list li:last-child input.value").node() === this && utilGetSetValue(select_default2(this))) {
70458 function bindTypeahead(key, value) {
70459 if (isReadOnly(key.datum()))
70461 if (Array.isArray(value.datum().value)) {
70462 value.call(uiCombobox(context, "tag-value").minItems(1).fetcher(function(value2, callback) {
70463 var keyString = utilGetSetValue(key);
70464 if (!_tags[keyString])
70466 var data = _tags[keyString].filter(Boolean).map(function(tagValue) {
70476 var geometry = context.graph().geometry(_entityIDs[0]);
70477 key.call(uiCombobox(context, "tag-key").fetcher(function(value2, callback) {
70482 }, function(err, data) {
70484 const filtered = data.filter((d2) => _tags[d2.value] === void 0).filter((d2) => !(d2.value in _discardTags)).filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
70485 callback(sort(value2, filtered));
70489 value.call(uiCombobox(context, "tag-value").fetcher(function(value2, callback) {
70492 key: utilGetSetValue(key),
70495 }, function(err, data) {
70497 const filtered = data.filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
70498 callback(sort(value2, filtered));
70501 }).caseSensitive(allowUpperCaseTagValues.test(utilGetSetValue(key))));
70502 function sort(value2, data) {
70503 var sameletter = [];
70505 for (var i3 = 0; i3 < data.length; i3++) {
70506 if (data[i3].value.substring(0, value2.length) === value2) {
70507 sameletter.push(data[i3]);
70509 other.push(data[i3]);
70512 return sameletter.concat(other);
70515 function unbind() {
70516 var row = select_default2(this);
70517 row.selectAll("input.key").call(uiCombobox.off, context);
70518 row.selectAll("input.value").call(uiCombobox.off, context);
70520 function keyChange(d3_event, d2) {
70521 if (select_default2(this).attr("readonly"))
70524 if (_pendingChange && _pendingChange.hasOwnProperty(kOld) && _pendingChange[kOld] === void 0)
70526 var kNew = context.cleanTagKey(this.value.trim());
70527 if (isReadOnly({ key: kNew })) {
70531 if (kNew && kNew !== kOld && _tags[kNew] !== void 0) {
70533 section.selection().selectAll(".tag-list input.value").each(function(d4) {
70534 if (d4.key === kNew) {
70535 var input = select_default2(this).node();
70542 _pendingChange = _pendingChange || {};
70546 _pendingChange[kNew] = _pendingChange[kOld] || { oldKey: kOld };
70547 _pendingChange[kOld] = void 0;
70549 let row = this.parentNode.parentNode;
70550 let inputVal = select_default2(row).selectAll("input.value");
70551 let vNew = context.cleanTagValue(utilGetSetValue(inputVal));
70552 _pendingChange[kNew] = vNew;
70553 utilGetSetValue(inputVal, vNew);
70555 var existingKeyIndex = _orderedKeys.indexOf(kOld);
70556 if (existingKeyIndex !== -1)
70557 _orderedKeys[existingKeyIndex] = kNew;
70562 function valueChange(d3_event, d2) {
70563 if (isReadOnly(d2))
70565 if (typeof d2.value !== "string" && !this.value)
70567 if (_pendingChange && _pendingChange.hasOwnProperty(d2.key) && _pendingChange[d2.key] === void 0)
70569 _pendingChange = _pendingChange || {};
70570 _pendingChange[d2.key] = context.cleanTagValue(this.value);
70573 function removeTag(d3_event, d2) {
70574 if (isReadOnly(d2))
70576 if (d2.key === "") {
70577 _showBlank = false;
70578 section.reRender();
70580 _orderedKeys = _orderedKeys.filter(function(key) {
70581 return key !== d2.key;
70583 _pendingChange = _pendingChange || {};
70584 _pendingChange[d2.key] = void 0;
70588 function addTag() {
70589 window.setTimeout(function() {
70591 section.reRender();
70592 section.selection().selectAll(".tag-list li:last-child input.key").node().focus();
70595 function scheduleChange() {
70596 var entityIDs = _entityIDs;
70597 window.setTimeout(function() {
70598 if (!_pendingChange)
70600 dispatch14.call("change", this, entityIDs, _pendingChange);
70601 _pendingChange = null;
70604 section.state = function(val) {
70605 if (!arguments.length)
70607 if (_state !== val) {
70613 section.presets = function(val) {
70614 if (!arguments.length)
70617 if (_presets && _presets.length && _presets[0].isFallback()) {
70618 section.disclosureExpanded(true);
70619 } else if (!_didInteract) {
70620 section.disclosureExpanded(null);
70624 section.tags = function(val) {
70625 if (!arguments.length)
70630 section.entityIDs = function(val) {
70631 if (!arguments.length)
70633 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
70639 section.readOnlyTags = function(val) {
70640 if (!arguments.length)
70641 return _readOnlyTags;
70642 _readOnlyTags = val;
70645 return utilRebind(section, dispatch14, "on");
70648 // modules/ui/data_editor.js
70649 function uiDataEditor(context) {
70650 var dataHeader = uiDataHeader();
70651 var rawTagEditor = uiSectionRawTagEditor("custom-data-tag-editor", context).expandedByDefault(true).readOnlyTags([/./]);
70653 function dataEditor(selection2) {
70654 var header = selection2.selectAll(".header").data([0]);
70655 var headerEnter = header.enter().append("div").attr("class", "header fillL");
70656 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
70657 context.enter(modeBrowse(context));
70658 }).call(svgIcon("#iD-icon-close"));
70659 headerEnter.append("h2").call(_t.append("map_data.title"));
70660 var body = selection2.selectAll(".body").data([0]);
70661 body = body.enter().append("div").attr("class", "body").merge(body);
70662 var editor = body.selectAll(".data-editor").data([0]);
70663 editor.enter().append("div").attr("class", "modal-section data-editor").merge(editor).call(dataHeader.datum(_datum));
70664 var rte = body.selectAll(".raw-tag-editor").data([0]);
70665 rte.enter().append("div").attr("class", "raw-tag-editor data-editor").merge(rte).call(
70666 rawTagEditor.tags(_datum && _datum.properties || {}).state("hover").render
70667 ).selectAll("textarea.tag-text").attr("readonly", true).classed("readonly", true);
70669 dataEditor.datum = function(val) {
70670 if (!arguments.length)
70678 // modules/ui/osmose_details.js
70679 function uiOsmoseDetails(context) {
70681 function issueString(d2, type2) {
70684 const s2 = services.osmose.getStrings(d2.itemType);
70685 return type2 in s2 ? s2[type2] : "";
70687 function osmoseDetails(selection2) {
70688 const details = selection2.selectAll(".error-details").data(
70689 _qaItem ? [_qaItem] : [],
70690 (d2) => `${d2.id}-${d2.status || 0}`
70692 details.exit().remove();
70693 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
70694 if (issueString(_qaItem, "detail")) {
70695 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70696 div.append("h4").call(_t.append("QA.keepRight.detail_description"));
70697 div.append("p").attr("class", "qa-details-description-text").html((d2) => issueString(d2, "detail")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70699 const detailsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
70700 const elemsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
70701 if (issueString(_qaItem, "fix")) {
70702 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70703 div.append("h4").call(_t.append("QA.osmose.fix_title"));
70704 div.append("p").html((d2) => issueString(d2, "fix")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70706 if (issueString(_qaItem, "trap")) {
70707 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70708 div.append("h4").call(_t.append("QA.osmose.trap_title"));
70709 div.append("p").html((d2) => issueString(d2, "trap")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70711 const thisItem = _qaItem;
70712 services.osmose.loadIssueDetail(_qaItem).then((d2) => {
70713 if (!d2.elems || d2.elems.length === 0)
70715 if (context.selectedErrorID() !== thisItem.id && context.container().selectAll(`.qaItem.osmose.hover.itemId-${thisItem.id}`).empty())
70718 detailsDiv.append("h4").call(_t.append("QA.osmose.detail_title"));
70719 detailsDiv.append("p").html((d4) => d4.detail).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70721 elemsDiv.append("h4").call(_t.append("QA.osmose.elems_title"));
70722 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() {
70723 const link2 = select_default2(this);
70724 const entityID = this.textContent;
70725 const entity = context.hasEntity(entityID);
70726 link2.on("mouseenter", () => {
70727 utilHighlightEntities([entityID], true, context);
70728 }).on("mouseleave", () => {
70729 utilHighlightEntities([entityID], false, context);
70730 }).on("click", (d3_event) => {
70731 d3_event.preventDefault();
70732 utilHighlightEntities([entityID], false, context);
70733 const osmlayer = context.layers().layer("osm");
70734 if (!osmlayer.enabled()) {
70735 osmlayer.enabled(true);
70737 context.map().centerZoom(d2.loc, 20);
70739 context.enter(modeSelect(context, [entityID]));
70741 context.loadEntity(entityID, (err, result) => {
70744 const entity2 = result.data.find((e3) => e3.id === entityID);
70746 context.enter(modeSelect(context, [entityID]));
70751 let name = utilDisplayName(entity);
70753 const preset = _mainPresetIndex.match(entity, context.graph());
70754 name = preset && !preset.isFallback() && preset.name();
70757 this.innerText = name;
70761 context.features().forceVisible(d2.elems);
70762 context.map().pan([0, 0]);
70763 }).catch((err) => {
70767 osmoseDetails.issue = function(val) {
70768 if (!arguments.length)
70771 return osmoseDetails;
70773 return osmoseDetails;
70776 // modules/ui/osmose_header.js
70777 function uiOsmoseHeader() {
70779 function issueTitle(d2) {
70780 const unknown = _t("inspector.unknown");
70783 const s2 = services.osmose.getStrings(d2.itemType);
70784 return "title" in s2 ? s2.title : unknown;
70786 function osmoseHeader(selection2) {
70787 const header = selection2.selectAll(".qa-header").data(
70788 _qaItem ? [_qaItem] : [],
70789 (d2) => `${d2.id}-${d2.status || 0}`
70791 header.exit().remove();
70792 const headerEnter = header.enter().append("div").attr("class", "qa-header");
70793 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}`);
70794 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");
70795 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 : "");
70796 headerEnter.append("div").attr("class", "qa-header-label").text(issueTitle);
70798 osmoseHeader.issue = function(val) {
70799 if (!arguments.length)
70802 return osmoseHeader;
70804 return osmoseHeader;
70807 // modules/ui/view_on_osmose.js
70808 function uiViewOnOsmose() {
70810 function viewOnOsmose(selection2) {
70812 if (services.osmose && _qaItem instanceof QAItem) {
70813 url = services.osmose.itemURL(_qaItem);
70815 const link2 = selection2.selectAll(".view-on-osmose").data(url ? [url] : []);
70816 link2.exit().remove();
70817 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"));
70818 linkEnter.append("span").call(_t.append("inspector.view_on_osmose"));
70820 viewOnOsmose.what = function(val) {
70821 if (!arguments.length)
70824 return viewOnOsmose;
70826 return viewOnOsmose;
70829 // modules/ui/osmose_editor.js
70830 function uiOsmoseEditor(context) {
70831 const dispatch14 = dispatch_default("change");
70832 const qaDetails = uiOsmoseDetails(context);
70833 const qaHeader = uiOsmoseHeader(context);
70835 function osmoseEditor(selection2) {
70836 const header = selection2.selectAll(".header").data([0]);
70837 const headerEnter = header.enter().append("div").attr("class", "header fillL");
70838 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
70839 headerEnter.append("h2").call(_t.append("QA.osmose.title"));
70840 let body = selection2.selectAll(".body").data([0]);
70841 body = body.enter().append("div").attr("class", "body").merge(body);
70842 let editor = body.selectAll(".qa-editor").data([0]);
70843 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(osmoseSaveSection);
70844 const footer = selection2.selectAll(".footer").data([0]);
70845 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOsmose(context).what(_qaItem));
70847 function osmoseSaveSection(selection2) {
70848 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
70849 const isShown = _qaItem && isSelected;
70850 let saveSection = selection2.selectAll(".qa-save").data(
70851 isShown ? [_qaItem] : [],
70852 (d2) => `${d2.id}-${d2.status || 0}`
70854 saveSection.exit().remove();
70855 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
70856 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
70858 function qaSaveButtons(selection2) {
70859 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
70860 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
70861 buttonSection.exit().remove();
70862 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
70863 buttonEnter.append("button").attr("class", "button close-button action");
70864 buttonEnter.append("button").attr("class", "button ignore-button action");
70865 buttonSection = buttonSection.merge(buttonEnter);
70866 buttonSection.select(".close-button").call(_t.append("QA.keepRight.close")).on("click.close", function(d3_event, d2) {
70868 const qaService = services.osmose;
70870 d2.newStatus = "done";
70871 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
70874 buttonSection.select(".ignore-button").call(_t.append("QA.keepRight.ignore")).on("click.ignore", function(d3_event, d2) {
70876 const qaService = services.osmose;
70878 d2.newStatus = "false";
70879 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
70883 osmoseEditor.error = function(val) {
70884 if (!arguments.length)
70887 return osmoseEditor;
70889 return utilRebind(osmoseEditor, dispatch14, "on");
70892 // modules/ui/sidebar.js
70893 function uiSidebar(context) {
70894 var inspector = uiInspector(context);
70895 var dataEditor = uiDataEditor(context);
70896 var noteEditor = uiNoteEditor(context);
70897 var improveOsmEditor = uiImproveOsmEditor(context);
70898 var keepRightEditor = uiKeepRightEditor(context);
70899 var osmoseEditor = uiOsmoseEditor(context);
70901 var _wasData = false;
70902 var _wasNote = false;
70903 var _wasQaItem = false;
70904 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
70905 function sidebar(selection2) {
70906 var container = context.container();
70907 var minWidth = 240;
70909 var containerWidth;
70911 selection2.style("min-width", minWidth + "px").style("max-width", "400px").style("width", "33.3333%");
70912 var resizer = selection2.append("div").attr("class", "sidebar-resizer").on(_pointerPrefix + "down.sidebar-resizer", pointerdown);
70913 var downPointerId, lastClientX, containerLocGetter;
70914 function pointerdown(d3_event) {
70917 if ("button" in d3_event && d3_event.button !== 0)
70919 downPointerId = d3_event.pointerId || "mouse";
70920 lastClientX = d3_event.clientX;
70921 containerLocGetter = utilFastMouse(container.node());
70922 dragOffset = utilFastMouse(resizer.node())(d3_event)[0] - 1;
70923 sidebarWidth = selection2.node().getBoundingClientRect().width;
70924 containerWidth = container.node().getBoundingClientRect().width;
70925 var widthPct = sidebarWidth / containerWidth * 100;
70926 selection2.style("width", widthPct + "%").style("max-width", "85%");
70927 resizer.classed("dragging", true);
70928 select_default2(window).on("touchmove.sidebar-resizer", function(d3_event2) {
70929 d3_event2.preventDefault();
70930 }, { passive: false }).on(_pointerPrefix + "move.sidebar-resizer", pointermove).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", pointerup);
70932 function pointermove(d3_event) {
70933 if (downPointerId !== (d3_event.pointerId || "mouse"))
70935 d3_event.preventDefault();
70936 var dx = d3_event.clientX - lastClientX;
70937 lastClientX = d3_event.clientX;
70938 var isRTL = _mainLocalizer.textDirection() === "rtl";
70939 var scaleX = isRTL ? 0 : 1;
70940 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
70941 var x2 = containerLocGetter(d3_event)[0] - dragOffset;
70942 sidebarWidth = isRTL ? containerWidth - x2 : x2;
70943 var isCollapsed = selection2.classed("collapsed");
70944 var shouldCollapse = sidebarWidth < minWidth;
70945 selection2.classed("collapsed", shouldCollapse);
70946 if (shouldCollapse) {
70947 if (!isCollapsed) {
70948 selection2.style(xMarginProperty, "-400px").style("width", "400px");
70949 context.ui().onResize([(sidebarWidth - dx) * scaleX, 0]);
70952 var widthPct = sidebarWidth / containerWidth * 100;
70953 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
70955 context.ui().onResize([-sidebarWidth * scaleX, 0]);
70957 context.ui().onResize([-dx * scaleX, 0]);
70961 function pointerup(d3_event) {
70962 if (downPointerId !== (d3_event.pointerId || "mouse"))
70964 downPointerId = null;
70965 resizer.classed("dragging", false);
70966 select_default2(window).on("touchmove.sidebar-resizer", null).on(_pointerPrefix + "move.sidebar-resizer", null).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", null);
70968 var featureListWrap = selection2.append("div").attr("class", "feature-list-pane").call(uiFeatureList(context));
70969 var inspectorWrap = selection2.append("div").attr("class", "inspector-hidden inspector-wrap");
70970 var hoverModeSelect = function(targets) {
70971 context.container().selectAll(".feature-list-item button").classed("hover", false);
70972 if (context.selectedIDs().length > 1 && targets && targets.length) {
70973 var elements = context.container().selectAll(".feature-list-item button").filter(function(node) {
70974 return targets.indexOf(node) !== -1;
70976 if (!elements.empty()) {
70977 elements.classed("hover", true);
70981 sidebar.hoverModeSelect = throttle_default(hoverModeSelect, 200);
70982 function hover(targets) {
70983 var datum2 = targets && targets.length && targets[0];
70984 if (datum2 && datum2.__featurehash__) {
70986 sidebar.show(dataEditor.datum(datum2));
70987 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70988 } else if (datum2 instanceof osmNote) {
70989 if (context.mode().id === "drag-note")
70992 var osm = services.osm;
70994 datum2 = osm.getNote(datum2.id);
70996 sidebar.show(noteEditor.note(datum2));
70997 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70998 } else if (datum2 instanceof QAItem) {
71000 var errService = services[datum2.service];
71002 datum2 = errService.getError(datum2.id);
71005 if (datum2.service === "keepRight") {
71006 errEditor = keepRightEditor;
71007 } else if (datum2.service === "osmose") {
71008 errEditor = osmoseEditor;
71010 errEditor = improveOsmEditor;
71012 context.container().selectAll(".qaItem." + datum2.service).classed("hover", function(d2) {
71013 return d2.id === datum2.id;
71015 sidebar.show(errEditor.error(datum2));
71016 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
71017 } else if (!_current && datum2 instanceof osmEntity) {
71018 featureListWrap.classed("inspector-hidden", true);
71019 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", true);
71020 if (!inspector.entityIDs() || !utilArrayIdentical(inspector.entityIDs(), [datum2.id]) || inspector.state() !== "hover") {
71021 inspector.state("hover").entityIDs([datum2.id]).newFeature(false);
71022 inspectorWrap.call(inspector);
71024 } else if (!_current) {
71025 featureListWrap.classed("inspector-hidden", false);
71026 inspectorWrap.classed("inspector-hidden", true);
71027 inspector.state("hide");
71028 } else if (_wasData || _wasNote || _wasQaItem) {
71031 _wasQaItem = false;
71032 context.container().selectAll(".note").classed("hover", false);
71033 context.container().selectAll(".qaItem").classed("hover", false);
71037 sidebar.hover = throttle_default(hover, 200);
71038 sidebar.intersects = function(extent) {
71039 var rect = selection2.node().getBoundingClientRect();
71040 return extent.intersects([
71041 context.projection.invert([0, rect.height]),
71042 context.projection.invert([rect.width, 0])
71045 sidebar.select = function(ids, newFeature) {
71047 if (ids && ids.length) {
71048 var entity = ids.length === 1 && context.entity(ids[0]);
71049 if (entity && newFeature && selection2.classed("collapsed")) {
71050 var extent = entity.extent(context.graph());
71051 sidebar.expand(sidebar.intersects(extent));
71053 featureListWrap.classed("inspector-hidden", true);
71054 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", false);
71055 inspector.state("select").entityIDs(ids).newFeature(newFeature);
71056 inspectorWrap.call(inspector);
71058 inspector.state("hide");
71061 sidebar.showPresetList = function() {
71062 inspector.showList();
71064 sidebar.show = function(component, element) {
71065 featureListWrap.classed("inspector-hidden", true);
71066 inspectorWrap.classed("inspector-hidden", true);
71069 _current = selection2.append("div").attr("class", "sidebar-component").call(component, element);
71071 sidebar.hide = function() {
71072 featureListWrap.classed("inspector-hidden", false);
71073 inspectorWrap.classed("inspector-hidden", true);
71078 sidebar.expand = function(moveMap) {
71079 if (selection2.classed("collapsed")) {
71080 sidebar.toggle(moveMap);
71083 sidebar.collapse = function(moveMap) {
71084 if (!selection2.classed("collapsed")) {
71085 sidebar.toggle(moveMap);
71088 sidebar.toggle = function(moveMap) {
71089 if (context.inIntro())
71091 var isCollapsed = selection2.classed("collapsed");
71092 var isCollapsing = !isCollapsed;
71093 var isRTL = _mainLocalizer.textDirection() === "rtl";
71094 var scaleX = isRTL ? 0 : 1;
71095 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
71096 sidebarWidth = selection2.node().getBoundingClientRect().width;
71097 selection2.style("width", sidebarWidth + "px");
71098 var startMargin, endMargin, lastMargin;
71099 if (isCollapsing) {
71100 startMargin = lastMargin = 0;
71101 endMargin = -sidebarWidth;
71103 startMargin = lastMargin = -sidebarWidth;
71106 if (!isCollapsing) {
71107 selection2.classed("collapsed", isCollapsing);
71109 selection2.transition().style(xMarginProperty, endMargin + "px").tween("panner", function() {
71110 var i3 = number_default(startMargin, endMargin);
71111 return function(t2) {
71112 var dx = lastMargin - Math.round(i3(t2));
71113 lastMargin = lastMargin - dx;
71114 context.ui().onResize(moveMap ? void 0 : [dx * scaleX, 0]);
71116 }).on("end", function() {
71117 if (isCollapsing) {
71118 selection2.classed("collapsed", isCollapsing);
71120 if (!isCollapsing) {
71121 var containerWidth2 = container.node().getBoundingClientRect().width;
71122 var widthPct = sidebarWidth / containerWidth2 * 100;
71123 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
71127 resizer.on("dblclick", function(d3_event) {
71128 d3_event.preventDefault();
71129 if (d3_event.sourceEvent) {
71130 d3_event.sourceEvent.preventDefault();
71134 context.map().on("crossEditableZoom.sidebar", function(within) {
71135 if (!within && !selection2.select(".inspector-hover").empty()) {
71140 sidebar.showPresetList = function() {
71142 sidebar.hover = function() {
71144 sidebar.hover.cancel = function() {
71146 sidebar.intersects = function() {
71148 sidebar.select = function() {
71150 sidebar.show = function() {
71152 sidebar.hide = function() {
71154 sidebar.expand = function() {
71156 sidebar.collapse = function() {
71158 sidebar.toggle = function() {
71163 // modules/modes/draw_area.js
71164 function modeDrawArea(context, wayID, startGraph, button) {
71169 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawArea", function() {
71170 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.areas"))();
71172 mode.wayID = wayID;
71173 mode.enter = function() {
71174 context.install(behavior);
71176 mode.exit = function() {
71177 context.uninstall(behavior);
71179 mode.selectedIDs = function() {
71182 mode.activeID = function() {
71183 return behavior && behavior.activeID() || [];
71188 // modules/modes/add_area.js
71189 function modeAddArea(context, mode) {
71190 mode.id = "add-area";
71191 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
71192 function defaultTags(loc) {
71193 var defaultTags2 = { area: "yes" };
71195 defaultTags2 = mode.preset.setTags(defaultTags2, "area", false, loc);
71196 return defaultTags2;
71198 function actionClose(wayId) {
71199 return function(graph) {
71200 return graph.replace(graph.entity(wayId).close());
71203 function start2(loc) {
71204 var startGraph = context.graph();
71205 var node = osmNode({ loc });
71206 var way = osmWay({ tags: defaultTags(loc) });
71208 actionAddEntity(node),
71209 actionAddEntity(way),
71210 actionAddVertex(way.id, node.id),
71211 actionClose(way.id)
71213 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71215 function startFromWay(loc, edge) {
71216 var startGraph = context.graph();
71217 var node = osmNode({ loc });
71218 var way = osmWay({ tags: defaultTags(loc) });
71220 actionAddEntity(node),
71221 actionAddEntity(way),
71222 actionAddVertex(way.id, node.id),
71223 actionClose(way.id),
71224 actionAddMidpoint({ loc, edge }, node)
71226 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71228 function startFromNode(node) {
71229 var startGraph = context.graph();
71230 var way = osmWay({ tags: defaultTags(node.loc) });
71232 actionAddEntity(way),
71233 actionAddVertex(way.id, node.id),
71234 actionClose(way.id)
71236 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71238 mode.enter = function() {
71239 context.install(behavior);
71241 mode.exit = function() {
71242 context.uninstall(behavior);
71247 // modules/modes/add_line.js
71248 function modeAddLine(context, mode) {
71249 mode.id = "add-line";
71250 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
71251 function defaultTags(loc) {
71252 var defaultTags2 = {};
71254 defaultTags2 = mode.preset.setTags(defaultTags2, "line", false, loc);
71255 return defaultTags2;
71257 function start2(loc) {
71258 var startGraph = context.graph();
71259 var node = osmNode({ loc });
71260 var way = osmWay({ tags: defaultTags(loc) });
71262 actionAddEntity(node),
71263 actionAddEntity(way),
71264 actionAddVertex(way.id, node.id)
71266 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71268 function startFromWay(loc, edge) {
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),
71276 actionAddMidpoint({ loc, edge }, node)
71278 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71280 function startFromNode(node) {
71281 var startGraph = context.graph();
71282 var way = osmWay({ tags: defaultTags(node.loc) });
71284 actionAddEntity(way),
71285 actionAddVertex(way.id, node.id)
71287 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71289 mode.enter = function() {
71290 context.install(behavior);
71292 mode.exit = function() {
71293 context.uninstall(behavior);
71298 // modules/modes/add_point.js
71299 function modeAddPoint(context, mode) {
71300 mode.id = "add-point";
71301 var behavior = behaviorDraw(context).on("click", add).on("clickWay", addWay).on("clickNode", addNode).on("cancel", cancel).on("finish", cancel);
71302 function defaultTags(loc) {
71303 var defaultTags2 = {};
71305 defaultTags2 = mode.preset.setTags(defaultTags2, "point", false, loc);
71306 return defaultTags2;
71308 function add(loc) {
71309 var node = osmNode({ loc, tags: defaultTags(loc) });
71311 actionAddEntity(node),
71312 _t("operations.add.annotation.point")
71314 enterSelectMode(node);
71316 function addWay(loc, edge) {
71317 var node = osmNode({ tags: defaultTags(loc) });
71319 actionAddMidpoint({ loc, edge }, node),
71320 _t("operations.add.annotation.vertex")
71322 enterSelectMode(node);
71324 function enterSelectMode(node) {
71326 modeSelect(context, [node.id]).newFeature(true)
71329 function addNode(node) {
71330 const _defaultTags = defaultTags(node.loc);
71331 if (Object.keys(_defaultTags).length === 0) {
71332 enterSelectMode(node);
71335 var tags = Object.assign({}, node.tags);
71336 for (var key in _defaultTags) {
71337 tags[key] = _defaultTags[key];
71340 actionChangeTags(node.id, tags),
71341 _t("operations.add.annotation.point")
71343 enterSelectMode(node);
71345 function cancel() {
71346 context.enter(modeBrowse(context));
71348 mode.enter = function() {
71349 context.install(behavior);
71351 mode.exit = function() {
71352 context.uninstall(behavior);
71357 // modules/modes/select_note.js
71358 function modeSelectNote(context, selectedNoteID) {
71363 var _keybinding = utilKeybinding("select-note");
71364 var _noteEditor = uiNoteEditor(context).on("change", function() {
71365 context.map().pan([0, 0]);
71366 var note = checkSelectedID();
71369 context.ui().sidebar.show(_noteEditor.note(note));
71372 behaviorBreathe(context),
71373 behaviorHover(context),
71374 behaviorSelect(context),
71375 behaviorLasso(context),
71376 modeDragNode(context).behavior,
71377 modeDragNote(context).behavior
71379 var _newFeature = false;
71380 function checkSelectedID() {
71383 var note = services.osm.getNote(selectedNoteID);
71385 context.enter(modeBrowse(context));
71389 function selectNote(d3_event, drawn) {
71390 if (!checkSelectedID())
71392 var selection2 = context.surface().selectAll(".layer-notes .note-" + selectedNoteID);
71393 if (selection2.empty()) {
71394 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
71395 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
71396 context.enter(modeBrowse(context));
71399 selection2.classed("selected", true);
71400 context.selectedNoteID(selectedNoteID);
71404 if (context.container().select(".combobox").size())
71406 context.enter(modeBrowse(context));
71408 mode.zoomToSelected = function() {
71411 var note = services.osm.getNote(selectedNoteID);
71413 context.map().centerZoomEase(note.loc, 20);
71416 mode.newFeature = function(val) {
71417 if (!arguments.length)
71418 return _newFeature;
71422 mode.enter = function() {
71423 var note = checkSelectedID();
71426 _behaviors.forEach(context.install);
71427 _keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
71428 select_default2(document).call(_keybinding);
71430 var sidebar = context.ui().sidebar;
71431 sidebar.show(_noteEditor.note(note).newNote(_newFeature));
71432 sidebar.expand(sidebar.intersects(note.extent()));
71433 context.map().on("drawn.select", selectNote);
71435 mode.exit = function() {
71436 _behaviors.forEach(context.uninstall);
71437 select_default2(document).call(_keybinding.unbind);
71438 context.surface().selectAll(".layer-notes .selected").classed("selected hover", false);
71439 context.map().on("drawn.select", null);
71440 context.ui().sidebar.hide();
71441 context.selectedNoteID(null);
71446 // modules/modes/add_note.js
71447 function modeAddNote(context) {
71451 description: _t.append("modes.add_note.description"),
71452 key: _t("modes.add_note.key")
71454 var behavior = behaviorDraw(context).on("click", add).on("cancel", cancel).on("finish", cancel);
71455 function add(loc) {
71456 var osm = services.osm;
71459 var note = osmNote({ loc, status: "open", comments: [] });
71460 osm.replaceNote(note);
71461 context.map().pan([0, 0]);
71462 context.selectedNoteID(note.id).enter(modeSelectNote(context, note.id).newFeature(true));
71464 function cancel() {
71465 context.enter(modeBrowse(context));
71467 mode.enter = function() {
71468 context.install(behavior);
71470 mode.exit = function() {
71471 context.uninstall(behavior);
71476 // modules/modes/save.js
71477 function modeSave(context) {
71478 var mode = { id: "save" };
71479 var keybinding = utilKeybinding("modeSave");
71480 var commit = uiCommit(context).on("cancel", cancel);
71484 var uploader = context.uploader().on("saveStarted.modeSave", function() {
71486 }).on("willAttemptUpload.modeSave", prepareForSuccess).on("progressChanged.modeSave", showProgress).on("resultNoChanges.modeSave", function() {
71488 }).on("resultErrors.modeSave", showErrors).on("resultConflicts.modeSave", showConflicts).on("resultSuccess.modeSave", showSuccess);
71489 function cancel() {
71490 context.enter(modeBrowse(context));
71492 function showProgress(num, total) {
71493 var modal = context.container().select(".loading-modal .modal-section");
71494 var progress = modal.selectAll(".progress").data([0]);
71495 progress.enter().append("div").attr("class", "progress").merge(progress).text(_t("save.conflict_progress", { num, total }));
71497 function showConflicts(changeset, conflicts, origChanges) {
71498 var selection2 = context.container().select(".sidebar").append("div").attr("class", "sidebar-component");
71499 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
71500 _conflictsUi = uiConflicts(context).conflictList(conflicts).origChanges(origChanges).on("cancel", function() {
71501 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71502 selection2.remove();
71504 uploader.cancelConflictResolution();
71505 }).on("save", function() {
71506 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71507 selection2.remove();
71508 uploader.processResolvedConflicts(changeset);
71510 selection2.call(_conflictsUi);
71512 function showErrors(errors) {
71514 var selection2 = uiConfirm(context.container());
71515 selection2.select(".modal-section.header").append("h3").text(_t("save.error"));
71516 addErrors(selection2, errors);
71517 selection2.okButton();
71519 function addErrors(selection2, data) {
71520 var message = selection2.select(".modal-section.message-text");
71521 var items = message.selectAll(".error-container").data(data);
71522 var enter = items.enter().append("div").attr("class", "error-container");
71523 enter.append("a").attr("class", "error-description").attr("href", "#").classed("hide-toggle", true).text(function(d2) {
71524 return d2.msg || _t("save.unknown_error_details");
71525 }).on("click", function(d3_event) {
71526 d3_event.preventDefault();
71527 var error = select_default2(this);
71528 var detail = select_default2(this.nextElementSibling);
71529 var exp2 = error.classed("expanded");
71530 detail.style("display", exp2 ? "none" : "block");
71531 error.classed("expanded", !exp2);
71533 var details = enter.append("div").attr("class", "error-detail-container").style("display", "none");
71534 details.append("ul").attr("class", "error-detail-list").selectAll("li").data(function(d2) {
71535 return d2.details || [];
71536 }).enter().append("li").attr("class", "error-detail-item").text(function(d2) {
71539 items.exit().remove();
71541 function showSuccess(changeset) {
71543 var ui = _success.changeset(changeset).location(_location).on("cancel", function() {
71544 context.ui().sidebar.hide();
71546 context.enter(modeBrowse(context).sidebar(ui));
71548 function keybindingOn() {
71549 select_default2(document).call(keybinding.on("\u238B", cancel, true));
71551 function keybindingOff() {
71552 select_default2(document).call(keybinding.unbind);
71554 function prepareForSuccess() {
71555 _success = uiSuccess(context);
71557 if (!services.geocoder)
71559 services.geocoder.reverse(context.map().center(), function(err, result) {
71560 if (err || !result || !result.address)
71562 var addr = result.address;
71563 var place = addr && (addr.town || addr.city || addr.county) || "";
71564 var region = addr && (addr.state || addr.country) || "";
71565 var separator = place && region ? _t("success.thank_you_where.separator") : "";
71567 "success.thank_you_where.format",
71568 { place, separator, region }
71572 mode.selectedIDs = function() {
71573 return _conflictsUi ? _conflictsUi.shownEntityIds() : [];
71575 mode.enter = function() {
71576 context.ui().sidebar.expand();
71578 context.ui().sidebar.show(commit);
71581 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71582 var osm = context.connection();
71587 if (osm.authenticated()) {
71590 osm.authenticate(function(err) {
71599 mode.exit = function() {
71601 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
71602 context.ui().sidebar.hide();
71607 // modules/modes/select_error.js
71608 function modeSelectError(context, selectedErrorID, selectedErrorService) {
71610 id: "select-error",
71613 var keybinding = utilKeybinding("select-error");
71614 var errorService = services[selectedErrorService];
71616 switch (selectedErrorService) {
71618 errorEditor = uiImproveOsmEditor(context).on("change", function() {
71619 context.map().pan([0, 0]);
71620 var error = checkSelectedID();
71623 context.ui().sidebar.show(errorEditor.error(error));
71627 errorEditor = uiKeepRightEditor(context).on("change", function() {
71628 context.map().pan([0, 0]);
71629 var error = checkSelectedID();
71632 context.ui().sidebar.show(errorEditor.error(error));
71636 errorEditor = uiOsmoseEditor(context).on("change", function() {
71637 context.map().pan([0, 0]);
71638 var error = checkSelectedID();
71641 context.ui().sidebar.show(errorEditor.error(error));
71646 behaviorBreathe(context),
71647 behaviorHover(context),
71648 behaviorSelect(context),
71649 behaviorLasso(context),
71650 modeDragNode(context).behavior,
71651 modeDragNote(context).behavior
71653 function checkSelectedID() {
71656 var error = errorService.getError(selectedErrorID);
71658 context.enter(modeBrowse(context));
71662 mode.zoomToSelected = function() {
71665 var error = errorService.getError(selectedErrorID);
71667 context.map().centerZoomEase(error.loc, 20);
71670 mode.enter = function() {
71671 var error = checkSelectedID();
71674 behaviors.forEach(context.install);
71675 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
71676 select_default2(document).call(keybinding);
71678 var sidebar = context.ui().sidebar;
71679 sidebar.show(errorEditor.error(error));
71680 context.map().on("drawn.select-error", selectError);
71681 function selectError(d3_event, drawn) {
71682 if (!checkSelectedID())
71684 var selection2 = context.surface().selectAll(".itemId-" + selectedErrorID + "." + selectedErrorService);
71685 if (selection2.empty()) {
71686 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
71687 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
71688 context.enter(modeBrowse(context));
71691 selection2.classed("selected", true);
71692 context.selectedErrorID(selectedErrorID);
71696 if (context.container().select(".combobox").size())
71698 context.enter(modeBrowse(context));
71701 mode.exit = function() {
71702 behaviors.forEach(context.uninstall);
71703 select_default2(document).call(keybinding.unbind);
71704 context.surface().selectAll(".qaItem.selected").classed("selected hover", false);
71705 context.map().on("drawn.select-error", null);
71706 context.ui().sidebar.hide();
71707 context.selectedErrorID(null);
71708 context.features().forceVisible([]);
71713 // modules/ui/tools/modes.js
71714 function uiToolDrawModes(context) {
71717 label: _t.append("toolbar.add_feature")
71720 modeAddPoint(context, {
71721 title: _t.append("modes.add_point.title"),
71723 description: _t.append("modes.add_point.description"),
71724 preset: _mainPresetIndex.item("point"),
71727 modeAddLine(context, {
71728 title: _t.append("modes.add_line.title"),
71730 description: _t.append("modes.add_line.description"),
71731 preset: _mainPresetIndex.item("line"),
71734 modeAddArea(context, {
71735 title: _t.append("modes.add_area.title"),
71737 description: _t.append("modes.add_area.description"),
71738 preset: _mainPresetIndex.item("area"),
71742 function enabled(_mode) {
71743 return osmEditable();
71745 function osmEditable() {
71746 return context.editable();
71748 modes.forEach(function(mode) {
71749 context.keybinding().on(mode.key, function() {
71750 if (!enabled(mode))
71752 if (mode.id === context.mode().id) {
71753 context.enter(modeBrowse(context));
71755 context.enter(mode);
71759 tool.render = function(selection2) {
71760 var wrap2 = selection2.append("div").attr("class", "joined").style("display", "flex");
71761 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71762 context.map().on("move.modes", debouncedUpdate).on("drawn.modes", debouncedUpdate);
71763 context.on("enter.modes", update);
71765 function update() {
71766 var buttons = wrap2.selectAll("button.add-button").data(modes, function(d2) {
71769 buttons.exit().remove();
71770 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
71771 return d2.id + " add-button bar-button";
71772 }).on("click.mode-buttons", function(d3_event, d2) {
71775 var currMode = context.mode().id;
71776 if (/^draw/.test(currMode))
71778 if (d2.id === currMode) {
71779 context.enter(modeBrowse(context));
71784 uiTooltip().placement("bottom").title(function(d2) {
71785 return d2.description;
71786 }).keys(function(d2) {
71788 }).scrollContainer(context.container().select(".top-toolbar"))
71790 buttonsEnter.each(function(d2) {
71791 select_default2(this).call(svgIcon("#iD-icon-" + d2.button));
71793 buttonsEnter.append("span").attr("class", "label").text("").each(function(mode) {
71794 mode.title(select_default2(this));
71796 if (buttons.enter().size() || buttons.exit().size()) {
71797 context.ui().checkOverflow(".top-toolbar", true);
71799 buttons = buttons.merge(buttonsEnter).attr("aria-disabled", function(d2) {
71800 return !enabled(d2);
71801 }).classed("disabled", function(d2) {
71802 return !enabled(d2);
71803 }).attr("aria-pressed", function(d2) {
71804 return context.mode() && context.mode().button === d2.button;
71805 }).classed("active", function(d2) {
71806 return context.mode() && context.mode().button === d2.button;
71813 // modules/ui/tools/notes.js
71814 function uiToolNotes(context) {
71817 label: _t.append("modes.add_note.label")
71819 var mode = modeAddNote(context);
71820 function enabled() {
71821 return notesEnabled() && notesEditable();
71823 function notesEnabled() {
71824 var noteLayer = context.layers().layer("notes");
71825 return noteLayer && noteLayer.enabled();
71827 function notesEditable() {
71828 var mode2 = context.mode();
71829 return context.map().notesEditable() && mode2 && mode2.id !== "save";
71831 context.keybinding().on(mode.key, function() {
71834 if (mode.id === context.mode().id) {
71835 context.enter(modeBrowse(context));
71837 context.enter(mode);
71840 tool.render = function(selection2) {
71841 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71842 context.map().on("move.notes", debouncedUpdate).on("drawn.notes", debouncedUpdate);
71843 context.on("enter.notes", update);
71845 function update() {
71846 var showNotes = notesEnabled();
71847 var data = showNotes ? [mode] : [];
71848 var buttons = selection2.selectAll("button.add-button").data(data, function(d2) {
71851 buttons.exit().remove();
71852 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
71853 return d2.id + " add-button bar-button";
71854 }).on("click.notes", function(d3_event, d2) {
71857 var currMode = context.mode().id;
71858 if (/^draw/.test(currMode))
71860 if (d2.id === currMode) {
71861 context.enter(modeBrowse(context));
71866 uiTooltip().placement("bottom").title(function(d2) {
71867 return d2.description;
71868 }).keys(function(d2) {
71870 }).scrollContainer(context.container().select(".top-toolbar"))
71872 buttonsEnter.each(function(d2) {
71873 select_default2(this).call(svgIcon(d2.icon || "#iD-icon-" + d2.button));
71875 if (buttons.enter().size() || buttons.exit().size()) {
71876 context.ui().checkOverflow(".top-toolbar", true);
71878 buttons = buttons.merge(buttonsEnter).classed("disabled", function() {
71880 }).attr("aria-disabled", function() {
71882 }).classed("active", function(d2) {
71883 return context.mode() && context.mode().button === d2.button;
71884 }).attr("aria-pressed", function(d2) {
71885 return context.mode() && context.mode().button === d2.button;
71889 tool.uninstall = function() {
71890 context.on("enter.editor.notes", null).on("exit.editor.notes", null).on("enter.notes", null);
71891 context.map().on("move.notes", null).on("drawn.notes", null);
71896 // modules/ui/tools/save.js
71897 function uiToolSave(context) {
71900 label: _t.append("save.title")
71903 var tooltipBehavior = null;
71904 var history = context.history();
71905 var key = uiCmd("\u2318S");
71906 var _numChanges = 0;
71907 function isSaving() {
71908 var mode = context.mode();
71909 return mode && mode.id === "save";
71911 function isDisabled() {
71912 return _numChanges === 0 || isSaving();
71914 function save(d3_event) {
71915 d3_event.preventDefault();
71916 if (!context.inIntro() && !isSaving() && history.hasChanges()) {
71917 context.enter(modeSave(context));
71920 function bgColor(numChanges) {
71922 if (numChanges === 0) {
71924 } else if (numChanges <= 50) {
71925 step = numChanges / 50;
71926 return rgb_default("#fff", "#ff8")(step);
71928 step = Math.min((numChanges - 50) / 50, 1);
71929 return rgb_default("#ff8", "#f88")(step);
71932 function updateCount() {
71933 var val = history.difference().summary().length;
71934 if (val === _numChanges)
71937 if (tooltipBehavior) {
71938 tooltipBehavior.title(() => _t.append(_numChanges > 0 ? "save.help" : "save.no_changes")).keys([key]);
71941 button.classed("disabled", isDisabled()).style("background", bgColor(_numChanges));
71942 button.select("span.count").text(_numChanges);
71945 tool.render = function(selection2) {
71946 tooltipBehavior = uiTooltip().placement("bottom").title(() => _t.append("save.no_changes")).keys([key]).scrollContainer(context.container().select(".top-toolbar"));
71947 var lastPointerUpType;
71948 button = selection2.append("button").attr("class", "save disabled bar-button").on("pointerup", function(d3_event) {
71949 lastPointerUpType = d3_event.pointerType;
71950 }).on("click", function(d3_event) {
71952 if (_numChanges === 0 && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
71953 context.ui().flash.duration(2e3).iconName("#iD-icon-save").iconClass("disabled").label(_t.append("save.no_changes"))();
71955 lastPointerUpType = null;
71956 }).call(tooltipBehavior);
71957 button.call(svgIcon("#iD-icon-save"));
71958 button.append("span").attr("class", "count").attr("aria-hidden", "true").text("0");
71960 context.keybinding().on(key, save, true);
71961 context.history().on("change.save", updateCount);
71962 context.on("enter.save", function() {
71964 button.classed("disabled", isDisabled());
71966 button.call(tooltipBehavior.hide);
71971 tool.uninstall = function() {
71972 context.keybinding().off(key, true);
71973 context.history().on("change.save", null);
71974 context.on("enter.save", null);
71976 tooltipBehavior = null;
71981 // modules/ui/tools/sidebar_toggle.js
71982 function uiToolSidebarToggle(context) {
71984 id: "sidebar_toggle",
71985 label: _t.append("toolbar.inspect")
71987 tool.render = function(selection2) {
71988 selection2.append("button").attr("class", "bar-button").attr("aria-label", _t("sidebar.tooltip")).on("click", function() {
71989 context.ui().sidebar.toggle();
71991 uiTooltip().placement("bottom").title(() => _t.append("sidebar.tooltip")).keys([_t("sidebar.key")]).scrollContainer(context.container().select(".top-toolbar"))
71992 ).call(svgIcon("#iD-icon-sidebar-" + (_mainLocalizer.textDirection() === "rtl" ? "right" : "left")));
71997 // modules/ui/tools/undo_redo.js
71998 function uiToolUndoRedo(context) {
72001 label: _t.append("toolbar.undo_redo")
72005 cmd: uiCmd("\u2318Z"),
72006 action: function() {
72009 annotation: function() {
72010 return context.history().undoAnnotation();
72012 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")
72015 cmd: uiCmd("\u2318\u21E7Z"),
72016 action: function() {
72019 annotation: function() {
72020 return context.history().redoAnnotation();
72022 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "undo" : "redo")
72024 function editable() {
72025 return context.mode() && context.mode().id !== "save" && context.map().editableDataEnabled(
72027 /* ignore min zoom */
72030 tool.render = function(selection2) {
72031 var tooltipBehavior = uiTooltip().placement("bottom").title(function(d2) {
72032 return d2.annotation() ? _t.append(d2.id + ".tooltip", { action: d2.annotation() }) : _t.append(d2.id + ".nothing");
72033 }).keys(function(d2) {
72035 }).scrollContainer(context.container().select(".top-toolbar"));
72036 var lastPointerUpType;
72037 var buttons = selection2.selectAll("button").data(commands).enter().append("button").attr("class", function(d2) {
72038 return "disabled " + d2.id + "-button bar-button";
72039 }).on("pointerup", function(d3_event) {
72040 lastPointerUpType = d3_event.pointerType;
72041 }).on("click", function(d3_event, d2) {
72042 d3_event.preventDefault();
72043 var annotation = d2.annotation();
72044 if (editable() && annotation) {
72047 if (editable() && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
72048 var label = annotation ? _t.append(d2.id + ".tooltip", { action: annotation }) : _t.append(d2.id + ".nothing");
72049 context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass(annotation ? "" : "disabled").label(label)();
72051 lastPointerUpType = null;
72052 }).call(tooltipBehavior);
72053 buttons.each(function(d2) {
72054 select_default2(this).call(svgIcon("#" + d2.icon));
72056 context.keybinding().on(commands[0].cmd, function(d3_event) {
72057 d3_event.preventDefault();
72059 commands[0].action();
72060 }).on(commands[1].cmd, function(d3_event) {
72061 d3_event.preventDefault();
72063 commands[1].action();
72065 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
72066 context.map().on("move.undo_redo", debouncedUpdate).on("drawn.undo_redo", debouncedUpdate);
72067 context.history().on("change.undo_redo", function(difference) {
72071 context.on("enter.undo_redo", update);
72072 function update() {
72073 buttons.classed("disabled", function(d2) {
72074 return !editable() || !d2.annotation();
72075 }).each(function() {
72076 var selection3 = select_default2(this);
72077 if (!selection3.select(".tooltip.in").empty()) {
72078 selection3.call(tooltipBehavior.updateContent);
72083 tool.uninstall = function() {
72084 context.keybinding().off(commands[0].cmd).off(commands[1].cmd);
72085 context.map().on("move.undo_redo", null).on("drawn.undo_redo", null);
72086 context.history().on("change.undo_redo", null);
72087 context.on("enter.undo_redo", null);
72092 // modules/ui/top_toolbar.js
72093 function uiTopToolbar(context) {
72094 var sidebarToggle = uiToolSidebarToggle(context), modes = uiToolDrawModes(context), notes = uiToolNotes(context), undoRedo = uiToolUndoRedo(context), save = uiToolSave(context);
72095 function notesEnabled() {
72096 var noteLayer = context.layers().layer("notes");
72097 return noteLayer && noteLayer.enabled();
72099 function topToolbar(bar) {
72100 bar.on("wheel.topToolbar", function(d3_event) {
72101 if (!d3_event.deltaX) {
72102 bar.node().scrollLeft += d3_event.deltaY;
72105 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
72106 context.layers().on("change.topToolbar", debouncedUpdate);
72108 function update() {
72114 tools.push("spacer");
72115 if (notesEnabled()) {
72116 tools = tools.concat([notes, "spacer"]);
72118 tools = tools.concat([undoRedo, save]);
72119 var toolbarItems = bar.selectAll(".toolbar-item").data(tools, function(d2) {
72120 return d2.id || d2;
72122 toolbarItems.exit().each(function(d2) {
72123 if (d2.uninstall) {
72127 var itemsEnter = toolbarItems.enter().append("div").attr("class", function(d2) {
72128 var classes = "toolbar-item " + (d2.id || d2).replace("_", "-");
72130 classes += " " + d2.klass;
72133 var actionableItems = itemsEnter.filter(function(d2) {
72134 return d2 !== "spacer";
72136 actionableItems.append("div").attr("class", "item-content").each(function(d2) {
72137 select_default2(this).call(d2.render, bar);
72139 actionableItems.append("div").attr("class", "item-label").each(function(d2) {
72140 d2.label(select_default2(this));
72147 // modules/ui/zoom_to_selection.js
72148 function uiZoomToSelection(context) {
72149 function isDisabled() {
72150 var mode = context.mode();
72151 return !mode || !mode.zoomToSelected;
72153 var _lastPointerUpType;
72154 function pointerup(d3_event) {
72155 _lastPointerUpType = d3_event.pointerType;
72157 function click(d3_event) {
72158 d3_event.preventDefault();
72159 if (isDisabled()) {
72160 if (_lastPointerUpType === "touch" || _lastPointerUpType === "pen") {
72161 context.ui().flash.duration(2e3).iconName("#iD-icon-framed-dot").iconClass("disabled").label(_t.append("inspector.zoom_to.no_selection"))();
72164 var mode = context.mode();
72165 if (mode && mode.zoomToSelected) {
72166 mode.zoomToSelected();
72169 _lastPointerUpType = null;
72171 return function(selection2) {
72172 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function() {
72173 if (isDisabled()) {
72174 return _t.append("inspector.zoom_to.no_selection");
72176 return _t.append("inspector.zoom_to.title");
72177 }).keys([_t("inspector.zoom_to.key")]);
72178 var button = selection2.append("button").on("pointerup", pointerup).on("click", click).call(svgIcon("#iD-icon-framed-dot", "light")).call(tooltipBehavior);
72179 function setEnabledState() {
72180 button.classed("disabled", isDisabled());
72181 if (!button.select(".tooltip.in").empty()) {
72182 button.call(tooltipBehavior.updateContent);
72185 context.on("enter.uiZoomToSelection", setEnabledState);
72190 // modules/ui/pane.js
72191 function uiPane(id2, context) {
72194 var _description = "";
72195 var _iconName = "";
72197 var _paneSelection = select_default2(null);
72202 pane.label = function(val) {
72203 if (!arguments.length)
72208 pane.key = function(val) {
72209 if (!arguments.length)
72214 pane.description = function(val) {
72215 if (!arguments.length)
72216 return _description;
72217 _description = val;
72220 pane.iconName = function(val) {
72221 if (!arguments.length)
72226 pane.sections = function(val) {
72227 if (!arguments.length)
72232 pane.selection = function() {
72233 return _paneSelection;
72235 function hidePane() {
72236 context.ui().togglePanes();
72238 pane.togglePane = function(d3_event) {
72240 d3_event.preventDefault();
72241 _paneTooltip.hide();
72242 context.ui().togglePanes(!_paneSelection.classed("shown") ? _paneSelection : void 0);
72244 pane.renderToggleButton = function(selection2) {
72245 if (!_paneTooltip) {
72246 _paneTooltip = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _description).keys([_key]);
72248 selection2.append("button").on("click", pane.togglePane).call(svgIcon("#" + _iconName, "light")).call(_paneTooltip);
72250 pane.renderContent = function(selection2) {
72252 _sections.forEach(function(section) {
72253 selection2.call(section.render);
72257 pane.renderPane = function(selection2) {
72258 _paneSelection = selection2.append("div").attr("class", "fillL map-pane hide " + id2 + "-pane").attr("pane", id2);
72259 var heading = _paneSelection.append("div").attr("class", "pane-heading");
72260 heading.append("h2").text("").call(_label);
72261 heading.append("button").attr("title", _t("icons.close")).on("click", hidePane).call(svgIcon("#iD-icon-close"));
72262 _paneSelection.append("div").attr("class", "pane-content").call(pane.renderContent);
72264 context.keybinding().on(_key, pane.togglePane);
72270 // modules/ui/sections/background_display_options.js
72271 function uiSectionBackgroundDisplayOptions(context) {
72272 var section = uiSection("background-display-options", context).label(() => _t.append("background.display_options")).disclosureContent(renderDisclosureContent);
72273 var _storedOpacity = corePreferences("background-opacity");
72276 var _sliders = ["brightness", "contrast", "saturation", "sharpness"];
72278 brightness: _storedOpacity !== null ? +_storedOpacity : 1,
72283 function clamp3(x2, min3, max3) {
72284 return Math.max(min3, Math.min(x2, max3));
72286 function updateValue(d2, val) {
72287 val = clamp3(val, _minVal, _maxVal);
72288 _options[d2] = val;
72289 context.background()[d2](val);
72290 if (d2 === "brightness") {
72291 corePreferences("background-opacity", val);
72293 section.reRender();
72295 function renderDisclosureContent(selection2) {
72296 var container = selection2.selectAll(".display-options-container").data([0]);
72297 var containerEnter = container.enter().append("div").attr("class", "display-options-container controls-list");
72298 var slidersEnter = containerEnter.selectAll(".display-control").data(_sliders).enter().append("label").attr("class", function(d2) {
72299 return "display-control display-control-" + d2;
72301 slidersEnter.html(function(d2) {
72302 return _t.html("background." + d2);
72303 }).append("span").attr("class", function(d2) {
72304 return "display-option-value display-option-value-" + d2;
72306 var sildersControlEnter = slidersEnter.append("div").attr("class", "control-wrap");
72307 sildersControlEnter.append("input").attr("class", function(d2) {
72308 return "display-option-input display-option-input-" + d2;
72309 }).attr("type", "range").attr("min", _minVal).attr("max", _maxVal).attr("step", "0.05").on("input", function(d3_event, d2) {
72310 var val = select_default2(this).property("value");
72311 if (!val && d3_event && d3_event.target) {
72312 val = d3_event.target.value;
72314 updateValue(d2, val);
72316 sildersControlEnter.append("button").attr("title", function(d2) {
72317 return `${_t("background.reset")} ${_t("background." + d2)}`;
72318 }).attr("class", function(d2) {
72319 return "display-option-reset display-option-reset-" + d2;
72320 }).on("click", function(d3_event, d2) {
72321 if (d3_event.button !== 0)
72323 updateValue(d2, 1);
72324 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
72325 containerEnter.append("a").attr("class", "display-option-resetlink").attr("role", "button").attr("href", "#").call(_t.append("background.reset_all")).on("click", function(d3_event) {
72326 d3_event.preventDefault();
72327 for (var i3 = 0; i3 < _sliders.length; i3++) {
72328 updateValue(_sliders[i3], 1);
72331 container = containerEnter.merge(container);
72332 container.selectAll(".display-option-input").property("value", function(d2) {
72333 return _options[d2];
72335 container.selectAll(".display-option-value").text(function(d2) {
72336 return Math.floor(_options[d2] * 100) + "%";
72338 container.selectAll(".display-option-reset").classed("disabled", function(d2) {
72339 return _options[d2] === 1;
72341 if (containerEnter.size() && _options.brightness !== 1) {
72342 context.background().brightness(_options.brightness);
72348 // modules/ui/settings/custom_background.js
72349 function uiSettingsCustomBackground() {
72350 var dispatch14 = dispatch_default("change");
72351 function render(selection2) {
72352 var _origSettings = {
72353 template: corePreferences("background-custom-template")
72355 var _currSettings = {
72356 template: corePreferences("background-custom-template")
72358 var example = "https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png";
72359 var modal = uiConfirm(selection2).okButton();
72360 modal.classed("settings-modal settings-custom-background", true);
72361 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_background.header"));
72362 var textSection = modal.select(".modal-section.message-text");
72363 var instructions = `${_t.html("settings.custom_background.instructions.info")}
72365 #### ${_t.html("settings.custom_background.instructions.wms.tokens_label")}
72366 * ${_t.html("settings.custom_background.instructions.wms.tokens.proj")}
72367 * ${_t.html("settings.custom_background.instructions.wms.tokens.wkid")}
72368 * ${_t.html("settings.custom_background.instructions.wms.tokens.dimensions")}
72369 * ${_t.html("settings.custom_background.instructions.wms.tokens.bbox")}
72371 #### ${_t.html("settings.custom_background.instructions.tms.tokens_label")}
72372 * ${_t.html("settings.custom_background.instructions.tms.tokens.xyz")}
72373 * ${_t.html("settings.custom_background.instructions.tms.tokens.flipped_y")}
72374 * ${_t.html("settings.custom_background.instructions.tms.tokens.switch")}
72375 * ${_t.html("settings.custom_background.instructions.tms.tokens.quadtile")}
72376 * ${_t.html("settings.custom_background.instructions.tms.tokens.scale_factor")}
72378 #### ${_t.html("settings.custom_background.instructions.example")}
72380 textSection.append("div").attr("class", "instructions-template").html(marked(instructions));
72381 textSection.append("textarea").attr("class", "field-template").attr("placeholder", _t("settings.custom_background.template.placeholder")).call(utilNoAuto).property("value", _currSettings.template);
72382 var buttonSection = modal.select(".modal-section.buttons");
72383 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
72384 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
72385 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
72386 function isSaveDisabled() {
72389 function clickCancel() {
72390 textSection.select(".field-template").property("value", _origSettings.template);
72391 corePreferences("background-custom-template", _origSettings.template);
72395 function clickSave() {
72396 _currSettings.template = textSection.select(".field-template").property("value");
72397 corePreferences("background-custom-template", _currSettings.template);
72400 dispatch14.call("change", this, _currSettings);
72403 return utilRebind(render, dispatch14, "on");
72406 // modules/ui/sections/background_list.js
72407 function uiSectionBackgroundList(context) {
72408 var _backgroundList = select_default2(null);
72409 var _customSource = context.background().findSource("custom");
72410 var _settingsCustomBackground = uiSettingsCustomBackground(context).on("change", customChanged);
72411 var section = uiSection("background-list", context).label(() => _t.append("background.backgrounds")).disclosureContent(renderDisclosureContent);
72412 function previousBackgroundID() {
72413 return corePreferences("background-last-used-toggle");
72415 function renderDisclosureContent(selection2) {
72416 var container = selection2.selectAll(".layer-background-list").data([0]);
72417 _backgroundList = container.enter().append("ul").attr("class", "layer-list layer-background-list").attr("dir", "auto").merge(container);
72418 var bgExtrasListEnter = selection2.selectAll(".bg-extras-list").data([0]).enter().append("ul").attr("class", "layer-list bg-extras-list");
72419 var minimapLabelEnter = bgExtrasListEnter.append("li").attr("class", "minimap-toggle-item").append("label").call(
72420 uiTooltip().title(() => _t.append("background.minimap.tooltip")).keys([_t("background.minimap.key")]).placement("top")
72422 minimapLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72423 d3_event.preventDefault();
72424 uiMapInMap.toggle();
72426 minimapLabelEnter.append("span").call(_t.append("background.minimap.description"));
72427 var panelLabelEnter = bgExtrasListEnter.append("li").attr("class", "background-panel-toggle-item").append("label").call(
72428 uiTooltip().title(() => _t.append("background.panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.background.key"))]).placement("top")
72430 panelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72431 d3_event.preventDefault();
72432 context.ui().info.toggle("background");
72434 panelLabelEnter.append("span").call(_t.append("background.panel.description"));
72435 var locPanelLabelEnter = bgExtrasListEnter.append("li").attr("class", "location-panel-toggle-item").append("label").call(
72436 uiTooltip().title(() => _t.append("background.location_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.location.key"))]).placement("top")
72438 locPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72439 d3_event.preventDefault();
72440 context.ui().info.toggle("location");
72442 locPanelLabelEnter.append("span").call(_t.append("background.location_panel.description"));
72443 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"));
72444 _backgroundList.call(drawListItems, "radio", function(d3_event, d2) {
72445 chooseBackground(d2);
72447 return !d2.isHidden() && !d2.overlay;
72450 function setTooltips(selection2) {
72451 selection2.each(function(d2, i3, nodes) {
72452 var item = select_default2(this).select("label");
72453 var span = item.select("span");
72454 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
72455 var hasDescription = d2.hasDescription();
72456 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
72457 item.call(uiTooltip().destroyAny);
72458 if (d2.id === previousBackgroundID()) {
72460 uiTooltip().placement(placement).title(() => _t.append("background.switch")).keys([uiCmd("\u2318" + _t("background.key"))])
72462 } else if (hasDescription || isOverflowing) {
72464 uiTooltip().placement(placement).title(() => hasDescription ? d2.description() : d2.label())
72469 function drawListItems(layerList, type2, change, filter2) {
72470 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2).sort(function(a2, b2) {
72471 return a2.best() && !b2.best() ? -1 : b2.best() && !a2.best() ? 1 : descending(a2.area(), b2.area()) || ascending(a2.name(), b2.name()) || 0;
72473 var layerLinks = layerList.selectAll("li").data(sources, function(d2, i3) {
72474 return d2.id + "---" + i3;
72476 layerLinks.exit().remove();
72477 var enter = layerLinks.enter().append("li").classed("layer-custom", function(d2) {
72478 return d2.id === "custom";
72479 }).classed("best", function(d2) {
72482 var label = enter.append("label");
72483 label.append("input").attr("type", type2).attr("name", "background-layer").attr("value", function(d2) {
72485 }).on("change", change);
72486 label.append("span").each(function(d2) {
72487 d2.label()(select_default2(this));
72489 enter.filter(function(d2) {
72490 return d2.id === "custom";
72491 }).append("button").attr("class", "layer-browse").call(
72492 uiTooltip().title(() => _t.append("settings.custom_background.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72493 ).on("click", function(d3_event) {
72494 d3_event.preventDefault();
72496 }).call(svgIcon("#iD-icon-more"));
72497 enter.filter(function(d2) {
72499 }).append("div").attr("class", "best").call(
72500 uiTooltip().title(() => _t.append("background.best_imagery")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72501 ).append("span").text("\u2605");
72502 layerList.call(updateLayerSelections);
72504 function updateLayerSelections(selection2) {
72505 function active(d2) {
72506 return context.background().showsLayer(d2);
72508 selection2.selectAll("li").classed("active", active).classed("switch", function(d2) {
72509 return d2.id === previousBackgroundID();
72510 }).call(setTooltips).selectAll("input").property("checked", active);
72512 function chooseBackground(d2) {
72513 if (d2.id === "custom" && !d2.template()) {
72514 return editCustom();
72516 var previousBackground = context.background().baseLayerSource();
72517 corePreferences("background-last-used-toggle", previousBackground.id);
72518 corePreferences("background-last-used", d2.id);
72519 context.background().baseLayerSource(d2);
72521 function customChanged(d2) {
72522 if (d2 && d2.template) {
72523 _customSource.template(d2.template);
72524 chooseBackground(_customSource);
72526 _customSource.template("");
72527 chooseBackground(context.background().findSource("none"));
72530 function editCustom() {
72531 context.container().call(_settingsCustomBackground);
72533 context.background().on("change.background_list", function() {
72534 _backgroundList.call(updateLayerSelections);
72537 "move.background_list",
72538 debounce_default(function() {
72539 window.requestIdleCallback(section.reRender);
72545 // modules/ui/sections/background_offset.js
72546 function uiSectionBackgroundOffset(context) {
72547 var section = uiSection("background-offset", context).label(() => _t.append("background.fix_misalignment")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
72548 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
72549 var _directions = [
72550 ["top", [0, -0.5]],
72551 ["left", [-0.5, 0]],
72552 ["right", [0.5, 0]],
72553 ["bottom", [0, 0.5]]
72555 function updateValue() {
72556 var meters = geoOffsetToMeters(context.background().offset());
72557 var x2 = +meters[0].toFixed(2);
72558 var y2 = +meters[1].toFixed(2);
72559 context.container().selectAll(".nudge-inner-rect").select("input").classed("error", false).property("value", x2 + ", " + y2);
72560 context.container().selectAll(".nudge-reset").classed("disabled", function() {
72561 return x2 === 0 && y2 === 0;
72564 function resetOffset() {
72565 context.background().offset([0, 0]);
72568 function nudge(d2) {
72569 context.background().nudge(d2, context.map().zoom());
72572 function inputOffset() {
72573 var input = select_default2(this);
72574 var d2 = input.node().value;
72576 return resetOffset();
72577 d2 = d2.replace(/;/g, ",").split(",").map(function(n3) {
72578 return !isNaN(n3) && n3;
72580 if (d2.length !== 2 || !d2[0] || !d2[1]) {
72581 input.classed("error", true);
72584 context.background().offset(geoMetersToOffset(d2));
72587 function dragOffset(d3_event) {
72588 if (d3_event.button !== 0)
72590 var origin = [d3_event.clientX, d3_event.clientY];
72591 var pointerId = d3_event.pointerId || "mouse";
72592 context.container().append("div").attr("class", "nudge-surface");
72593 select_default2(window).on(_pointerPrefix + "move.drag-bg-offset", pointermove).on(_pointerPrefix + "up.drag-bg-offset", pointerup);
72594 if (_pointerPrefix === "pointer") {
72595 select_default2(window).on("pointercancel.drag-bg-offset", pointerup);
72597 function pointermove(d3_event2) {
72598 if (pointerId !== (d3_event2.pointerId || "mouse"))
72600 var latest = [d3_event2.clientX, d3_event2.clientY];
72602 -(origin[0] - latest[0]) / 4,
72603 -(origin[1] - latest[1]) / 4
72608 function pointerup(d3_event2) {
72609 if (pointerId !== (d3_event2.pointerId || "mouse"))
72611 if (d3_event2.button !== 0)
72613 context.container().selectAll(".nudge-surface").remove();
72614 select_default2(window).on(".drag-bg-offset", null);
72617 function renderDisclosureContent(selection2) {
72618 var container = selection2.selectAll(".nudge-container").data([0]);
72619 var containerEnter = container.enter().append("div").attr("class", "nudge-container");
72620 containerEnter.append("div").attr("class", "nudge-instructions").call(_t.append("background.offset"));
72621 var nudgeWrapEnter = containerEnter.append("div").attr("class", "nudge-controls-wrap");
72622 var nudgeEnter = nudgeWrapEnter.append("div").attr("class", "nudge-outer-rect").on(_pointerPrefix + "down", dragOffset);
72623 nudgeEnter.append("div").attr("class", "nudge-inner-rect").append("input").attr("type", "text").attr("aria-label", _t("background.offset_label")).on("change", inputOffset);
72624 nudgeWrapEnter.append("div").selectAll("button").data(_directions).enter().append("button").attr("title", function(d2) {
72625 return _t(`background.nudge.${d2[0]}`);
72626 }).attr("class", function(d2) {
72627 return d2[0] + " nudge";
72628 }).on("click", function(d3_event, d2) {
72631 nudgeWrapEnter.append("button").attr("title", _t("background.reset")).attr("class", "nudge-reset disabled").on("click", function(d3_event) {
72632 d3_event.preventDefault();
72634 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
72637 context.background().on("change.backgroundOffset-update", updateValue);
72641 // modules/ui/sections/overlay_list.js
72642 function uiSectionOverlayList(context) {
72643 var section = uiSection("overlay-list", context).label(() => _t.append("background.overlays")).disclosureContent(renderDisclosureContent);
72644 var _overlayList = select_default2(null);
72645 function setTooltips(selection2) {
72646 selection2.each(function(d2, i3, nodes) {
72647 var item = select_default2(this).select("label");
72648 var span = item.select("span");
72649 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
72650 var description = d2.description();
72651 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
72652 item.call(uiTooltip().destroyAny);
72653 if (description || isOverflowing) {
72655 uiTooltip().placement(placement).title(() => description || d2.name())
72660 function updateLayerSelections(selection2) {
72661 function active(d2) {
72662 return context.background().showsLayer(d2);
72664 selection2.selectAll("li").classed("active", active).call(setTooltips).selectAll("input").property("checked", active);
72666 function chooseOverlay(d3_event, d2) {
72667 d3_event.preventDefault();
72668 context.background().toggleOverlayLayer(d2);
72669 _overlayList.call(updateLayerSelections);
72670 document.activeElement.blur();
72672 function drawListItems(layerList, type2, change, filter2) {
72673 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2);
72674 var layerLinks = layerList.selectAll("li").data(sources, function(d2) {
72677 layerLinks.exit().remove();
72678 var enter = layerLinks.enter().append("li");
72679 var label = enter.append("label");
72680 label.append("input").attr("type", type2).attr("name", "layers").on("change", change);
72681 label.append("span").each(function(d2) {
72682 d2.label()(select_default2(this));
72684 layerList.selectAll("li").sort(sortSources);
72685 layerList.call(updateLayerSelections);
72686 function sortSources(a2, b2) {
72687 return a2.best() && !b2.best() ? -1 : b2.best() && !a2.best() ? 1 : descending(a2.area(), b2.area()) || ascending(a2.name(), b2.name()) || 0;
72690 function renderDisclosureContent(selection2) {
72691 var container = selection2.selectAll(".layer-overlay-list").data([0]);
72692 _overlayList = container.enter().append("ul").attr("class", "layer-list layer-overlay-list").attr("dir", "auto").merge(container);
72693 _overlayList.call(drawListItems, "checkbox", chooseOverlay, function(d2) {
72694 return !d2.isHidden() && d2.overlay;
72698 "move.overlay_list",
72699 debounce_default(function() {
72700 window.requestIdleCallback(section.reRender);
72706 // modules/ui/panes/background.js
72707 function uiPaneBackground(context) {
72708 var backgroundPane = uiPane("background", context).key(_t("background.key")).label(_t.append("background.title")).description(_t.append("background.description")).iconName("iD-icon-layers").sections([
72709 uiSectionBackgroundList(context),
72710 uiSectionOverlayList(context),
72711 uiSectionBackgroundDisplayOptions(context),
72712 uiSectionBackgroundOffset(context)
72714 return backgroundPane;
72717 // modules/ui/panes/help.js
72718 function uiPaneHelp(context) {
72728 "open_source_attribution",
72741 "select_left_click",
72742 "select_right_click",
72746 "multiselect_shift_click",
72747 "multiselect_lasso",
72760 ["feature_editor", [
72767 "fields_all_fields",
72769 "fields_add_field",
72778 "add_point_finish",
72783 "delete_point_command"
72790 "add_line_continue",
72793 "modify_line_dragnode",
72794 "modify_line_addnode",
72797 "connect_line_display",
72798 "connect_line_drag",
72799 "connect_line_tag",
72800 "disconnect_line_h",
72801 "disconnect_line_command",
72803 "move_line_command",
72804 "move_line_connected",
72807 "delete_line_command"
72814 "add_area_command",
72816 "add_area_continue",
72819 "square_area_command",
72821 "modify_area_dragnode",
72822 "modify_area_addnode",
72825 "delete_area_command"
72831 "edit_relation_add",
72832 "edit_relation_delete",
72833 "maintain_relation_h",
72834 "maintain_relation",
72835 "relation_types_h",
72838 "multipolygon_create",
72839 "multipolygon_merge",
72840 "turn_restriction_h",
72841 "turn_restriction",
72842 "turn_restriction_field",
72843 "turn_restriction_editing",
72914 "help.help.open_data_h": 3,
72915 "help.help.before_start_h": 3,
72916 "help.help.open_source_h": 3,
72917 "help.overview.navigation_h": 3,
72918 "help.overview.features_h": 3,
72919 "help.editing.select_h": 3,
72920 "help.editing.multiselect_h": 3,
72921 "help.editing.undo_redo_h": 3,
72922 "help.editing.save_h": 3,
72923 "help.editing.upload_h": 3,
72924 "help.editing.backups_h": 3,
72925 "help.editing.keyboard_h": 3,
72926 "help.feature_editor.type_h": 3,
72927 "help.feature_editor.fields_h": 3,
72928 "help.feature_editor.tags_h": 3,
72929 "help.points.add_point_h": 3,
72930 "help.points.move_point_h": 3,
72931 "help.points.delete_point_h": 3,
72932 "help.lines.add_line_h": 3,
72933 "help.lines.modify_line_h": 3,
72934 "help.lines.connect_line_h": 3,
72935 "help.lines.disconnect_line_h": 3,
72936 "help.lines.move_line_h": 3,
72937 "help.lines.delete_line_h": 3,
72938 "help.areas.point_or_area_h": 3,
72939 "help.areas.add_area_h": 3,
72940 "help.areas.square_area_h": 3,
72941 "help.areas.modify_area_h": 3,
72942 "help.areas.delete_area_h": 3,
72943 "help.relations.edit_relation_h": 3,
72944 "help.relations.maintain_relation_h": 3,
72945 "help.relations.relation_types_h": 2,
72946 "help.relations.multipolygon_h": 3,
72947 "help.relations.turn_restriction_h": 3,
72948 "help.relations.route_h": 3,
72949 "help.relations.boundary_h": 3,
72950 "help.notes.add_note_h": 3,
72951 "help.notes.update_note_h": 3,
72952 "help.notes.save_note_h": 3,
72953 "help.imagery.sources_h": 3,
72954 "help.imagery.offsets_h": 3,
72955 "help.streetlevel.using_h": 3,
72956 "help.gps.using_h": 3,
72957 "help.qa.tools_h": 3,
72958 "help.qa.issues_h": 3
72960 var docs = docKeys.map(function(key) {
72961 var helpkey = "help." + key[0];
72962 var helpPaneReplacements = { version: context.version };
72963 var text2 = key[1].reduce(function(all, part) {
72964 var subkey = helpkey + "." + part;
72965 var depth = headings[subkey];
72966 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
72967 return all + hhh + helpHtml(subkey, helpPaneReplacements) + "\n\n";
72970 title: _t.html(helpkey + ".title"),
72971 content: marked(text2.trim()).replace(/<code>/g, "<kbd>").replace(/<\/code>/g, "</kbd>")
72974 var helpPane = uiPane("help", context).key(_t("help.key")).label(_t.append("help.title")).description(_t.append("help.title")).iconName("iD-icon-help");
72975 helpPane.renderContent = function(content) {
72976 function clickHelp(d2, i3) {
72977 var rtl = _mainLocalizer.textDirection() === "rtl";
72978 content.property("scrollTop", 0);
72979 helpPane.selection().select(".pane-heading h2").html(d2.title);
72980 body.html(d2.content);
72981 body.selectAll("a").attr("target", "_blank");
72982 menuItems.classed("selected", function(m2) {
72983 return m2.title === d2.title;
72987 nav.call(drawNext).call(drawPrevious);
72989 nav.call(drawPrevious).call(drawNext);
72991 function drawNext(selection2) {
72992 if (i3 < docs.length - 1) {
72993 var nextLink = selection2.append("a").attr("href", "#").attr("class", "next").on("click", function(d3_event) {
72994 d3_event.preventDefault();
72995 clickHelp(docs[i3 + 1], i3 + 1);
72997 nextLink.append("span").html(docs[i3 + 1].title).call(svgIcon(rtl ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
73000 function drawPrevious(selection2) {
73002 var prevLink = selection2.append("a").attr("href", "#").attr("class", "previous").on("click", function(d3_event) {
73003 d3_event.preventDefault();
73004 clickHelp(docs[i3 - 1], i3 - 1);
73006 prevLink.call(svgIcon(rtl ? "#iD-icon-forward" : "#iD-icon-backward", "inline")).append("span").html(docs[i3 - 1].title);
73010 function clickWalkthrough(d3_event) {
73011 d3_event.preventDefault();
73012 if (context.inIntro())
73014 context.container().call(uiIntro(context));
73015 context.ui().togglePanes();
73017 function clickShortcuts(d3_event) {
73018 d3_event.preventDefault();
73019 context.container().call(context.ui().shortcuts, true);
73021 var toc = content.append("ul").attr("class", "toc");
73022 var menuItems = toc.selectAll("li").data(docs).enter().append("li").append("a").attr("role", "button").attr("href", "#").html(function(d2) {
73024 }).on("click", function(d3_event, d2) {
73025 d3_event.preventDefault();
73026 clickHelp(d2, docs.indexOf(d2));
73028 var shortcuts = toc.append("li").attr("class", "shortcuts").call(
73029 uiTooltip().title(() => _t.append("shortcuts.tooltip")).keys(["?"]).placement("top")
73030 ).append("a").attr("href", "#").on("click", clickShortcuts);
73031 shortcuts.append("div").call(_t.append("shortcuts.title"));
73032 var walkthrough = toc.append("li").attr("class", "walkthrough").append("a").attr("href", "#").on("click", clickWalkthrough);
73033 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
73034 walkthrough.append("div").call(_t.append("splash.walkthrough"));
73035 var helpContent = content.append("div").attr("class", "left-content");
73036 var body = helpContent.append("div").attr("class", "body");
73037 var nav = helpContent.append("div").attr("class", "nav");
73038 clickHelp(docs[0], 0);
73043 // modules/ui/sections/validation_issues.js
73044 function uiSectionValidationIssues(id2, severity, context) {
73046 var section = uiSection(id2, context).label(function() {
73049 var issueCountText = _issues.length > 1e3 ? "1000+" : String(_issues.length);
73050 return _t.append("inspector.title_count", { title: _t("issues." + severity + "s.list_title"), count: issueCountText });
73051 }).disclosureContent(renderDisclosureContent).shouldDisplay(function() {
73052 return _issues && _issues.length;
73054 function getOptions() {
73056 what: corePreferences("validate-what") || "edited",
73057 where: corePreferences("validate-where") || "all"
73060 function reloadIssues() {
73061 _issues = context.validator().getIssuesBySeverity(getOptions())[severity];
73063 function renderDisclosureContent(selection2) {
73064 var center = context.map().center();
73065 var graph = context.graph();
73066 var issues = _issues.map(function withDistance(issue) {
73067 var extent = issue.extent(graph);
73068 var dist = extent ? geoSphericalDistance(center, extent.center()) : 0;
73069 return Object.assign(issue, { dist });
73070 }).sort(function byDistance(a2, b2) {
73071 return a2.dist - b2.dist;
73073 issues = issues.slice(0, 1e3);
73074 selection2.call(drawIssuesList, issues);
73076 function drawIssuesList(selection2, issues) {
73077 var list = selection2.selectAll(".issues-list").data([0]);
73078 list = list.enter().append("ul").attr("class", "layer-list issues-list " + severity + "s-list").merge(list);
73079 var items = list.selectAll("li").data(issues, function(d2) {
73082 items.exit().remove();
73083 var itemsEnter = items.enter().append("li").attr("class", function(d2) {
73084 return "issue severity-" + d2.severity;
73086 var labelsEnter = itemsEnter.append("button").attr("class", "issue-label").on("click", function(d3_event, d2) {
73087 context.validator().focusIssue(d2);
73088 }).on("mouseover", function(d3_event, d2) {
73089 utilHighlightEntities(d2.entityIds, true, context);
73090 }).on("mouseout", function(d3_event, d2) {
73091 utilHighlightEntities(d2.entityIds, false, context);
73093 var textEnter = labelsEnter.append("span").attr("class", "issue-text");
73094 textEnter.append("span").attr("class", "issue-icon").each(function(d2) {
73095 var iconName = "#iD-icon-" + (d2.severity === "warning" ? "alert" : "error");
73096 select_default2(this).call(svgIcon(iconName));
73098 textEnter.append("span").attr("class", "issue-message");
73099 items = items.merge(itemsEnter).order();
73100 items.selectAll(".issue-message").text("").each(function(d2) {
73101 return d2.message(context)(select_default2(this));
73104 context.validator().on("validated.uiSectionValidationIssues" + id2, function() {
73105 window.requestIdleCallback(function() {
73107 section.reRender();
73111 "move.uiSectionValidationIssues" + id2,
73112 debounce_default(function() {
73113 window.requestIdleCallback(function() {
73114 if (getOptions().where === "visible") {
73117 section.reRender();
73124 // modules/ui/sections/validation_options.js
73125 function uiSectionValidationOptions(context) {
73126 var section = uiSection("issues-options", context).content(renderContent);
73127 function renderContent(selection2) {
73128 var container = selection2.selectAll(".issues-options-container").data([0]);
73129 container = container.enter().append("div").attr("class", "issues-options-container").merge(container);
73131 { key: "what", values: ["edited", "all"] },
73132 { key: "where", values: ["visible", "all"] }
73134 var options2 = container.selectAll(".issues-option").data(data, function(d2) {
73137 var optionsEnter = options2.enter().append("div").attr("class", function(d2) {
73138 return "issues-option issues-option-" + d2.key;
73140 optionsEnter.append("div").attr("class", "issues-option-title").html(function(d2) {
73141 return _t.html("issues.options." + d2.key + ".title");
73143 var valuesEnter = optionsEnter.selectAll("label").data(function(d2) {
73144 return d2.values.map(function(val) {
73145 return { value: val, key: d2.key };
73147 }).enter().append("label");
73148 valuesEnter.append("input").attr("type", "radio").attr("name", function(d2) {
73149 return "issues-option-" + d2.key;
73150 }).attr("value", function(d2) {
73152 }).property("checked", function(d2) {
73153 return getOptions()[d2.key] === d2.value;
73154 }).on("change", function(d3_event, d2) {
73155 updateOptionValue(d3_event, d2.key, d2.value);
73157 valuesEnter.append("span").html(function(d2) {
73158 return _t.html("issues.options." + d2.key + "." + d2.value);
73161 function getOptions() {
73163 what: corePreferences("validate-what") || "edited",
73165 where: corePreferences("validate-where") || "all"
73166 // 'all', 'visible'
73169 function updateOptionValue(d3_event, d2, val) {
73170 if (!val && d3_event && d3_event.target) {
73171 val = d3_event.target.value;
73173 corePreferences("validate-" + d2, val);
73174 context.validator().validate();
73179 // modules/ui/sections/validation_rules.js
73180 function uiSectionValidationRules(context) {
73182 var MAXSQUARE = 20;
73183 var DEFAULTSQUARE = 5;
73184 var section = uiSection("issues-rules", context).disclosureContent(renderDisclosureContent).label(() => _t.append("issues.rules.title"));
73185 var _ruleKeys = context.validator().getRuleKeys().filter(function(key) {
73186 return key !== "maprules";
73187 }).sort(function(key1, key2) {
73188 return _t("issues." + key1 + ".title") < _t("issues." + key2 + ".title") ? -1 : 1;
73190 function renderDisclosureContent(selection2) {
73191 var container = selection2.selectAll(".issues-rulelist-container").data([0]);
73192 var containerEnter = container.enter().append("div").attr("class", "issues-rulelist-container");
73193 containerEnter.append("ul").attr("class", "layer-list issue-rules-list");
73194 var ruleLinks = containerEnter.append("div").attr("class", "issue-rules-links section-footer");
73195 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
73196 d3_event.preventDefault();
73197 context.validator().disableRules(_ruleKeys);
73199 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
73200 d3_event.preventDefault();
73201 context.validator().disableRules([]);
73203 container = container.merge(containerEnter);
73204 container.selectAll(".issue-rules-list").call(drawListItems, _ruleKeys, "checkbox", "rule", toggleRule, isRuleEnabled);
73206 function drawListItems(selection2, data, type2, name, change, active) {
73207 var items = selection2.selectAll("li").data(data);
73208 items.exit().remove();
73209 var enter = items.enter().append("li");
73210 if (name === "rule") {
73212 uiTooltip().title(function(d2) {
73213 return _t.append("issues." + d2 + ".tip");
73214 }).placement("top")
73217 var label = enter.append("label");
73218 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73219 label.append("span").html(function(d2) {
73221 if (d2 === "unsquare_way") {
73222 params.val = { html: '<span class="square-degrees"></span>' };
73224 return _t.html("issues." + d2 + ".title", params);
73226 items = items.merge(enter);
73227 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
73228 var degStr = corePreferences("validate-square-degrees");
73229 if (degStr === null) {
73230 degStr = DEFAULTSQUARE.toString();
73232 var span = items.selectAll(".square-degrees");
73233 var input = span.selectAll(".square-degrees-input").data([0]);
73234 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) {
73235 d3_event.preventDefault();
73236 d3_event.stopPropagation();
73238 }).on("keyup", function(d3_event) {
73239 if (d3_event.keyCode === 13) {
73243 }).on("blur", changeSquare).merge(input).property("value", degStr);
73245 function changeSquare() {
73246 var input = select_default2(this);
73247 var degStr = utilGetSetValue(input).trim();
73248 var degNum = Number(degStr);
73249 if (!isFinite(degNum)) {
73250 degNum = DEFAULTSQUARE;
73251 } else if (degNum > MAXSQUARE) {
73252 degNum = MAXSQUARE;
73253 } else if (degNum < MINSQUARE) {
73254 degNum = MINSQUARE;
73256 degNum = Math.round(degNum * 10) / 10;
73257 degStr = degNum.toString();
73258 input.property("value", degStr);
73259 corePreferences("validate-square-degrees", degStr);
73260 context.validator().revalidateUnsquare();
73262 function isRuleEnabled(d2) {
73263 return context.validator().isRuleEnabled(d2);
73265 function toggleRule(d3_event, d2) {
73266 context.validator().toggleRule(d2);
73268 context.validator().on("validated.uiSectionValidationRules", function() {
73269 window.requestIdleCallback(section.reRender);
73274 // modules/ui/sections/validation_status.js
73275 function uiSectionValidationStatus(context) {
73276 var section = uiSection("issues-status", context).content(renderContent).shouldDisplay(function() {
73277 var issues = context.validator().getIssues(getOptions());
73278 return issues.length === 0;
73280 function getOptions() {
73282 what: corePreferences("validate-what") || "edited",
73283 where: corePreferences("validate-where") || "all"
73286 function renderContent(selection2) {
73287 var box = selection2.selectAll(".box").data([0]);
73288 var boxEnter = box.enter().append("div").attr("class", "box");
73289 boxEnter.append("div").call(svgIcon("#iD-icon-apply", "pre-text"));
73290 var noIssuesMessage = boxEnter.append("span");
73291 noIssuesMessage.append("strong").attr("class", "message");
73292 noIssuesMessage.append("br");
73293 noIssuesMessage.append("span").attr("class", "details");
73294 renderIgnoredIssuesReset(selection2);
73295 setNoIssuesText(selection2);
73297 function renderIgnoredIssuesReset(selection2) {
73298 var ignoredIssues = context.validator().getIssues({ what: "all", where: "all", includeDisabledRules: true, includeIgnored: "only" });
73299 var resetIgnored = selection2.selectAll(".reset-ignored").data(ignoredIssues.length ? [0] : []);
73300 resetIgnored.exit().remove();
73301 var resetIgnoredEnter = resetIgnored.enter().append("div").attr("class", "reset-ignored section-footer");
73302 resetIgnoredEnter.append("a").attr("href", "#");
73303 resetIgnored = resetIgnored.merge(resetIgnoredEnter);
73304 resetIgnored.select("a").html(_t.html("inspector.title_count", { title: { html: _t.html("issues.reset_ignored") }, count: ignoredIssues.length }));
73305 resetIgnored.on("click", function(d3_event) {
73306 d3_event.preventDefault();
73307 context.validator().resetIgnoredIssues();
73310 function setNoIssuesText(selection2) {
73311 var opts = getOptions();
73312 function checkForHiddenIssues(cases) {
73313 for (var type2 in cases) {
73314 var hiddenOpts = cases[type2];
73315 var hiddenIssues = context.validator().getIssues(hiddenOpts);
73316 if (hiddenIssues.length) {
73317 selection2.select(".box .details").html("").call(_t.append(
73318 "issues.no_issues.hidden_issues." + type2,
73319 { count: hiddenIssues.length.toString() }
73324 selection2.select(".box .details").html("").call(_t.append("issues.no_issues.hidden_issues.none"));
73327 if (opts.what === "edited" && opts.where === "visible") {
73328 messageType = "edits_in_view";
73329 checkForHiddenIssues({
73330 elsewhere: { what: "edited", where: "all" },
73331 everything_else: { what: "all", where: "visible" },
73332 disabled_rules: { what: "edited", where: "visible", includeDisabledRules: "only" },
73333 everything_else_elsewhere: { what: "all", where: "all" },
73334 disabled_rules_elsewhere: { what: "edited", where: "all", includeDisabledRules: "only" },
73335 ignored_issues: { what: "edited", where: "visible", includeIgnored: "only" },
73336 ignored_issues_elsewhere: { what: "edited", where: "all", includeIgnored: "only" }
73338 } else if (opts.what === "edited" && opts.where === "all") {
73339 messageType = "edits";
73340 checkForHiddenIssues({
73341 everything_else: { what: "all", where: "all" },
73342 disabled_rules: { what: "edited", where: "all", includeDisabledRules: "only" },
73343 ignored_issues: { what: "edited", where: "all", includeIgnored: "only" }
73345 } else if (opts.what === "all" && opts.where === "visible") {
73346 messageType = "everything_in_view";
73347 checkForHiddenIssues({
73348 elsewhere: { what: "all", where: "all" },
73349 disabled_rules: { what: "all", where: "visible", includeDisabledRules: "only" },
73350 disabled_rules_elsewhere: { what: "all", where: "all", includeDisabledRules: "only" },
73351 ignored_issues: { what: "all", where: "visible", includeIgnored: "only" },
73352 ignored_issues_elsewhere: { what: "all", where: "all", includeIgnored: "only" }
73354 } else if (opts.what === "all" && opts.where === "all") {
73355 messageType = "everything";
73356 checkForHiddenIssues({
73357 disabled_rules: { what: "all", where: "all", includeDisabledRules: "only" },
73358 ignored_issues: { what: "all", where: "all", includeIgnored: "only" }
73361 if (opts.what === "edited" && context.history().difference().summary().length === 0) {
73362 messageType = "no_edits";
73364 selection2.select(".box .message").html("").call(_t.append("issues.no_issues.message." + messageType));
73366 context.validator().on("validated.uiSectionValidationStatus", function() {
73367 window.requestIdleCallback(section.reRender);
73370 "move.uiSectionValidationStatus",
73371 debounce_default(function() {
73372 window.requestIdleCallback(section.reRender);
73378 // modules/ui/panes/issues.js
73379 function uiPaneIssues(context) {
73380 var issuesPane = uiPane("issues", context).key(_t("issues.key")).label(_t.append("issues.title")).description(_t.append("issues.title")).iconName("iD-icon-alert").sections([
73381 uiSectionValidationOptions(context),
73382 uiSectionValidationStatus(context),
73383 uiSectionValidationIssues("issues-errors", "error", context),
73384 uiSectionValidationIssues("issues-warnings", "warning", context),
73385 uiSectionValidationRules(context)
73390 // modules/ui/settings/custom_data.js
73391 function uiSettingsCustomData(context) {
73392 var dispatch14 = dispatch_default("change");
73393 function render(selection2) {
73394 var dataLayer = context.layers().layer("data");
73395 var _origSettings = {
73396 fileList: dataLayer && dataLayer.fileList() || null,
73397 url: corePreferences("settings-custom-data-url")
73399 var _currSettings = {
73400 fileList: dataLayer && dataLayer.fileList() || null
73401 // url: prefs('settings-custom-data-url')
73403 var modal = uiConfirm(selection2).okButton();
73404 modal.classed("settings-modal settings-custom-data", true);
73405 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_data.header"));
73406 var textSection = modal.select(".modal-section.message-text");
73407 textSection.append("pre").attr("class", "instructions-file").call(_t.append("settings.custom_data.file.instructions"));
73408 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) {
73409 var files = d3_event.target.files;
73410 if (files && files.length) {
73411 _currSettings.url = "";
73412 textSection.select(".field-url").property("value", "");
73413 _currSettings.fileList = files;
73415 _currSettings.fileList = null;
73418 textSection.append("h4").call(_t.append("settings.custom_data.or"));
73419 textSection.append("pre").attr("class", "instructions-url").call(_t.append("settings.custom_data.url.instructions"));
73420 textSection.append("textarea").attr("class", "field-url").attr("placeholder", _t("settings.custom_data.url.placeholder")).call(utilNoAuto).property("value", _currSettings.url);
73421 var buttonSection = modal.select(".modal-section.buttons");
73422 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
73423 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
73424 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
73425 function isSaveDisabled() {
73428 function clickCancel() {
73429 textSection.select(".field-url").property("value", _origSettings.url);
73430 corePreferences("settings-custom-data-url", _origSettings.url);
73434 function clickSave() {
73435 _currSettings.url = textSection.select(".field-url").property("value").trim();
73436 if (_currSettings.url) {
73437 _currSettings.fileList = null;
73439 if (_currSettings.fileList) {
73440 _currSettings.url = "";
73442 corePreferences("settings-custom-data-url", _currSettings.url);
73445 dispatch14.call("change", this, _currSettings);
73448 return utilRebind(render, dispatch14, "on");
73451 // modules/ui/sections/data_layers.js
73452 function uiSectionDataLayers(context) {
73453 var settingsCustomData = uiSettingsCustomData(context).on("change", customChanged);
73454 var layers = context.layers();
73455 var section = uiSection("data-layers", context).label(() => _t.append("map_data.data_layers")).disclosureContent(renderDisclosureContent);
73456 function renderDisclosureContent(selection2) {
73457 var container = selection2.selectAll(".data-layer-container").data([0]);
73458 container.enter().append("div").attr("class", "data-layer-container").merge(container).call(drawOsmItems).call(drawQAItems).call(drawCustomDataItems).call(drawVectorItems).call(drawPanelItems);
73460 function showsLayer(which) {
73461 var layer = layers.layer(which);
73463 return layer.enabled();
73467 function setLayer(which, enabled) {
73468 var mode = context.mode();
73469 if (mode && /^draw/.test(mode.id))
73471 var layer = layers.layer(which);
73473 layer.enabled(enabled);
73474 if (!enabled && (which === "osm" || which === "notes")) {
73475 context.enter(modeBrowse(context));
73479 function toggleLayer(which) {
73480 setLayer(which, !showsLayer(which));
73482 function drawOsmItems(selection2) {
73483 var osmKeys = ["osm", "notes"];
73484 var osmLayers = layers.all().filter(function(obj) {
73485 return osmKeys.indexOf(obj.id) !== -1;
73487 var ul = selection2.selectAll(".layer-list-osm").data([0]);
73488 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-osm").merge(ul);
73489 var li = ul.selectAll(".list-item").data(osmLayers);
73490 li.exit().remove();
73491 var liEnter = li.enter().append("li").attr("class", function(d2) {
73492 return "list-item list-item-" + d2.id;
73494 var labelEnter = liEnter.append("label").each(function(d2) {
73495 if (d2.id === "osm") {
73496 select_default2(this).call(
73497 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).keys([uiCmd("\u2325" + _t("area_fill.wireframe.key"))]).placement("bottom")
73500 select_default2(this).call(
73501 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
73505 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73506 toggleLayer(d2.id);
73508 labelEnter.append("span").html(function(d2) {
73509 return _t.html("map_data.layers." + d2.id + ".title");
73511 li.merge(liEnter).classed("active", function(d2) {
73512 return d2.layer.enabled();
73513 }).selectAll("input").property("checked", function(d2) {
73514 return d2.layer.enabled();
73517 function drawQAItems(selection2) {
73518 var qaKeys = ["keepRight", "improveOSM", "osmose"];
73519 var qaLayers = layers.all().filter(function(obj) {
73520 return qaKeys.indexOf(obj.id) !== -1;
73522 var ul = selection2.selectAll(".layer-list-qa").data([0]);
73523 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-qa").merge(ul);
73524 var li = ul.selectAll(".list-item").data(qaLayers);
73525 li.exit().remove();
73526 var liEnter = li.enter().append("li").attr("class", function(d2) {
73527 return "list-item list-item-" + d2.id;
73529 var labelEnter = liEnter.append("label").each(function(d2) {
73530 select_default2(this).call(
73531 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
73534 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73535 toggleLayer(d2.id);
73537 labelEnter.append("span").each(function(d2) {
73538 _t.append("map_data.layers." + d2.id + ".title")(select_default2(this));
73540 li.merge(liEnter).classed("active", function(d2) {
73541 return d2.layer.enabled();
73542 }).selectAll("input").property("checked", function(d2) {
73543 return d2.layer.enabled();
73546 function drawVectorItems(selection2) {
73547 var dataLayer = layers.layer("data");
73550 name: "Detroit Neighborhoods/Parks",
73551 src: "neighborhoods-parks",
73552 tooltip: "Neighborhood boundaries and parks as compiled by City of Detroit in concert with community groups.",
73553 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"
73556 name: "Detroit Composite POIs",
73557 src: "composite-poi",
73558 tooltip: "Fire Inspections, Business Licenses, and other public location data collated from the City of Detroit.",
73559 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"
73562 name: "Detroit All-The-Places POIs",
73563 src: "alltheplaces-poi",
73564 tooltip: "Public domain business location data created by web scrapers.",
73565 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"
73568 var detroit = geoExtent([-83.5, 42.1], [-82.8, 42.5]);
73569 var showVectorItems = context.map().zoom() > 9 && detroit.contains(context.map().center());
73570 var container = selection2.selectAll(".vectortile-container").data(showVectorItems ? [0] : []);
73571 container.exit().remove();
73572 var containerEnter = container.enter().append("div").attr("class", "vectortile-container");
73573 containerEnter.append("h4").attr("class", "vectortile-header").text("Detroit Vector Tiles (Beta)");
73574 containerEnter.append("ul").attr("class", "layer-list layer-list-vectortile");
73575 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");
73576 container = container.merge(containerEnter);
73577 var ul = container.selectAll(".layer-list-vectortile");
73578 var li = ul.selectAll(".list-item").data(vtData);
73579 li.exit().remove();
73580 var liEnter = li.enter().append("li").attr("class", function(d2) {
73581 return "list-item list-item-" + d2.src;
73583 var labelEnter = liEnter.append("label").each(function(d2) {
73584 select_default2(this).call(
73585 uiTooltip().title(d2.tooltip).placement("top")
73588 labelEnter.append("input").attr("type", "radio").attr("name", "vectortile").on("change", selectVTLayer);
73589 labelEnter.append("span").text(function(d2) {
73592 li.merge(liEnter).classed("active", isVTLayerSelected).selectAll("input").property("checked", isVTLayerSelected);
73593 function isVTLayerSelected(d2) {
73594 return dataLayer && dataLayer.template() === d2.template;
73596 function selectVTLayer(d3_event, d2) {
73597 corePreferences("settings-custom-data-url", d2.template);
73599 dataLayer.template(d2.template, d2.src);
73600 dataLayer.enabled(true);
73604 function drawCustomDataItems(selection2) {
73605 var dataLayer = layers.layer("data");
73606 var hasData = dataLayer && dataLayer.hasData();
73607 var showsData = hasData && dataLayer.enabled();
73608 var ul = selection2.selectAll(".layer-list-data").data(dataLayer ? [0] : []);
73609 ul.exit().remove();
73610 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-data");
73611 var liEnter = ulEnter.append("li").attr("class", "list-item-data");
73612 var labelEnter = liEnter.append("label").call(
73613 uiTooltip().title(() => _t.append("map_data.layers.custom.tooltip")).placement("top")
73615 labelEnter.append("input").attr("type", "checkbox").on("change", function() {
73616 toggleLayer("data");
73618 labelEnter.append("span").call(_t.append("map_data.layers.custom.title"));
73619 liEnter.append("button").attr("class", "open-data-options").call(
73620 uiTooltip().title(() => _t.append("settings.custom_data.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73621 ).on("click", function(d3_event) {
73622 d3_event.preventDefault();
73624 }).call(svgIcon("#iD-icon-more"));
73625 liEnter.append("button").attr("class", "zoom-to-data").call(
73626 uiTooltip().title(() => _t.append("map_data.layers.custom.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73627 ).on("click", function(d3_event) {
73628 if (select_default2(this).classed("disabled"))
73630 d3_event.preventDefault();
73631 d3_event.stopPropagation();
73632 dataLayer.fitZoom();
73633 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
73634 ul = ul.merge(ulEnter);
73635 ul.selectAll(".list-item-data").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
73636 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
73638 function editCustom() {
73639 context.container().call(settingsCustomData);
73641 function customChanged(d2) {
73642 var dataLayer = layers.layer("data");
73643 if (d2 && d2.url) {
73644 dataLayer.url(d2.url);
73645 } else if (d2 && d2.fileList) {
73646 dataLayer.fileList(d2.fileList);
73649 function drawPanelItems(selection2) {
73650 var panelsListEnter = selection2.selectAll(".md-extras-list").data([0]).enter().append("ul").attr("class", "layer-list md-extras-list");
73651 var historyPanelLabelEnter = panelsListEnter.append("li").attr("class", "history-panel-toggle-item").append("label").call(
73652 uiTooltip().title(() => _t.append("map_data.history_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.history.key"))]).placement("top")
73654 historyPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
73655 d3_event.preventDefault();
73656 context.ui().info.toggle("history");
73658 historyPanelLabelEnter.append("span").call(_t.append("map_data.history_panel.title"));
73659 var measurementPanelLabelEnter = panelsListEnter.append("li").attr("class", "measurement-panel-toggle-item").append("label").call(
73660 uiTooltip().title(() => _t.append("map_data.measurement_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.measurement.key"))]).placement("top")
73662 measurementPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
73663 d3_event.preventDefault();
73664 context.ui().info.toggle("measurement");
73666 measurementPanelLabelEnter.append("span").call(_t.append("map_data.measurement_panel.title"));
73668 context.layers().on("change.uiSectionDataLayers", section.reRender);
73670 "move.uiSectionDataLayers",
73671 debounce_default(function() {
73672 window.requestIdleCallback(section.reRender);
73678 // modules/ui/sections/map_features.js
73679 function uiSectionMapFeatures(context) {
73680 var _features = context.features().keys();
73681 var section = uiSection("map-features", context).label(() => _t.append("map_data.map_features")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73682 function renderDisclosureContent(selection2) {
73683 var container = selection2.selectAll(".layer-feature-list-container").data([0]);
73684 var containerEnter = container.enter().append("div").attr("class", "layer-feature-list-container");
73685 containerEnter.append("ul").attr("class", "layer-list layer-feature-list");
73686 var footer = containerEnter.append("div").attr("class", "feature-list-links section-footer");
73687 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
73688 d3_event.preventDefault();
73689 context.features().disableAll();
73691 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
73692 d3_event.preventDefault();
73693 context.features().enableAll();
73695 container = container.merge(containerEnter);
73696 container.selectAll(".layer-feature-list").call(drawListItems, _features, "checkbox", "feature", clickFeature, showsFeature);
73698 function drawListItems(selection2, data, type2, name, change, active) {
73699 var items = selection2.selectAll("li").data(data);
73700 items.exit().remove();
73701 var enter = items.enter().append("li").call(
73702 uiTooltip().title(function(d2) {
73703 var tip = _t.append(name + "." + d2 + ".tooltip");
73704 if (autoHiddenFeature(d2)) {
73705 var msg = showsLayer("osm") ? _t.append("map_data.autohidden") : _t.append("map_data.osmhidden");
73706 return (selection3) => {
73707 selection3.call(tip);
73708 selection3.append("div").call(msg);
73712 }).placement("top")
73714 var label = enter.append("label");
73715 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73716 label.append("span").html(function(d2) {
73717 return _t.html(name + "." + d2 + ".description");
73719 items = items.merge(enter);
73720 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", autoHiddenFeature);
73722 function autoHiddenFeature(d2) {
73723 return context.features().autoHidden(d2);
73725 function showsFeature(d2) {
73726 return context.features().enabled(d2);
73728 function clickFeature(d3_event, d2) {
73729 context.features().toggle(d2);
73731 function showsLayer(id2) {
73732 var layer = context.layers().layer(id2);
73733 return layer && layer.enabled();
73735 context.features().on("change.map_features", section.reRender);
73739 // modules/ui/sections/map_style_options.js
73740 function uiSectionMapStyleOptions(context) {
73741 var section = uiSection("fill-area", context).label(() => _t.append("map_data.style_options")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73742 function renderDisclosureContent(selection2) {
73743 var container = selection2.selectAll(".layer-fill-list").data([0]);
73744 container.enter().append("ul").attr("class", "layer-list layer-fill-list").merge(container).call(drawListItems, context.map().areaFillOptions, "radio", "area_fill", setFill, isActiveFill);
73745 var container2 = selection2.selectAll(".layer-visual-diff-list").data([0]);
73746 container2.enter().append("ul").attr("class", "layer-list layer-visual-diff-list").merge(container2).call(drawListItems, ["highlight_edits"], "checkbox", "visual_diff", toggleHighlightEdited, function() {
73747 return context.surface().classed("highlight-edited");
73750 function drawListItems(selection2, data, type2, name, change, active) {
73751 var items = selection2.selectAll("li").data(data);
73752 items.exit().remove();
73753 var enter = items.enter().append("li").call(
73754 uiTooltip().title(function(d2) {
73755 return _t.append(name + "." + d2 + ".tooltip");
73756 }).keys(function(d2) {
73757 var key = d2 === "wireframe" ? _t("area_fill.wireframe.key") : null;
73758 if (d2 === "highlight_edits")
73759 key = _t("map_data.highlight_edits.key");
73760 return key ? [key] : null;
73761 }).placement("top")
73763 var label = enter.append("label");
73764 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73765 label.append("span").html(function(d2) {
73766 return _t.html(name + "." + d2 + ".description");
73768 items = items.merge(enter);
73769 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
73771 function isActiveFill(d2) {
73772 return context.map().activeAreaFill() === d2;
73774 function toggleHighlightEdited(d3_event) {
73775 d3_event.preventDefault();
73776 context.map().toggleHighlightEdited();
73778 function setFill(d3_event, d2) {
73779 context.map().activeAreaFill(d2);
73781 context.map().on("changeHighlighting.ui_style, changeAreaFill.ui_style", section.reRender);
73785 // modules/ui/settings/local_photos.js
73786 function uiSettingsLocalPhotos(context) {
73787 var dispatch14 = dispatch_default("change");
73788 var photoLayer = context.layers().layer("local-photos");
73790 function render(selection2) {
73791 modal = uiConfirm(selection2).okButton();
73792 modal.classed("settings-modal settings-local-photos", true);
73793 modal.select(".modal-section.header").append("h3").call(_t.append("local_photos.header"));
73794 modal.select(".modal-section.message-text").append("div").classed("local-photos", true);
73795 var instructionsSection = modal.select(".modal-section.message-text .local-photos").append("div").classed("instructions", true);
73796 instructionsSection.append("p").classed("instructions-local-photos", true).call(_t.append("local_photos.file.instructions"));
73797 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) {
73798 var files = d3_event.target.files;
73799 if (files && files.length) {
73800 photoList.select("ul").append("li").classed("placeholder", true).append("div");
73801 dispatch14.call("change", this, files);
73803 d3_event.target.value = null;
73805 instructionsSection.append("label").attr("for", "local-photo-files").classed("button", true).call(_t.append("local_photos.file.label"));
73806 const photoList = modal.select(".modal-section.message-text .local-photos").append("div").append("div").classed("list-local-photos", true);
73807 photoList.append("ul");
73808 updatePhotoList(photoList.select("ul"));
73809 context.layers().on("change", () => updatePhotoList(photoList.select("ul")));
73811 function updatePhotoList(container) {
73812 function locationUnavailable(d2) {
73813 return !(isArray_default(d2.loc) && isNumber_default(d2.loc[0]) && isNumber_default(d2.loc[1]));
73815 container.selectAll("li.placeholder").remove();
73816 let selection2 = container.selectAll("li").data(photoLayer.getPhotos() ?? [], (d2) => d2.id);
73817 selection2.exit().remove();
73818 const selectionEnter = selection2.enter().append("li");
73819 selectionEnter.append("span").classed("filename", true);
73820 selectionEnter.append("button").classed("form-field-button zoom-to-data", true).attr("title", _t("local_photos.zoom_single")).call(svgIcon("#iD-icon-framed-dot"));
73821 selectionEnter.append("button").classed("form-field-button no-geolocation", true).call(svgIcon("#iD-icon-alert")).call(
73822 uiTooltip().title(() => _t.append("local_photos.no_geolocation.tooltip")).placement("left")
73824 selectionEnter.append("button").classed("form-field-button remove", true).attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
73825 selection2 = selection2.merge(selectionEnter);
73826 selection2.classed("invalid", locationUnavailable);
73827 selection2.select("span.filename").text((d2) => d2.name).attr("title", (d2) => d2.name);
73828 selection2.select("span.filename").on("click", (d3_event, d2) => {
73829 photoLayer.openPhoto(d3_event, d2, false);
73831 selection2.select("button.zoom-to-data").on("click", (d3_event, d2) => {
73832 photoLayer.openPhoto(d3_event, d2, true);
73834 selection2.select("button.remove").on("click", (d3_event, d2) => {
73835 photoLayer.removePhoto(d2.id);
73836 updatePhotoList(container);
73839 return utilRebind(render, dispatch14, "on");
73842 // modules/ui/sections/photo_overlays.js
73843 function uiSectionPhotoOverlays(context) {
73844 var settingsLocalPhotos = uiSettingsLocalPhotos(context).on("change", localPhotosChanged);
73845 var layers = context.layers();
73846 var section = uiSection("photo-overlays", context).label(() => _t.append("photo_overlays.title")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73847 function renderDisclosureContent(selection2) {
73848 var container = selection2.selectAll(".photo-overlay-container").data([0]);
73849 container.enter().append("div").attr("class", "photo-overlay-container").merge(container).call(drawPhotoItems).call(drawPhotoTypeItems).call(drawDateFilter).call(drawUsernameFilter).call(drawLocalPhotos);
73851 function drawPhotoItems(selection2) {
73852 var photoKeys = context.photos().overlayLayerIDs();
73853 var photoLayers = layers.all().filter(function(obj) {
73854 return photoKeys.indexOf(obj.id) !== -1;
73856 var data = photoLayers.filter(function(obj) {
73857 if (!obj.layer.supported())
73859 if (layerEnabled(obj))
73861 if (typeof obj.layer.validHere === "function") {
73862 return obj.layer.validHere(context.map().extent(), context.map().zoom());
73866 function layerSupported(d2) {
73867 return d2.layer && d2.layer.supported();
73869 function layerEnabled(d2) {
73870 return layerSupported(d2) && d2.layer.enabled();
73872 function layerRendered(d2) {
73873 return d2.layer.rendered?.(context.map().zoom()) ?? true;
73875 var ul = selection2.selectAll(".layer-list-photos").data([0]);
73876 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photos").merge(ul);
73877 var li = ul.selectAll(".list-item-photos").data(data);
73878 li.exit().remove();
73879 var liEnter = li.enter().append("li").attr("class", function(d2) {
73880 var classes = "list-item-photos list-item-" + d2.id;
73881 if (d2.id === "mapillary-signs" || d2.id === "mapillary-map-features") {
73882 classes += " indented";
73886 var labelEnter = liEnter.append("label").each(function(d2) {
73888 if (d2.id === "mapillary-signs")
73889 titleID = "mapillary.signs.tooltip";
73890 else if (d2.id === "mapillary")
73891 titleID = "mapillary_images.tooltip";
73892 else if (d2.id === "kartaview")
73893 titleID = "kartaview_images.tooltip";
73895 titleID = d2.id.replace(/-/g, "_") + ".tooltip";
73896 select_default2(this).call(
73897 uiTooltip().title(() => {
73898 if (!layerRendered(d2)) {
73899 return _t.append("street_side.minzoom_tooltip");
73901 return _t.append(titleID);
73903 }).placement("top")
73906 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73907 toggleLayer(d2.id);
73909 labelEnter.append("span").html(function(d2) {
73911 if (id2 === "mapillary-signs")
73912 id2 = "photo_overlays.traffic_signs";
73913 return _t.html(id2.replace(/-/g, "_") + ".title");
73915 li.merge(liEnter).classed("active", layerEnabled).selectAll("input").property("disabled", (d2) => !layerRendered(d2)).property("checked", layerEnabled);
73917 function drawPhotoTypeItems(selection2) {
73918 var data = context.photos().allPhotoTypes();
73919 function typeEnabled(d2) {
73920 return context.photos().showsPhotoType(d2);
73922 var ul = selection2.selectAll(".layer-list-photo-types").data([0]);
73923 ul.exit().remove();
73924 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photo-types").merge(ul);
73925 var li = ul.selectAll(".list-item-photo-types").data(context.photos().shouldFilterByPhotoType() ? data : []);
73926 li.exit().remove();
73927 var liEnter = li.enter().append("li").attr("class", function(d2) {
73928 return "list-item-photo-types list-item-" + d2;
73930 var labelEnter = liEnter.append("label").each(function(d2) {
73931 select_default2(this).call(
73932 uiTooltip().title(() => _t.append("photo_overlays.photo_type." + d2 + ".tooltip")).placement("top")
73935 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73936 context.photos().togglePhotoType(d2);
73938 labelEnter.append("span").html(function(d2) {
73939 return _t.html("photo_overlays.photo_type." + d2 + ".title");
73941 li.merge(liEnter).classed("active", typeEnabled).selectAll("input").property("checked", typeEnabled);
73943 function drawDateFilter(selection2) {
73944 var data = context.photos().dateFilters();
73945 function filterEnabled(d2) {
73946 return context.photos().dateFilterValue(d2);
73948 var ul = selection2.selectAll(".layer-list-date-filter").data([0]);
73949 ul.exit().remove();
73950 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-date-filter").merge(ul);
73951 var li = ul.selectAll(".list-item-date-filter").data(context.photos().shouldFilterByDate() ? data : []);
73952 li.exit().remove();
73953 var liEnter = li.enter().append("li").attr("class", "list-item-date-filter");
73954 var labelEnter = liEnter.append("label").each(function(d2) {
73955 select_default2(this).call(
73956 uiTooltip().title(() => _t.append("photo_overlays.date_filter." + d2 + ".tooltip")).placement("top")
73959 labelEnter.append("span").each(function(d2) {
73960 _t.append("photo_overlays.date_filter." + d2 + ".title")(select_default2(this));
73962 labelEnter.append("input").attr("type", "date").attr("class", "list-item-input").attr("placeholder", _t("units.year_month_day")).call(utilNoAuto).each(function(d2) {
73963 utilGetSetValue(select_default2(this), context.photos().dateFilterValue(d2) || "");
73964 }).on("change", function(d3_event, d2) {
73965 var value = utilGetSetValue(select_default2(this)).trim();
73966 context.photos().setDateFilter(d2, value, true);
73967 li.selectAll("input").each(function(d4) {
73968 utilGetSetValue(select_default2(this), context.photos().dateFilterValue(d4) || "");
73971 li = li.merge(liEnter).classed("active", filterEnabled);
73973 function drawUsernameFilter(selection2) {
73974 function filterEnabled() {
73975 return context.photos().usernames();
73977 var ul = selection2.selectAll(".layer-list-username-filter").data([0]);
73978 ul.exit().remove();
73979 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-username-filter").merge(ul);
73980 var li = ul.selectAll(".list-item-username-filter").data(context.photos().shouldFilterByUsername() ? ["username-filter"] : []);
73981 li.exit().remove();
73982 var liEnter = li.enter().append("li").attr("class", "list-item-username-filter");
73983 var labelEnter = liEnter.append("label").each(function() {
73984 select_default2(this).call(
73985 uiTooltip().title(() => _t.append("photo_overlays.username_filter.tooltip")).placement("top")
73988 labelEnter.append("span").call(_t.append("photo_overlays.username_filter.title"));
73989 labelEnter.append("input").attr("type", "text").attr("class", "list-item-input").call(utilNoAuto).property("value", usernameValue).on("change", function() {
73990 var value = select_default2(this).property("value");
73991 context.photos().setUsernameFilter(value, true);
73992 select_default2(this).property("value", usernameValue);
73994 li.merge(liEnter).classed("active", filterEnabled);
73995 function usernameValue() {
73996 var usernames = context.photos().usernames();
73998 return usernames.join("; ");
74002 function toggleLayer(which) {
74003 setLayer(which, !showsLayer(which));
74005 function showsLayer(which) {
74006 var layer = layers.layer(which);
74008 return layer.enabled();
74012 function setLayer(which, enabled) {
74013 var layer = layers.layer(which);
74015 layer.enabled(enabled);
74018 function drawLocalPhotos(selection2) {
74019 var photoLayer = layers.layer("local-photos");
74020 var hasData = photoLayer && photoLayer.hasData();
74021 var showsData = hasData && photoLayer.enabled();
74022 var ul = selection2.selectAll(".layer-list-local-photos").data(photoLayer ? [0] : []);
74023 ul.exit().remove();
74024 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-local-photos");
74025 var localPhotosEnter = ulEnter.append("li").attr("class", "list-item-local-photos");
74026 var localPhotosLabelEnter = localPhotosEnter.append("label").call(uiTooltip().title(() => _t.append("local_photos.tooltip")));
74027 localPhotosLabelEnter.append("input").attr("type", "checkbox").on("change", function() {
74028 toggleLayer("local-photos");
74030 localPhotosLabelEnter.call(_t.append("local_photos.header"));
74031 localPhotosEnter.append("button").attr("class", "open-data-options").call(
74032 uiTooltip().title(() => _t.append("local_photos.tooltip_edit")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
74033 ).on("click", function(d3_event) {
74034 d3_event.preventDefault();
74036 }).call(svgIcon("#iD-icon-more"));
74037 localPhotosEnter.append("button").attr("class", "zoom-to-data").call(
74038 uiTooltip().title(() => _t.append("local_photos.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
74039 ).on("click", function(d3_event) {
74040 if (select_default2(this).classed("disabled"))
74042 d3_event.preventDefault();
74043 d3_event.stopPropagation();
74044 photoLayer.fitZoom();
74045 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
74046 ul = ul.merge(ulEnter);
74047 ul.selectAll(".list-item-local-photos").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
74048 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
74050 function editLocalPhotos() {
74051 context.container().call(settingsLocalPhotos);
74053 function localPhotosChanged(d2) {
74054 var localPhotosLayer = layers.layer("local-photos");
74055 localPhotosLayer.fileList(d2);
74057 context.layers().on("change.uiSectionPhotoOverlays", section.reRender);
74058 context.photos().on("change.uiSectionPhotoOverlays", section.reRender);
74060 "move.photo_overlays",
74061 debounce_default(function() {
74062 window.requestIdleCallback(section.reRender);
74068 // modules/ui/panes/map_data.js
74069 function uiPaneMapData(context) {
74070 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([
74071 uiSectionDataLayers(context),
74072 uiSectionPhotoOverlays(context),
74073 uiSectionMapStyleOptions(context),
74074 uiSectionMapFeatures(context)
74076 return mapDataPane;
74079 // modules/ui/panes/preferences.js
74080 function uiPanePreferences(context) {
74081 let preferencesPane = uiPane("preferences", context).key(_t("preferences.key")).label(_t.append("preferences.title")).description(_t.append("preferences.description")).iconName("fas-user-cog").sections([
74082 uiSectionPrivacy(context)
74084 return preferencesPane;
74087 // modules/ui/init.js
74088 function uiInit(context) {
74089 var _initCounter = 0;
74090 var _needWidth = {};
74091 var _lastPointerType;
74092 function render(container) {
74093 container.on("click.ui", function(d3_event) {
74094 if (d3_event.button !== 0)
74096 if (!d3_event.composedPath)
74098 var isOkayTarget = d3_event.composedPath().some(function(node) {
74099 return node.nodeType === 1 && // clicking <input> focuses it and/or changes a value
74100 (node.nodeName === "INPUT" || // clicking <label> affects its <input> by default
74101 node.nodeName === "LABEL" || // clicking <a> opens a hyperlink by default
74102 node.nodeName === "A");
74106 d3_event.preventDefault();
74108 var detected = utilDetect();
74109 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
74110 // but we only need to do this on desktop Safari anyway. – #7694
74111 !detected.isMobileWebKit) {
74112 container.on("gesturestart.ui gesturechange.ui gestureend.ui", function(d3_event) {
74113 d3_event.preventDefault();
74116 if ("PointerEvent" in window) {
74117 select_default2(window).on("pointerdown.ui pointerup.ui", function(d3_event) {
74118 var pointerType = d3_event.pointerType || "mouse";
74119 if (_lastPointerType !== pointerType) {
74120 _lastPointerType = pointerType;
74121 container.attr("pointer", pointerType);
74125 _lastPointerType = "mouse";
74126 container.attr("pointer", "mouse");
74128 container.attr("lang", _mainLocalizer.localeCode()).attr("dir", _mainLocalizer.textDirection());
74129 container.call(uiFullScreen(context));
74130 var map2 = context.map();
74131 map2.redrawEnable(false);
74132 map2.on("hitMinZoom.ui", function() {
74133 ui.flash.iconName("#iD-icon-no").label(_t.append("cannot_zoom"))();
74135 container.append("svg").attr("id", "ideditor-defs").call(ui.svgDefs);
74136 container.append("div").attr("class", "sidebar").call(ui.sidebar);
74137 var content = container.append("div").attr("class", "main-content active");
74138 content.append("div").attr("class", "top-toolbar-wrap").append("div").attr("class", "top-toolbar fillD").call(uiTopToolbar(context));
74139 content.append("div").attr("class", "main-map").attr("dir", "ltr").call(map2);
74140 var overMap = content.append("div").attr("class", "over-map");
74141 overMap.append("div").attr("class", "select-trap").text("t");
74142 overMap.call(uiMapInMap(context)).call(uiNotice(context));
74143 overMap.append("div").attr("class", "spinner").call(uiSpinner(context));
74144 var controlsWrap = overMap.append("div").attr("class", "map-controls-wrap");
74145 var controls = controlsWrap.append("div").attr("class", "map-controls");
74146 controls.append("div").attr("class", "map-control zoombuttons").call(uiZoom(context));
74147 controls.append("div").attr("class", "map-control zoom-to-selection-control").call(uiZoomToSelection(context));
74148 controls.append("div").attr("class", "map-control geolocate-control").call(uiGeolocate(context));
74149 controlsWrap.on("wheel.mapControls", function(d3_event) {
74150 if (!d3_event.deltaX) {
74151 controlsWrap.node().scrollTop += d3_event.deltaY;
74154 var panes = overMap.append("div").attr("class", "map-panes");
74156 uiPaneBackground(context),
74157 uiPaneMapData(context),
74158 uiPaneIssues(context),
74159 uiPanePreferences(context),
74160 uiPaneHelp(context)
74162 uiPanes.forEach(function(pane) {
74163 controls.append("div").attr("class", "map-control map-pane-control " + pane.id + "-control").call(pane.renderToggleButton);
74164 panes.call(pane.renderPane);
74166 ui.info = uiInfo(context);
74167 overMap.call(ui.info);
74168 overMap.append("div").attr("class", "photoviewer").classed("al", true).classed("hide", true).call(ui.photoviewer);
74169 overMap.append("div").attr("class", "attribution-wrap").attr("dir", "ltr").call(uiAttribution(context));
74170 var about = content.append("div").attr("class", "map-footer");
74171 about.append("div").attr("class", "api-status").call(uiStatus(context));
74172 var footer = about.append("div").attr("class", "map-footer-bar fillD");
74173 footer.append("div").attr("class", "flash-wrap footer-hide");
74174 var footerWrap = footer.append("div").attr("class", "main-footer-wrap footer-show");
74175 footerWrap.append("div").attr("class", "scale-block").call(uiScale(context));
74176 var aboutList = footerWrap.append("div").attr("class", "info-block").append("ul").attr("class", "map-footer-list");
74177 aboutList.append("li").attr("class", "user-list").call(uiContributors(context));
74178 var apiConnections = context.connection().apiConnections();
74179 if (apiConnections && apiConnections.length > 1) {
74180 aboutList.append("li").attr("class", "source-switch").call(
74181 uiSourceSwitch(context).keys(apiConnections)
74184 aboutList.append("li").attr("class", "issues-info").call(uiIssuesInfo(context));
74185 aboutList.append("li").attr("class", "feature-warning").call(uiFeatureInfo(context));
74186 var issueLinks = aboutList.append("li");
74187 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"));
74188 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"));
74189 aboutList.append("li").attr("class", "version").call(uiVersion(context));
74190 if (!context.embed()) {
74191 aboutList.call(uiAccount(context));
74194 map2.redrawEnable(true);
74195 ui.hash = behaviorHash(context);
74197 if (!ui.hash.hadLocation) {
74198 map2.centerZoom([0, 0], 2);
74200 window.onbeforeunload = function() {
74201 return context.save();
74203 window.onunload = function() {
74204 context.history().unlock();
74206 select_default2(window).on("resize.editor", function() {
74209 var panPixels = 80;
74210 context.keybinding().on("\u232B", function(d3_event) {
74211 d3_event.preventDefault();
74212 }).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) {
74214 d3_event.stopImmediatePropagation();
74215 d3_event.preventDefault();
74217 var previousBackground = context.background().findSource(corePreferences("background-last-used-toggle"));
74218 if (previousBackground) {
74219 var currentBackground = context.background().baseLayerSource();
74220 corePreferences("background-last-used-toggle", currentBackground.id);
74221 corePreferences("background-last-used", previousBackground.id);
74222 context.background().baseLayerSource(previousBackground);
74224 }).on(_t("area_fill.wireframe.key"), function toggleWireframe(d3_event) {
74225 d3_event.preventDefault();
74226 d3_event.stopPropagation();
74227 context.map().toggleWireframe();
74228 }).on(uiCmd("\u2325" + _t("area_fill.wireframe.key")), function toggleOsmData(d3_event) {
74229 d3_event.preventDefault();
74230 d3_event.stopPropagation();
74231 var mode = context.mode();
74232 if (mode && /^draw/.test(mode.id))
74234 var layer = context.layers().layer("osm");
74236 layer.enabled(!layer.enabled());
74237 if (!layer.enabled()) {
74238 context.enter(modeBrowse(context));
74241 }).on(_t("map_data.highlight_edits.key"), function toggleHighlightEdited(d3_event) {
74242 d3_event.preventDefault();
74243 context.map().toggleHighlightEdited();
74245 context.on("enter.editor", function(entered) {
74246 container.classed("mode-" + entered.id, true);
74247 }).on("exit.editor", function(exited) {
74248 container.classed("mode-" + exited.id, false);
74250 context.enter(modeBrowse(context));
74251 if (!_initCounter++) {
74252 if (!ui.hash.startWalkthrough) {
74253 context.container().call(uiSplash(context)).call(uiRestore(context));
74255 context.container().call(ui.shortcuts);
74257 var osm = context.connection();
74258 var auth = uiLoading(context).message(_t.html("loading_auth")).blocking(true);
74260 osm.on("authLoading.ui", function() {
74261 context.container().call(auth);
74262 }).on("authDone.ui", function() {
74267 if (ui.hash.startWalkthrough) {
74268 ui.hash.startWalkthrough = false;
74269 context.container().call(uiIntro(context));
74272 return function(d3_event) {
74273 if (d3_event.shiftKey)
74275 if (context.container().select(".combobox").size())
74277 d3_event.preventDefault();
74278 context.map().pan(d2, 100);
74284 ui.ensureLoaded = () => {
74286 return _loadPromise;
74287 return _loadPromise = Promise.all([
74288 // must have strings and presets before loading the UI
74289 _mainLocalizer.ensureLoaded(),
74290 _mainPresetIndex.ensureLoaded()
74292 if (!context.container().empty())
74293 render(context.container());
74294 }).catch((err) => console.error(err));
74296 ui.restart = function() {
74297 context.keybinding().clear();
74298 _loadPromise = null;
74299 context.container().selectAll("*").remove();
74302 ui.lastPointerType = function() {
74303 return _lastPointerType;
74305 ui.svgDefs = svgDefs(context);
74306 ui.flash = uiFlash(context);
74307 ui.sidebar = uiSidebar(context);
74308 ui.photoviewer = uiPhotoviewer(context);
74309 ui.shortcuts = uiShortcuts(context);
74310 ui.onResize = function(withPan) {
74311 var map2 = context.map();
74312 var mapDimensions = utilGetDimensions(context.container().select(".main-content"), true);
74313 utilGetDimensions(context.container().select(".sidebar"), true);
74314 if (withPan !== void 0) {
74315 map2.redrawEnable(false);
74317 map2.redrawEnable(true);
74319 map2.dimensions(mapDimensions);
74320 ui.photoviewer.onMapResize();
74321 ui.checkOverflow(".top-toolbar");
74322 ui.checkOverflow(".map-footer-bar");
74323 var resizeWindowEvent = document.createEvent("Event");
74324 resizeWindowEvent.initEvent("resizeWindow", true, true);
74325 document.dispatchEvent(resizeWindowEvent);
74327 ui.checkOverflow = function(selector, reset) {
74329 delete _needWidth[selector];
74331 var selection2 = context.container().select(selector);
74332 if (selection2.empty())
74334 var scrollWidth = selection2.property("scrollWidth");
74335 var clientWidth = selection2.property("clientWidth");
74336 var needed = _needWidth[selector] || scrollWidth;
74337 if (scrollWidth > clientWidth) {
74338 selection2.classed("narrow", true);
74339 if (!_needWidth[selector]) {
74340 _needWidth[selector] = scrollWidth;
74342 } else if (scrollWidth >= needed) {
74343 selection2.classed("narrow", false);
74346 ui.togglePanes = function(showPane) {
74347 var hidePanes = context.container().selectAll(".map-pane.shown");
74348 var side = _mainLocalizer.textDirection() === "ltr" ? "right" : "left";
74349 hidePanes.classed("shown", false).classed("hide", true);
74350 context.container().selectAll(".map-pane-control button").classed("active", false);
74352 hidePanes.classed("shown", false).classed("hide", true).style(side, "-500px");
74353 context.container().selectAll("." + showPane.attr("pane") + "-control button").classed("active", true);
74354 showPane.classed("shown", true).classed("hide", false);
74355 if (hidePanes.empty()) {
74356 showPane.style(side, "-500px").transition().duration(200).style(side, "0px");
74358 showPane.style(side, "0px");
74361 hidePanes.classed("shown", true).classed("hide", false).style(side, "0px").transition().duration(200).style(side, "-500px").on("end", function() {
74362 select_default2(this).classed("shown", false).classed("hide", true);
74366 var _editMenu = uiEditMenu(context);
74367 ui.editMenu = function() {
74370 ui.showEditMenu = function(anchorPoint, triggerType, operations) {
74371 ui.closeEditMenu();
74372 if (!operations && context.mode().operations)
74373 operations = context.mode().operations();
74374 if (!operations || !operations.length)
74376 if (!context.map().editableDataEnabled())
74378 var surfaceNode = context.surface().node();
74379 if (surfaceNode.focus) {
74380 surfaceNode.focus();
74382 operations.forEach(function(operation) {
74383 if (operation.point)
74384 operation.point(anchorPoint);
74386 _editMenu.anchorLoc(anchorPoint).triggerType(triggerType).operations(operations);
74387 context.map().supersurface.call(_editMenu);
74389 ui.closeEditMenu = function() {
74390 context.map().supersurface.select(".edit-menu").remove();
74392 var _saveLoading = select_default2(null);
74393 context.uploader().on("saveStarted.ui", function() {
74394 _saveLoading = uiLoading(context).message(_t.html("save.uploading")).blocking(true);
74395 context.container().call(_saveLoading);
74396 }).on("saveEnded.ui", function() {
74397 _saveLoading.close();
74398 _saveLoading = select_default2(null);
74407 // modules/core/context.js
74408 function coreContext() {
74409 const dispatch14 = dispatch_default("enter", "exit", "change");
74410 let context = utilRebind({}, dispatch14, "on");
74411 let _deferred2 = /* @__PURE__ */ new Set();
74412 context.version = package_default.version;
74413 context.privacyVersion = "20201202";
74414 context.initialHashParams = window.location.hash ? utilStringQs(window.location.hash) : {};
74415 context.changeset = null;
74416 let _defaultChangesetComment = context.initialHashParams.comment;
74417 let _defaultChangesetSource = context.initialHashParams.source;
74418 let _defaultChangesetHashtags = context.initialHashParams.hashtags;
74419 context.defaultChangesetComment = function(val) {
74420 if (!arguments.length)
74421 return _defaultChangesetComment;
74422 _defaultChangesetComment = val;
74425 context.defaultChangesetSource = function(val) {
74426 if (!arguments.length)
74427 return _defaultChangesetSource;
74428 _defaultChangesetSource = val;
74431 context.defaultChangesetHashtags = function(val) {
74432 if (!arguments.length)
74433 return _defaultChangesetHashtags;
74434 _defaultChangesetHashtags = val;
74437 let _setsDocumentTitle = true;
74438 context.setsDocumentTitle = function(val) {
74439 if (!arguments.length)
74440 return _setsDocumentTitle;
74441 _setsDocumentTitle = val;
74444 let _documentTitleBase = document.title;
74445 context.documentTitleBase = function(val) {
74446 if (!arguments.length)
74447 return _documentTitleBase;
74448 _documentTitleBase = val;
74452 context.ui = () => _ui;
74453 context.lastPointerType = () => _ui.lastPointerType();
74454 let _keybinding = utilKeybinding("context");
74455 context.keybinding = () => _keybinding;
74456 select_default2(document).call(_keybinding);
74457 let _connection = services.osm;
74461 context.connection = () => _connection;
74462 context.history = () => _history;
74463 context.validator = () => _validator;
74464 context.uploader = () => _uploader;
74465 context.preauth = (options2) => {
74467 _connection.switch(options2);
74471 context.locale = function(locale2) {
74472 if (!arguments.length)
74473 return _mainLocalizer.localeCode();
74474 _mainLocalizer.preferredLocaleCodes(locale2);
74477 function afterLoad(cid, callback) {
74478 return (err, result) => {
74480 if (err.status === 400 || err.status === 401 || err.status === 403) {
74482 _connection.logout();
74485 if (typeof callback === "function") {
74489 } else if (_connection && _connection.getConnectionId() !== cid) {
74490 if (typeof callback === "function") {
74491 callback({ message: "Connection Switched", status: -1 });
74495 _history.merge(result.data, result.extent);
74496 if (typeof callback === "function") {
74497 callback(err, result);
74503 context.loadTiles = (projection2, callback) => {
74504 const handle = window.requestIdleCallback(() => {
74505 _deferred2.delete(handle);
74506 if (_connection && context.editableDataEnabled()) {
74507 const cid = _connection.getConnectionId();
74508 _connection.loadTiles(projection2, afterLoad(cid, callback));
74511 _deferred2.add(handle);
74513 context.loadTileAtLoc = (loc, callback) => {
74514 const handle = window.requestIdleCallback(() => {
74515 _deferred2.delete(handle);
74516 if (_connection && context.editableDataEnabled()) {
74517 const cid = _connection.getConnectionId();
74518 _connection.loadTileAtLoc(loc, afterLoad(cid, callback));
74521 _deferred2.add(handle);
74523 context.loadEntity = (entityID, callback) => {
74525 const cid = _connection.getConnectionId();
74526 _connection.loadEntity(entityID, afterLoad(cid, callback));
74527 _connection.loadEntityRelations(entityID, afterLoad(cid, callback));
74530 context.zoomToEntity = (entityID, zoomTo) => {
74531 context.loadEntity(entityID, (err, result) => {
74534 if (zoomTo !== false) {
74535 const entity = result.data.find((e3) => e3.id === entityID);
74537 _map.zoomTo(entity);
74541 _map.on("drawn.zoomToEntity", () => {
74542 if (!context.hasEntity(entityID))
74544 _map.on("drawn.zoomToEntity", null);
74545 context.on("enter.zoomToEntity", null);
74546 context.enter(modeSelect(context, [entityID]));
74548 context.on("enter.zoomToEntity", () => {
74549 if (_mode.id !== "browse") {
74550 _map.on("drawn.zoomToEntity", null);
74551 context.on("enter.zoomToEntity", null);
74555 let _minEditableZoom = 16;
74556 context.minEditableZoom = function(val) {
74557 if (!arguments.length)
74558 return _minEditableZoom;
74559 _minEditableZoom = val;
74561 _connection.tileZoom(val);
74565 context.maxCharsForTagKey = () => 255;
74566 context.maxCharsForTagValue = () => 255;
74567 context.maxCharsForRelationRole = () => 255;
74568 context.cleanTagKey = (val) => utilCleanOsmString(val, context.maxCharsForTagKey());
74569 context.cleanTagValue = (val) => utilCleanOsmString(val, context.maxCharsForTagValue());
74570 context.cleanRelationRole = (val) => utilCleanOsmString(val, context.maxCharsForRelationRole());
74571 let _inIntro = false;
74572 context.inIntro = function(val) {
74573 if (!arguments.length)
74578 context.save = () => {
74579 if (_inIntro || context.container().select(".modal").size())
74582 if (_mode && _mode.id === "save") {
74584 if (services.osm && services.osm.isChangesetInflight()) {
74585 _history.clearSaved();
74589 canSave = context.selectedIDs().every((id2) => {
74590 const entity = context.hasEntity(id2);
74591 return entity && !entity.isDegenerate();
74597 if (_history.hasChanges()) {
74598 return _t("save.unsaved_changes");
74601 context.debouncedSave = debounce_default(context.save, 350);
74602 function withDebouncedSave(fn) {
74603 return function() {
74604 const result = fn.apply(_history, arguments);
74605 context.debouncedSave();
74609 context.hasEntity = (id2) => _history.graph().hasEntity(id2);
74610 context.entity = (id2) => _history.graph().entity(id2);
74612 context.mode = () => _mode;
74613 context.enter = (newMode) => {
74616 dispatch14.call("exit", this, _mode);
74620 dispatch14.call("enter", this, _mode);
74622 context.selectedIDs = () => _mode && _mode.selectedIDs && _mode.selectedIDs() || [];
74623 context.activeID = () => _mode && _mode.activeID && _mode.activeID();
74624 let _selectedNoteID;
74625 context.selectedNoteID = function(noteID) {
74626 if (!arguments.length)
74627 return _selectedNoteID;
74628 _selectedNoteID = noteID;
74631 let _selectedErrorID;
74632 context.selectedErrorID = function(errorID) {
74633 if (!arguments.length)
74634 return _selectedErrorID;
74635 _selectedErrorID = errorID;
74638 context.install = (behavior) => context.surface().call(behavior);
74639 context.uninstall = (behavior) => context.surface().call(behavior.off);
74641 context.copyGraph = () => _copyGraph;
74643 context.copyIDs = function(val) {
74644 if (!arguments.length)
74647 _copyGraph = _history.graph();
74651 context.copyLonLat = function(val) {
74652 if (!arguments.length)
74653 return _copyLonLat;
74658 context.background = () => _background;
74660 context.features = () => _features;
74661 context.hasHiddenConnections = (id2) => {
74662 const graph = _history.graph();
74663 const entity = graph.entity(id2);
74664 return _features.hasHiddenConnections(entity, graph);
74667 context.photos = () => _photos;
74669 context.map = () => _map;
74670 context.layers = () => _map.layers();
74671 context.surface = () => _map.surface;
74672 context.editableDataEnabled = () => _map.editableDataEnabled();
74673 context.surfaceRect = () => _map.surface.node().getBoundingClientRect();
74674 context.editable = () => {
74675 const mode = context.mode();
74676 if (!mode || mode.id === "save")
74678 return _map.editableDataEnabled();
74680 let _debugFlags = {
74684 // label collision bounding boxes
74686 // imagery bounding polygons
74690 // downloaded data from osm
74692 context.debugFlags = () => _debugFlags;
74693 context.getDebug = (flag) => flag && _debugFlags[flag];
74694 context.setDebug = function(flag, val) {
74695 if (arguments.length === 1)
74697 _debugFlags[flag] = val;
74698 dispatch14.call("change");
74701 let _container = select_default2(null);
74702 context.container = function(val) {
74703 if (!arguments.length)
74706 _container.classed("ideditor", true);
74709 context.containerNode = function(val) {
74710 if (!arguments.length)
74711 return context.container().node();
74712 context.container(select_default2(val));
74716 context.embed = function(val) {
74717 if (!arguments.length)
74722 let _assetPath = "";
74723 context.assetPath = function(val) {
74724 if (!arguments.length)
74727 _mainFileFetcher.assetPath(val);
74730 let _assetMap = {};
74731 context.assetMap = function(val) {
74732 if (!arguments.length)
74735 _mainFileFetcher.assetMap(val);
74738 context.asset = (val) => {
74739 if (/^http(s)?:\/\//i.test(val))
74741 const filename = _assetPath + val;
74742 return _assetMap[filename] || filename;
74744 context.imagePath = (val) => context.asset(`img/${val}`);
74745 context.reset = context.flush = () => {
74746 context.debouncedSave.cancel();
74747 Array.from(_deferred2).forEach((handle) => {
74748 window.cancelIdleCallback(handle);
74749 _deferred2.delete(handle);
74751 Object.values(services).forEach((service) => {
74752 if (service && typeof service.reset === "function") {
74753 service.reset(context);
74756 context.changeset = null;
74757 _validator.reset();
74761 context.container().select(".inspector-wrap *").remove();
74764 context.projection = geoRawMercator();
74765 context.curtainProjection = geoRawMercator();
74766 context.init = () => {
74767 instantiateInternal();
74768 initializeDependents();
74770 function instantiateInternal() {
74771 _history = coreHistory(context);
74772 context.graph = _history.graph;
74773 context.pauseChangeDispatch = _history.pauseChangeDispatch;
74774 context.resumeChangeDispatch = _history.resumeChangeDispatch;
74775 context.perform = withDebouncedSave(_history.perform);
74776 context.replace = withDebouncedSave(_history.replace);
74777 context.pop = withDebouncedSave(_history.pop);
74778 context.overwrite = withDebouncedSave(_history.overwrite);
74779 context.undo = withDebouncedSave(_history.undo);
74780 context.redo = withDebouncedSave(_history.redo);
74781 _validator = coreValidator(context);
74782 _uploader = coreUploader(context);
74783 _background = rendererBackground(context);
74784 _features = rendererFeatures(context);
74785 _map = rendererMap(context);
74786 _photos = rendererPhotos(context);
74787 _ui = uiInit(context);
74789 function initializeDependents() {
74790 if (context.initialHashParams.presets) {
74791 _mainPresetIndex.addablePresetIDs(new Set(context.initialHashParams.presets.split(",")));
74793 if (context.initialHashParams.locale) {
74794 _mainLocalizer.preferredLocaleCodes(context.initialHashParams.locale);
74796 _mainLocalizer.ensureLoaded();
74797 _mainPresetIndex.ensureLoaded();
74798 _background.ensureLoaded();
74799 Object.values(services).forEach((service) => {
74800 if (service && typeof service.init === "function") {
74807 if (services.maprules && context.initialHashParams.maprules) {
74808 json_default(context.initialHashParams.maprules).then((mapcss) => {
74809 services.maprules.init();
74810 mapcss.forEach((mapcssSelector) => services.maprules.addRule(mapcssSelector));
74814 if (!context.container().empty()) {
74815 _ui.ensureLoaded().then(() => {
74816 _background.init();
74825 // modules/services/nominatim.js
74826 var apibase = nominatimApiUrl;
74827 var _inflight = {};
74828 var _nominatimCache;
74829 var nominatim_default = {
74832 _nominatimCache = new import_rbush7.default();
74834 reset: function() {
74835 Object.values(_inflight).forEach(function(controller) {
74836 controller.abort();
74839 _nominatimCache = new import_rbush7.default();
74841 countryCode: function(location, callback) {
74842 this.reverse(location, function(err, result) {
74844 return callback(err);
74845 } else if (result.address) {
74846 return callback(null, result.address.country_code);
74848 return callback("Unable to geocode", null);
74852 reverse: function(loc, callback) {
74853 var cached = _nominatimCache.search(
74854 { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] }
74856 if (cached.length > 0) {
74858 callback(null, cached[0].data);
74861 var params = { zoom: 13, format: "json", addressdetails: 1, lat: loc[1], lon: loc[0] };
74862 var url = apibase + "reverse?" + utilQsString(params);
74863 if (_inflight[url])
74865 var controller = new AbortController();
74866 _inflight[url] = controller;
74867 json_default(url, {
74868 signal: controller.signal,
74870 "Accept-Language": _mainLocalizer.localeCodes().join(",")
74872 }).then(function(result) {
74873 delete _inflight[url];
74874 if (result && result.error) {
74875 throw new Error(result.error);
74877 var extent = geoExtent(loc).padByMeters(200);
74878 _nominatimCache.insert(Object.assign(extent.bbox(), { data: result }));
74880 callback(null, result);
74881 }).catch(function(err) {
74882 delete _inflight[url];
74883 if (err.name === "AbortError")
74886 callback(err.message);
74889 search: function(val, callback) {
74895 var url = apibase + "search?" + utilQsString(params);
74896 if (_inflight[url])
74898 var controller = new AbortController();
74899 _inflight[url] = controller;
74900 json_default(url, {
74901 signal: controller.signal,
74903 "Accept-Language": _mainLocalizer.localeCodes().join(",")
74905 }).then(function(result) {
74906 delete _inflight[url];
74907 if (result && result.error) {
74908 throw new Error(result.error);
74911 callback(null, result);
74912 }).catch(function(err) {
74913 delete _inflight[url];
74914 if (err.name === "AbortError")
74917 callback(err.message);
74922 // node_modules/name-suggestion-index/lib/matcher.js
74923 var import_which_polygon4 = __toESM(require_which_polygon(), 1);
74925 // node_modules/name-suggestion-index/lib/simplify.js
74926 var import_diacritics3 = __toESM(require_diacritics(), 1);
74927 function simplify2(str2) {
74928 if (typeof str2 !== "string")
74930 return import_diacritics3.default.remove(
74931 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()
74935 // node_modules/name-suggestion-index/config/matchGroups.json
74936 var matchGroups_default = {
74938 adult_gaming_centre: [
74940 "amenity/gambling",
74941 "leisure/adult_gaming_centre"
74945 "shop/hairdresser_supply"
74959 "tourism/camp_site",
74960 "tourism/caravan_site"
74971 "healthcare/clinic",
74972 "healthcare/laboratory",
74973 "healthcare/physiotherapist",
74974 "healthcare/sample_collection",
74975 "healthcare/dialysis"
74980 "shop/convenience",
74988 "amenity/coworking_space",
74989 "office/coworking",
74990 "office/coworking_space"
74995 "healthcare/dentist"
74998 "office/telecommunication",
75000 "shop/electronics",
75004 "shop/mobile_phone",
75005 "shop/telecommunication"
75009 "shop/haberdashery",
75013 "shop/accessories",
75017 "shop/department_store",
75019 "shop/fashion_accessories",
75025 "office/accountant",
75026 "office/financial",
75027 "office/financial_advisor",
75028 "office/tax_advisor",
75032 "leisure/fitness_centre",
75033 "leisure/fitness_center",
75034 "leisure/sports_centre",
75035 "leisure/sports_center"
75040 "amenity/fast_food",
75041 "amenity/ice_cream",
75043 "amenity/restaurant",
75048 "shop/confectionary",
75049 "shop/confectionery",
75059 "shop/convenience;gas",
75060 "shop/gas;convenience"
75070 "shop/bathroom_furnishing",
75073 "shop/doityourself",
75078 "shop/hardware_store",
75079 "shop/power_tools",
75086 "shop/health_food",
75088 "shop/nutrition_supplements"
75091 "shop/electronics",
75098 "shop/video_games",
75103 "amenity/hospital",
75104 "healthcare/hospital"
75108 "shop/interior_decoration"
75110 lifeboat_station: [
75111 "amenity/lifeboat_station",
75112 "emergency/lifeboat_station",
75113 "emergency/marine_rescue"
75120 "amenity/money_transfer",
75121 "shop/money_transfer"
75124 "shop/office_supplies",
75134 "amenity/parcel_locker",
75135 "amenity/vending_machine"
75139 "amenity/pharmacy",
75140 "healthcare/pharmacy"
75143 "amenity/theme_park",
75144 "leisure/amusement_arcade",
75145 "leisure/playground"
75148 "amenity/bicycle_rental",
75149 "amenity/boat_rental",
75150 "amenity/car_rental",
75151 "amenity/truck_rental",
75152 "amenity/vehicle_rental",
75157 "amenity/childcare",
75159 "amenity/kindergarten",
75160 "amenity/language_school",
75161 "amenity/prep_school",
75163 "amenity/university"
75166 "shop/storage_units",
75167 "shop/storage_rental"
75171 "power/substation",
75172 "power/sub_station"
75176 "shop/frozen_food",
75177 "shop/greengrocer",
75179 "shop/supermarket",
75183 "shop/variety_store",
75188 "amenity/vending_machine",
75190 "shop/vending_machine"
75195 "amenity/weight_clinic",
75196 "healthcare/counselling",
75197 "leisure/fitness_centre",
75198 "office/therapist",
75202 "shop/health_food",
75205 "shop/nutrition_supplements",
75210 "shop/supermarket",
75211 "shop/department_store"
75216 // node_modules/name-suggestion-index/config/genericWords.json
75217 var genericWords_default = {
75219 "^(barn|bazaa?r|bench|bou?tique|building|casa|church)$",
75220 "^(baseball|basketball|football|soccer|softball|tennis(halle)?)\\s?(field|court)?$",
75221 "^(club|green|out|ware)\\s?house$",
75222 "^(driveway|el \xE1rbol|fountain|generic|golf|government|graveyard)$",
75223 "^(fixme|n\\s?\\/?\\s?a|name|no\\s?name|none|null|temporary|test|unknown)$",
75224 "^(hofladen|librairie|magazine?|maison)$",
75225 "^(mobile home|skate)?\\s?park$",
75226 "^(obuwie|pond|pool|sale|shops?|sklep|stores?)$",
75229 "^tattoo( studio)?$",
75231 "^\u0446\u0435\u0440\u043A\u043E\u0432\u043D\u0430\u044F( \u043B\u0430\u0432\u043A\u0430)?$"
75235 // node_modules/name-suggestion-index/config/trees.json
75236 var trees_default = {
75239 emoji: "\u{1F354}",
75240 mainTag: "brand:wikidata",
75241 sourceTags: ["brand", "name"],
75243 primary: "^(name|name:\\w+)$",
75244 alternate: "^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"
75248 emoji: "\u{1F6A9}",
75249 mainTag: "flag:wikidata",
75251 primary: "^(flag:name|flag:name:\\w+)$",
75252 alternate: "^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"
75256 emoji: "\u{1F4BC}",
75257 mainTag: "operator:wikidata",
75258 sourceTags: ["operator"],
75260 primary: "^(name|name:\\w+|operator|operator:\\w+)$",
75261 alternate: "^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"
75265 emoji: "\u{1F687}",
75266 mainTag: "network:wikidata",
75267 sourceTags: ["network"],
75269 primary: "^network$",
75270 alternate: "^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"
75276 // node_modules/name-suggestion-index/lib/matcher.js
75277 var matchGroups = matchGroups_default.matchGroups;
75278 var trees = trees_default.trees;
75279 var Matcher = class {
75282 // initialize the genericWords regexes
75284 this.matchIndex = void 0;
75285 this.genericWords = /* @__PURE__ */ new Map();
75286 (genericWords_default.genericWords || []).forEach((s2) => this.genericWords.set(s2, new RegExp(s2, "i")));
75287 this.itemLocation = void 0;
75288 this.locationSets = void 0;
75289 this.locationIndex = void 0;
75290 this.warnings = [];
75293 // `buildMatchIndex()`
75294 // Call this to prepare the matcher for use
75296 // `data` needs to be an Object indexed on a 'tree/key/value' path.
75297 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
75299 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
75300 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
75304 buildMatchIndex(data) {
75306 if (that.matchIndex)
75308 that.matchIndex = /* @__PURE__ */ new Map();
75309 const seenTree = /* @__PURE__ */ new Map();
75310 Object.keys(data).forEach((tkv) => {
75311 const category = data[tkv];
75312 const parts = tkv.split("/", 3);
75313 const t2 = parts[0];
75314 const k2 = parts[1];
75315 const v2 = parts[2];
75316 const thiskv = `${k2}/${v2}`;
75317 const tree = trees[t2];
75318 let branch = that.matchIndex.get(thiskv);
75321 primary: /* @__PURE__ */ new Map(),
75322 alternate: /* @__PURE__ */ new Map(),
75323 excludeGeneric: /* @__PURE__ */ new Map(),
75324 excludeNamed: /* @__PURE__ */ new Map()
75326 that.matchIndex.set(thiskv, branch);
75328 const properties = category.properties || {};
75329 const exclude = properties.exclude || {};
75330 (exclude.generic || []).forEach((s2) => branch.excludeGeneric.set(s2, new RegExp(s2, "i")));
75331 (exclude.named || []).forEach((s2) => branch.excludeNamed.set(s2, new RegExp(s2, "i")));
75332 const excludeRegexes = [...branch.excludeGeneric.values(), ...branch.excludeNamed.values()];
75333 let items = category.items;
75334 if (!Array.isArray(items) || !items.length)
75336 const primaryName = new RegExp(tree.nameTags.primary, "i");
75337 const alternateName = new RegExp(tree.nameTags.alternate, "i");
75338 const notName = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
75339 const skipGenericKV = skipGenericKVMatches(t2, k2, v2);
75340 const genericKV = /* @__PURE__ */ new Set([`${k2}/yes`, `building/yes`]);
75341 const matchGroupKV = /* @__PURE__ */ new Set();
75342 Object.values(matchGroups).forEach((matchGroup) => {
75343 const inGroup = matchGroup.some((otherkv) => otherkv === thiskv);
75346 matchGroup.forEach((otherkv) => {
75347 if (otherkv === thiskv)
75349 matchGroupKV.add(otherkv);
75350 const otherk = otherkv.split("/", 2)[0];
75351 genericKV.add(`${otherk}/yes`);
75354 items.forEach((item) => {
75357 if (Array.isArray(item.matchTags) && item.matchTags.length) {
75358 item.matchTags = item.matchTags.filter((matchTag) => !matchGroupKV.has(matchTag) && !genericKV.has(matchTag));
75359 if (!item.matchTags.length)
75360 delete item.matchTags;
75362 let kvTags = [`${thiskv}`].concat(item.matchTags || []);
75363 if (!skipGenericKV) {
75364 kvTags = kvTags.concat(Array.from(genericKV));
75366 Object.keys(item.tags).forEach((osmkey) => {
75367 if (notName.test(osmkey))
75369 const osmvalue = item.tags[osmkey];
75370 if (!osmvalue || excludeRegexes.some((regex) => regex.test(osmvalue)))
75372 if (primaryName.test(osmkey)) {
75373 kvTags.forEach((kv) => insertName("primary", t2, kv, simplify2(osmvalue), item.id));
75374 } else if (alternateName.test(osmkey)) {
75375 kvTags.forEach((kv) => insertName("alternate", t2, kv, simplify2(osmvalue), item.id));
75378 let keepMatchNames = /* @__PURE__ */ new Set();
75379 (item.matchNames || []).forEach((matchName) => {
75380 const nsimple = simplify2(matchName);
75381 kvTags.forEach((kv) => {
75382 const branch2 = that.matchIndex.get(kv);
75383 const primaryLeaf = branch2 && branch2.primary.get(nsimple);
75384 const alternateLeaf = branch2 && branch2.alternate.get(nsimple);
75385 const inPrimary = primaryLeaf && primaryLeaf.has(item.id);
75386 const inAlternate = alternateLeaf && alternateLeaf.has(item.id);
75387 if (!inPrimary && !inAlternate) {
75388 insertName("alternate", t2, kv, nsimple, item.id);
75389 keepMatchNames.add(matchName);
75393 if (keepMatchNames.size) {
75394 item.matchNames = Array.from(keepMatchNames);
75396 delete item.matchNames;
75400 function insertName(which, t2, kv, nsimple, itemID) {
75402 that.warnings.push(`Warning: skipping empty ${which} name for item ${t2}/${kv}: ${itemID}`);
75405 let branch = that.matchIndex.get(kv);
75408 primary: /* @__PURE__ */ new Map(),
75409 alternate: /* @__PURE__ */ new Map(),
75410 excludeGeneric: /* @__PURE__ */ new Map(),
75411 excludeNamed: /* @__PURE__ */ new Map()
75413 that.matchIndex.set(kv, branch);
75415 let leaf = branch[which].get(nsimple);
75417 leaf = /* @__PURE__ */ new Set();
75418 branch[which].set(nsimple, leaf);
75421 if (!/yes$/.test(kv)) {
75422 const kvnsimple = `${kv}/${nsimple}`;
75423 const existing = seenTree.get(kvnsimple);
75424 if (existing && existing !== t2) {
75425 const items = Array.from(leaf);
75426 that.warnings.push(`Duplicate cache key "${kvnsimple}" in trees "${t2}" and "${existing}", check items: ${items}`);
75429 seenTree.set(kvnsimple, t2);
75432 function skipGenericKVMatches(t2, k2, v2) {
75433 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";
75437 // `buildLocationIndex()`
75438 // Call this to prepare a which-polygon location index.
75439 // This *resolves* all the locationSets into GeoJSON, which takes some time.
75440 // You can skip this step if you don't care about matching within a location.
75442 // `data` needs to be an Object indexed on a 'tree/key/value' path.
75443 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
75445 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
75446 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
75450 buildLocationIndex(data, loco) {
75452 if (that.locationIndex)
75454 that.itemLocation = /* @__PURE__ */ new Map();
75455 that.locationSets = /* @__PURE__ */ new Map();
75456 Object.keys(data).forEach((tkv) => {
75457 const items = data[tkv].items;
75458 if (!Array.isArray(items) || !items.length)
75460 items.forEach((item) => {
75461 if (that.itemLocation.has(item.id))
75465 resolved = loco.resolveLocationSet(item.locationSet);
75467 console.warn(`buildLocationIndex: ${err.message}`);
75469 if (!resolved || !resolved.id)
75471 that.itemLocation.set(item.id, resolved.id);
75472 if (that.locationSets.has(resolved.id))
75474 let feature3 = _cloneDeep2(resolved.feature);
75475 feature3.id = resolved.id;
75476 feature3.properties.id = resolved.id;
75477 if (!feature3.geometry.coordinates.length || !feature3.properties.area) {
75478 console.warn(`buildLocationIndex: locationSet ${resolved.id} for ${item.id} resolves to an empty feature:`);
75479 console.warn(JSON.stringify(feature3));
75482 that.locationSets.set(resolved.id, feature3);
75485 that.locationIndex = (0, import_which_polygon4.default)({ type: "FeatureCollection", features: [...that.locationSets.values()] });
75486 function _cloneDeep2(obj) {
75487 return JSON.parse(JSON.stringify(obj));
75492 // Pass parts and return an Array of matches.
75496 // `loc` - optional - [lon,lat] location to search
75498 // 1. If the [k,v,n] tuple matches a canonical item…
75499 // Return an Array of match results.
75500 // Each result will include the area in km² that the item is valid.
75502 // Order of results:
75503 // Primary ordering will be on the "match" column:
75504 // "primary" - where the query matches the `name` tag, followed by
75505 // "alternate" - where the query matches an alternate name tag (e.g. short_name, brand, operator, etc)
75506 // Secondary ordering will be on the "area" column:
75507 // "area descending" if no location was provided, (worldwide before local)
75508 // "area ascending" if location was provided (local before worldwide)
75511 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
75512 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
75513 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
75514 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
75520 // 2. If the [k,v,n] tuple matches an exclude pattern…
75521 // Return an Array with a single exclude result, either
75523 // [ { match: 'excludeGeneric', pattern: String, kv: String } ] // "generic" e.g. "Food Court"
75525 // [ { match: 'excludeNamed', pattern: String, kv: String } ] // "named", e.g. "Kebabai"
75528 // "generic" - a generic word that is probably not really a name.
75529 // For these, iD should warn the user "Hey don't put 'food court' in the name tag".
75530 // "named" - a real name like "Kebabai" that is just common, but not a brand.
75531 // 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.
75535 // 3. If the [k,v,n] tuple matches nothing of any kind, return `null`
75538 match(k2, v2, n3, loc) {
75540 if (!that.matchIndex) {
75541 throw new Error("match: matchIndex not built.");
75543 let matchLocations;
75544 if (Array.isArray(loc) && that.locationIndex) {
75545 matchLocations = that.locationIndex([loc[0], loc[1], loc[0], loc[1]], true);
75547 const nsimple = simplify2(n3);
75548 let seen = /* @__PURE__ */ new Set();
75550 gatherResults("primary");
75551 gatherResults("alternate");
75552 if (results.length)
75554 gatherResults("exclude");
75555 return results.length ? results : null;
75556 function gatherResults(which) {
75557 const kv = `${k2}/${v2}`;
75558 let didMatch = tryMatch(which, kv);
75561 for (let mg in matchGroups) {
75562 const matchGroup = matchGroups[mg];
75563 const inGroup = matchGroup.some((otherkv) => otherkv === kv);
75566 for (let i3 = 0; i3 < matchGroup.length; i3++) {
75567 const otherkv = matchGroup[i3];
75568 if (otherkv === kv)
75570 didMatch = tryMatch(which, otherkv);
75575 if (which === "exclude") {
75576 const regex = [...that.genericWords.values()].find((regex2) => regex2.test(n3));
75578 results.push({ match: "excludeGeneric", pattern: String(regex) });
75583 function tryMatch(which, kv) {
75584 const branch = that.matchIndex.get(kv);
75587 if (which === "exclude") {
75588 let regex = [...branch.excludeNamed.values()].find((regex2) => regex2.test(n3));
75590 results.push({ match: "excludeNamed", pattern: String(regex), kv });
75593 regex = [...branch.excludeGeneric.values()].find((regex2) => regex2.test(n3));
75595 results.push({ match: "excludeGeneric", pattern: String(regex), kv });
75600 const leaf = branch[which].get(nsimple);
75601 if (!leaf || !leaf.size)
75603 let hits = Array.from(leaf).map((itemID) => {
75604 let area = Infinity;
75605 if (that.itemLocation && that.locationSets) {
75606 const location = that.locationSets.get(that.itemLocation.get(itemID));
75607 area = location && location.properties.area || Infinity;
75609 return { match: which, itemID, area, kv, nsimple };
75611 let sortFn = byAreaDescending;
75612 if (matchLocations) {
75613 hits = hits.filter(isValidLocation);
75614 sortFn = byAreaAscending;
75618 hits.sort(sortFn).forEach((hit) => {
75619 if (seen.has(hit.itemID))
75621 seen.add(hit.itemID);
75625 function isValidLocation(hit) {
75626 if (!that.itemLocation)
75628 return matchLocations.find((props) => props.id === that.itemLocation.get(hit.itemID));
75630 function byAreaAscending(hitA, hitB) {
75631 return hitA.area - hitB.area;
75633 function byAreaDescending(hitA, hitB) {
75634 return hitB.area - hitA.area;
75640 // Return any warnings discovered when buiding the index.
75641 // (currently this does nothing)
75644 return this.warnings;
75648 // modules/services/nsi.js
75649 var import_vparse2 = __toESM(require_vparse());
75650 var _nsiStatus = "loading";
75652 var buildingPreset = {
75653 "building/commercial": true,
75654 "building/government": true,
75655 "building/hotel": true,
75656 "building/retail": true,
75657 "building/office": true,
75658 "building/supermarket": true,
75659 "building/yes": true
75661 var notNames = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
75662 var notBranches = /(coop|express|wireless|factory|outlet)/i;
75663 function setNsiSources() {
75664 const nsiVersion = package_default.dependencies["name-suggestion-index"] || package_default.devDependencies["name-suggestion-index"];
75665 const v2 = (0, import_vparse2.default)(nsiVersion);
75666 const vMinor = `${v2.major}.${v2.minor}`;
75667 const cdn = nsiCdnUrl.replace("{version}", vMinor);
75669 "nsi_data": cdn + "dist/nsi.min.json",
75670 "nsi_dissolved": cdn + "dist/dissolved.min.json",
75671 "nsi_features": cdn + "dist/featureCollection.min.json",
75672 "nsi_generics": cdn + "dist/genericWords.min.json",
75673 "nsi_presets": cdn + "dist/presets/nsi-id-presets.min.json",
75674 "nsi_replacements": cdn + "dist/replacements.min.json",
75675 "nsi_trees": cdn + "dist/trees.min.json"
75677 let fileMap = _mainFileFetcher.fileMap();
75678 for (const k2 in sources) {
75680 fileMap[k2] = sources[k2];
75683 function loadNsiPresets() {
75684 return Promise.all([
75685 _mainFileFetcher.get("nsi_presets"),
75686 _mainFileFetcher.get("nsi_features")
75687 ]).then((vals) => {
75688 Object.values(vals[0].presets).forEach((preset) => preset.suggestion = true);
75689 _mainPresetIndex.merge({
75690 presets: vals[0].presets,
75691 featureCollection: vals[1]
75695 function loadNsiData() {
75696 return Promise.all([
75697 _mainFileFetcher.get("nsi_data"),
75698 _mainFileFetcher.get("nsi_dissolved"),
75699 _mainFileFetcher.get("nsi_replacements"),
75700 _mainFileFetcher.get("nsi_trees")
75701 ]).then((vals) => {
75704 // the raw name-suggestion-index data
75705 dissolved: vals[1].dissolved,
75706 // list of dissolved items
75707 replacements: vals[2].replacements,
75708 // trivial old->new qid replacements
75709 trees: vals[3].trees,
75710 // metadata about trees, main tags
75711 kvt: /* @__PURE__ */ new Map(),
75712 // Map (k -> Map (v -> t) )
75713 qids: /* @__PURE__ */ new Map(),
75714 // Map (wd/wp tag values -> qids)
75715 ids: /* @__PURE__ */ new Map()
75716 // Map (id -> NSI item)
75718 const matcher = _nsi.matcher = new Matcher();
75719 matcher.buildMatchIndex(_nsi.data);
75720 matcher.itemLocation = /* @__PURE__ */ new Map();
75721 matcher.locationSets = /* @__PURE__ */ new Map();
75722 Object.keys(_nsi.data).forEach((tkv) => {
75723 const items = _nsi.data[tkv].items;
75724 if (!Array.isArray(items) || !items.length)
75726 items.forEach((item) => {
75727 if (matcher.itemLocation.has(item.id))
75729 const locationSetID = _sharedLocationManager.locationSetID(item.locationSet);
75730 matcher.itemLocation.set(item.id, locationSetID);
75731 if (matcher.locationSets.has(locationSetID))
75733 const fakeFeature = { id: locationSetID, properties: { id: locationSetID, area: 1 } };
75734 matcher.locationSets.set(locationSetID, fakeFeature);
75737 matcher.locationIndex = (bbox2) => {
75738 const validHere = _sharedLocationManager.locationSetsAt([bbox2[0], bbox2[1]]);
75739 const results = [];
75740 for (const [locationSetID, area] of Object.entries(validHere)) {
75741 const fakeFeature = matcher.locationSets.get(locationSetID);
75743 fakeFeature.properties.area = area;
75744 results.push(fakeFeature);
75749 Object.keys(_nsi.data).forEach((tkv) => {
75750 const category = _nsi.data[tkv];
75751 const parts = tkv.split("/", 3);
75752 const t2 = parts[0];
75753 const k2 = parts[1];
75754 const v2 = parts[2];
75755 let vmap = _nsi.kvt.get(k2);
75757 vmap = /* @__PURE__ */ new Map();
75758 _nsi.kvt.set(k2, vmap);
75761 const tree = _nsi.trees[t2];
75762 const mainTag = tree.mainTag;
75763 const items = category.items || [];
75764 items.forEach((item) => {
75766 item.mainTag = mainTag;
75767 _nsi.ids.set(item.id, item);
75768 const wd = item.tags[mainTag];
75769 const wp = item.tags[mainTag.replace("wikidata", "wikipedia")];
75771 _nsi.qids.set(wd, wd);
75773 _nsi.qids.set(wp, wd);
75778 function gatherKVs(tags) {
75779 let primary = /* @__PURE__ */ new Set();
75780 let alternate = /* @__PURE__ */ new Set();
75781 Object.keys(tags).forEach((osmkey) => {
75782 const osmvalue = tags[osmkey];
75785 if (osmkey === "route_master")
75787 const vmap = _nsi.kvt.get(osmkey);
75790 if (vmap.get(osmvalue)) {
75791 primary.add(`${osmkey}/${osmvalue}`);
75792 } else if (osmvalue === "yes") {
75793 alternate.add(`${osmkey}/${osmvalue}`);
75796 const preset = _mainPresetIndex.matchTags(tags, "area");
75797 if (buildingPreset[preset.id]) {
75798 alternate.add("building/yes");
75800 return { primary, alternate };
75802 function identifyTree(tags) {
75805 Object.keys(tags).forEach((osmkey) => {
75808 const osmvalue = tags[osmkey];
75811 if (osmkey === "route_master")
75813 const vmap = _nsi.kvt.get(osmkey);
75816 if (osmvalue === "yes") {
75817 unknown = "unknown";
75819 t2 = vmap.get(osmvalue);
75822 return t2 || unknown || null;
75824 function gatherNames(tags) {
75825 const empty2 = { primary: /* @__PURE__ */ new Set(), alternate: /* @__PURE__ */ new Set() };
75826 let primary = /* @__PURE__ */ new Set();
75827 let alternate = /* @__PURE__ */ new Set();
75828 let foundSemi = false;
75829 let testNameFragments = false;
75831 let t2 = identifyTree(tags);
75834 if (t2 === "transit") {
75836 primary: /^network$/i,
75837 alternate: /^(operator|operator:\w+|network:\w+|\w+_name|\w+_name:\w+)$/i
75839 } else if (t2 === "flags") {
75841 primary: /^(flag:name|flag:name:\w+)$/i,
75842 alternate: /^(flag|flag:\w+|subject|subject:\w+)$/i
75843 // note: no `country`, we special-case it below
75845 } else if (t2 === "brands") {
75846 testNameFragments = true;
75848 primary: /^(name|name:\w+)$/i,
75849 alternate: /^(brand|brand:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
75851 } else if (t2 === "operators") {
75852 testNameFragments = true;
75854 primary: /^(name|name:\w+|operator|operator:\w+)$/i,
75855 alternate: /^(brand|brand:\w+|\w+_name|\w+_name:\w+)/i
75858 testNameFragments = true;
75860 primary: /^(name|name:\w+)$/i,
75861 alternate: /^(brand|brand:\w+|network|network:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
75864 if (tags.name && testNameFragments) {
75865 const nameParts = tags.name.split(/[\s\-\/,.]/);
75866 for (let split = nameParts.length; split > 0; split--) {
75867 const name = nameParts.slice(0, split).join(" ");
75871 Object.keys(tags).forEach((osmkey) => {
75872 const osmvalue = tags[osmkey];
75875 if (isNamelike(osmkey, "primary")) {
75876 if (/;/.test(osmvalue)) {
75879 primary.add(osmvalue);
75880 alternate.delete(osmvalue);
75882 } else if (!primary.has(osmvalue) && isNamelike(osmkey, "alternate")) {
75883 if (/;/.test(osmvalue)) {
75886 alternate.add(osmvalue);
75890 if (tags.man_made === "flagpole" && !primary.size && !alternate.size && !!tags.country) {
75891 const osmvalue = tags.country;
75892 if (/;/.test(osmvalue)) {
75895 alternate.add(osmvalue);
75901 return { primary, alternate };
75903 function isNamelike(osmkey, which) {
75904 if (osmkey === "old_name")
75906 return patterns2[which].test(osmkey) && !notNames.test(osmkey);
75909 function gatherTuples(tryKVs, tryNames) {
75911 ["primary", "alternate"].forEach((whichName) => {
75912 const arr = Array.from(tryNames[whichName]).sort((a2, b2) => b2.length - a2.length);
75913 arr.forEach((n3) => {
75914 ["primary", "alternate"].forEach((whichKV) => {
75915 tryKVs[whichKV].forEach((kv) => {
75916 const parts = kv.split("/", 2);
75917 const k2 = parts[0];
75918 const v2 = parts[1];
75919 tuples.push({ k: k2, v: v2, n: n3 });
75926 function _upgradeTags(tags, loc) {
75927 let newTags = Object.assign({}, tags);
75928 let changed = false;
75929 Object.keys(newTags).forEach((osmkey) => {
75930 const matchTag = osmkey.match(/^(\w+:)?wikidata$/);
75932 const prefix = matchTag[1] || "";
75933 const wd = newTags[osmkey];
75934 const replace = _nsi.replacements[wd];
75935 if (replace && replace.wikidata !== void 0) {
75937 if (replace.wikidata) {
75938 newTags[osmkey] = replace.wikidata;
75940 delete newTags[osmkey];
75943 if (replace && replace.wikipedia !== void 0) {
75945 const wpkey = `${prefix}wikipedia`;
75946 if (replace.wikipedia) {
75947 newTags[wpkey] = replace.wikipedia;
75949 delete newTags[wpkey];
75954 const isRouteMaster = tags.type === "route_master";
75955 const tryKVs = gatherKVs(tags);
75956 if (!tryKVs.primary.size && !tryKVs.alternate.size) {
75957 return changed ? { newTags, matched: null } : null;
75959 const tryNames = gatherNames(tags);
75960 const foundQID = _nsi.qids.get(tags.wikidata) || _nsi.qids.get(tags.wikipedia);
75962 tryNames.primary.add(foundQID);
75963 if (!tryNames.primary.size && !tryNames.alternate.size) {
75964 return changed ? { newTags, matched: null } : null;
75966 const tuples = gatherTuples(tryKVs, tryNames);
75967 for (let i3 = 0; i3 < tuples.length; i3++) {
75968 const tuple = tuples[i3];
75969 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc);
75970 if (!hits || !hits.length)
75972 if (hits[0].match !== "primary" && hits[0].match !== "alternate")
75975 for (let j3 = 0; j3 < hits.length; j3++) {
75976 const hit = hits[j3];
75977 itemID = hit.itemID;
75978 if (_nsi.dissolved[itemID])
75980 item = _nsi.ids.get(itemID);
75983 const mainTag = item.mainTag;
75984 const itemQID = item.tags[mainTag];
75985 const notQID = newTags[`not:${mainTag}`];
75987 // Exceptions, skip this hit
75988 !itemQID || itemQID === notQID || // No `*:wikidata` or matched a `not:*:wikidata`
75989 newTags.office && !item.tags.office
75999 item = JSON.parse(JSON.stringify(item));
76000 const tkv = item.tkv;
76001 const parts = tkv.split("/", 3);
76002 const k2 = parts[1];
76003 const v2 = parts[2];
76004 const category = _nsi.data[tkv];
76005 const properties = category.properties || {};
76006 let preserveTags = item.preserveTags || properties.preserveTags || [];
76007 ["building", "emergency", "internet_access", "takeaway"].forEach((osmkey) => {
76009 preserveTags.push(`^${osmkey}$`);
76011 const regexes = preserveTags.map((s2) => new RegExp(s2, "i"));
76013 Object.keys(newTags).forEach((osmkey) => {
76014 if (regexes.some((regex) => regex.test(osmkey))) {
76015 keepTags[osmkey] = newTags[osmkey];
76018 _nsi.kvt.forEach((vmap, k3) => {
76019 if (newTags[k3] === "yes")
76020 delete newTags[k3];
76023 delete newTags.wikipedia;
76024 delete newTags.wikidata;
76026 Object.assign(newTags, item.tags, keepTags);
76027 if (isRouteMaster) {
76028 newTags.route_master = newTags.route;
76029 delete newTags.route;
76031 const origName = tags.name;
76032 const newName = newTags.name;
76033 if (newName && origName && newName !== origName && !newTags.branch) {
76034 const newNames = gatherNames(newTags);
76035 const newSet = /* @__PURE__ */ new Set([...newNames.primary, ...newNames.alternate]);
76036 const isMoved = newSet.has(origName);
76038 const nameParts = origName.split(/[\s\-\/,.]/);
76039 for (let split = nameParts.length; split > 0; split--) {
76040 const name = nameParts.slice(0, split).join(" ");
76041 const branch = nameParts.slice(split).join(" ");
76042 const nameHits = _nsi.matcher.match(k2, v2, name, loc);
76043 if (!nameHits || !nameHits.length)
76045 if (nameHits.some((hit) => hit.itemID === itemID)) {
76047 if (notBranches.test(branch)) {
76048 newTags.name = origName;
76050 const branchHits = _nsi.matcher.match(k2, v2, branch, loc);
76051 if (branchHits && branchHits.length) {
76052 if (branchHits[0].match === "primary" || branchHits[0].match === "alternate") {
76056 newTags.branch = branch;
76065 return { newTags, matched: item };
76067 return changed ? { newTags, matched: null } : null;
76069 function _isGenericName(tags) {
76070 const n3 = tags.name;
76073 const tryNames = { primary: /* @__PURE__ */ new Set([n3]), alternate: /* @__PURE__ */ new Set() };
76074 const tryKVs = gatherKVs(tags);
76075 if (!tryKVs.primary.size && !tryKVs.alternate.size)
76077 const tuples = gatherTuples(tryKVs, tryNames);
76078 for (let i3 = 0; i3 < tuples.length; i3++) {
76079 const tuple = tuples[i3];
76080 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n);
76081 if (hits && hits.length && hits[0].match === "excludeGeneric")
76086 var nsi_default = {
76088 // On init, start preparing the name-suggestion-index
76092 _mainPresetIndex.ensureLoaded().then(() => loadNsiPresets()).then(() => loadNsiData()).then(() => _nsiStatus = "ok").catch(() => _nsiStatus = "failed");
76095 // Reset is called when user saves data to OSM (does nothing here)
76100 // To let other code know how it's going...
76103 // `String`: 'loading', 'ok', 'failed'
76105 status: () => _nsiStatus,
76106 // `isGenericName()`
76107 // Is the `name` tag generic?
76110 // `tags`: `Object` containing the feature's OSM tags
76112 // `true` if it is generic, `false` if not
76114 isGenericName: (tags) => _isGenericName(tags),
76116 // Suggest tag upgrades.
76117 // This function will not modify the input tags, it makes a copy.
76120 // `tags`: `Object` containing the feature's OSM tags
76121 // `loc`: Location where this feature exists, as a [lon, lat]
76123 // `Object` containing the result, or `null` if no changes needed:
76125 // 'newTags': `Object` - The tags the the feature should have
76126 // 'matched': `Object` - The matched item
76129 upgradeTags: (tags, loc) => _upgradeTags(tags, loc),
76131 // Direct access to the NSI cache, useful for testing or breaking things
76134 // `Object`: the internal NSI cache
76139 // modules/services/kartaview.js
76140 var import_rbush8 = __toESM(require_rbush_min());
76141 var apibase2 = "https://kartaview.org";
76142 var maxResults = 1e3;
76144 var tiler4 = utilTiler().zoomExtent([tileZoom, tileZoom]).skipNullIsland(true);
76145 var dispatch7 = dispatch_default("loadedImages");
76146 var imgZoom2 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
76148 var _oscSelectedImage;
76149 var _loadViewerPromise2;
76150 function abortRequest4(controller) {
76151 controller.abort();
76153 function maxPageAtZoom(z2) {
76167 function loadTiles2(which, url, projection2) {
76168 var currZoom = Math.floor(geoScaleToZoom(projection2.scale()));
76169 var tiles = tiler4.getTiles(projection2);
76170 var cache = _oscCache[which];
76171 Object.keys(cache.inflight).forEach(function(k2) {
76172 var wanted = tiles.find(function(tile) {
76173 return k2.indexOf(tile.id + ",") === 0;
76176 abortRequest4(cache.inflight[k2]);
76177 delete cache.inflight[k2];
76180 tiles.forEach(function(tile) {
76181 loadNextTilePage(which, currZoom, url, tile);
76184 function loadNextTilePage(which, currZoom, url, tile) {
76185 var cache = _oscCache[which];
76186 var bbox2 = tile.extent.bbox();
76187 var maxPages = maxPageAtZoom(currZoom);
76188 var nextPage = cache.nextPage[tile.id] || 1;
76189 var params = utilQsString({
76192 // client_id: clientId,
76193 bbTopLeft: [bbox2.maxY, bbox2.minX].join(","),
76194 bbBottomRight: [bbox2.minY, bbox2.maxX].join(",")
76196 if (nextPage > maxPages)
76198 var id2 = tile.id + "," + String(nextPage);
76199 if (cache.loaded[id2] || cache.inflight[id2])
76201 var controller = new AbortController();
76202 cache.inflight[id2] = controller;
76205 signal: controller.signal,
76207 headers: { "Content-Type": "application/x-www-form-urlencoded" }
76209 json_default(url, options2).then(function(data) {
76210 cache.loaded[id2] = true;
76211 delete cache.inflight[id2];
76212 if (!data || !data.currentPageItems || !data.currentPageItems.length) {
76213 throw new Error("No Data");
76215 var features = data.currentPageItems.map(function(item) {
76216 var loc = [+item.lng, +item.lat];
76218 if (which === "images") {
76223 captured_at: item.shot_date || item.date_added,
76224 captured_by: item.username,
76225 imagePath: item.lth_name,
76226 sequence_id: item.sequence_id,
76227 sequence_index: +item.sequence_index
76229 var seq = _oscCache.sequences[d2.sequence_id];
76231 seq = { rotation: 0, images: [] };
76232 _oscCache.sequences[d2.sequence_id] = seq;
76234 seq.images[d2.sequence_index] = d2;
76235 _oscCache.images.forImageKey[d2.key] = d2;
76245 cache.rtree.load(features);
76246 if (data.currentPageItems.length === maxResults) {
76247 cache.nextPage[tile.id] = nextPage + 1;
76248 loadNextTilePage(which, currZoom, url, tile);
76250 cache.nextPage[tile.id] = Infinity;
76252 if (which === "images") {
76253 dispatch7.call("loadedImages");
76255 }).catch(function() {
76256 cache.loaded[id2] = true;
76257 delete cache.inflight[id2];
76260 function partitionViewport2(projection2) {
76261 var z2 = geoScaleToZoom(projection2.scale());
76262 var z22 = Math.ceil(z2 * 2) / 2 + 2.5;
76263 var tiler9 = utilTiler().zoomExtent([z22, z22]);
76264 return tiler9.getTiles(projection2).map(function(tile) {
76265 return tile.extent;
76268 function searchLimited2(limit, projection2, rtree) {
76269 limit = limit || 5;
76270 return partitionViewport2(projection2).reduce(function(result, extent) {
76271 var found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
76274 return found.length ? result.concat(found) : result;
76277 var kartaview_default = {
76282 this.event = utilRebind(this, dispatch7, "on");
76284 reset: function() {
76286 Object.values(_oscCache.images.inflight).forEach(abortRequest4);
76289 images: { inflight: {}, loaded: {}, nextPage: {}, rtree: new import_rbush8.default(), forImageKey: {} },
76292 _oscSelectedImage = null;
76294 images: function(projection2) {
76296 return searchLimited2(limit, projection2, _oscCache.images.rtree);
76298 sequences: function(projection2) {
76299 var viewport = projection2.clipExtent();
76300 var min3 = [viewport[0][0], viewport[1][1]];
76301 var max3 = [viewport[1][0], viewport[0][1]];
76302 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
76303 var sequenceKeys = {};
76304 _oscCache.images.rtree.search(bbox2).forEach(function(d2) {
76305 sequenceKeys[d2.data.sequence_id] = true;
76307 var lineStrings = [];
76308 Object.keys(sequenceKeys).forEach(function(sequenceKey) {
76309 var seq = _oscCache.sequences[sequenceKey];
76310 var images = seq && seq.images;
76313 type: "LineString",
76314 coordinates: images.map(function(d2) {
76316 }).filter(Boolean),
76318 captured_at: images[0] ? images[0].captured_at : null,
76319 captured_by: images[0] ? images[0].captured_by : null,
76325 return lineStrings;
76327 cachedImage: function(imageKey) {
76328 return _oscCache.images.forImageKey[imageKey];
76330 loadImages: function(projection2) {
76331 var url = apibase2 + "/1.0/list/nearby-photos/";
76332 loadTiles2("images", url, projection2);
76334 ensureViewerLoaded: function(context) {
76335 if (_loadViewerPromise2)
76336 return _loadViewerPromise2;
76337 var wrap2 = context.container().select(".photoviewer").selectAll(".kartaview-wrapper").data([0]);
76339 var wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper kartaview-wrapper").classed("hide", true).call(imgZoom2.on("zoom", zoomPan2)).on("dblclick.zoom", null);
76340 wrapEnter.append("div").attr("class", "photo-attribution fillD");
76341 var controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
76342 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
76343 controlsEnter.append("button").on("click.rotate-ccw", rotate(-90)).text("\u293F");
76344 controlsEnter.append("button").on("click.rotate-cw", rotate(90)).text("\u293E");
76345 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
76346 wrapEnter.append("div").attr("class", "kartaview-image-wrap");
76347 context.ui().photoviewer.on("resize.kartaview", function(dimensions) {
76348 imgZoom2.extent([[0, 0], dimensions]).translateExtent([[0, 0], dimensions]);
76350 function zoomPan2(d3_event) {
76351 var t2 = d3_event.transform;
76352 context.container().select(".photoviewer .kartaview-image-wrap").call(utilSetTransform, t2.x, t2.y, t2.k);
76354 function rotate(deg) {
76355 return function() {
76356 if (!_oscSelectedImage)
76358 var sequenceKey = _oscSelectedImage.sequence_id;
76359 var sequence = _oscCache.sequences[sequenceKey];
76362 var r2 = sequence.rotation || 0;
76368 sequence.rotation = r2;
76369 var wrap3 = context.container().select(".photoviewer .kartaview-wrapper");
76370 wrap3.transition().duration(100).call(imgZoom2.transform, identity2);
76371 wrap3.selectAll(".kartaview-image").transition().duration(100).style("transform", "rotate(" + r2 + "deg)");
76374 function step(stepBy) {
76375 return function() {
76376 if (!_oscSelectedImage)
76378 var sequenceKey = _oscSelectedImage.sequence_id;
76379 var sequence = _oscCache.sequences[sequenceKey];
76382 var nextIndex = _oscSelectedImage.sequence_index + stepBy;
76383 var nextImage = sequence.images[nextIndex];
76386 context.map().centerEase(nextImage.loc);
76387 that.selectImage(context, nextImage.key);
76390 _loadViewerPromise2 = Promise.resolve();
76391 return _loadViewerPromise2;
76393 showViewer: function(context) {
76394 var viewer = context.container().select(".photoviewer").classed("hide", false);
76395 var isHidden = viewer.selectAll(".photo-wrapper.kartaview-wrapper.hide").size();
76397 viewer.selectAll(".photo-wrapper:not(.kartaview-wrapper)").classed("hide", true);
76398 viewer.selectAll(".photo-wrapper.kartaview-wrapper").classed("hide", false);
76402 hideViewer: function(context) {
76403 _oscSelectedImage = null;
76404 this.updateUrlImage(null);
76405 var viewer = context.container().select(".photoviewer");
76406 if (!viewer.empty())
76407 viewer.datum(null);
76408 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
76409 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
76410 return this.setStyles(context, null, true);
76412 selectImage: function(context, imageKey) {
76413 var d2 = this.cachedImage(imageKey);
76414 _oscSelectedImage = d2;
76415 this.updateUrlImage(imageKey);
76416 var viewer = context.container().select(".photoviewer");
76417 if (!viewer.empty())
76419 this.setStyles(context, null, true);
76420 context.container().selectAll(".icon-sign").classed("currentView", false);
76423 var wrap2 = context.container().select(".photoviewer .kartaview-wrapper");
76424 var imageWrap = wrap2.selectAll(".kartaview-image-wrap");
76425 var attribution = wrap2.selectAll(".photo-attribution").text("");
76426 wrap2.transition().duration(100).call(imgZoom2.transform, identity2);
76427 imageWrap.selectAll(".kartaview-image").remove();
76429 var sequence = _oscCache.sequences[d2.sequence_id];
76430 var r2 = sequence && sequence.rotation || 0;
76431 imageWrap.append("img").attr("class", "kartaview-image").attr("src", apibase2 + "/" + d2.imagePath).style("transform", "rotate(" + r2 + "deg)");
76432 if (d2.captured_by) {
76433 attribution.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://kartaview.org/user/" + encodeURIComponent(d2.captured_by)).text("@" + d2.captured_by);
76434 attribution.append("span").text("|");
76436 if (d2.captured_at) {
76437 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.captured_at));
76438 attribution.append("span").text("|");
76440 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");
76443 function localeDateString2(s2) {
76446 var options2 = { day: "numeric", month: "short", year: "numeric" };
76447 var d4 = new Date(s2);
76448 if (isNaN(d4.getTime()))
76450 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options2);
76453 getSelectedImage: function() {
76454 return _oscSelectedImage;
76456 getSequenceKeyForImage: function(d2) {
76457 return d2 && d2.sequence_id;
76459 // Updates the currently highlighted sequence and selected bubble.
76460 // Reset is only necessary when interacting with the viewport because
76461 // this implicitly changes the currently selected bubble/sequence
76462 setStyles: function(context, hovered, reset) {
76464 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
76465 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
76467 var hoveredImageKey = hovered && hovered.key;
76468 var hoveredSequenceKey = this.getSequenceKeyForImage(hovered);
76469 var hoveredSequence = hoveredSequenceKey && _oscCache.sequences[hoveredSequenceKey];
76470 var hoveredImageKeys = hoveredSequence && hoveredSequence.images.map(function(d2) {
76473 var viewer = context.container().select(".photoviewer");
76474 var selected = viewer.empty() ? void 0 : viewer.datum();
76475 var selectedImageKey = selected && selected.key;
76476 var selectedSequenceKey = this.getSequenceKeyForImage(selected);
76477 var selectedSequence = selectedSequenceKey && _oscCache.sequences[selectedSequenceKey];
76478 var selectedImageKeys = selectedSequence && selectedSequence.images.map(function(d2) {
76481 var highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
76482 context.container().selectAll(".layer-kartaview .viewfield-group").classed("highlighted", function(d2) {
76483 return highlightedImageKeys.indexOf(d2.key) !== -1;
76484 }).classed("hovered", function(d2) {
76485 return d2.key === hoveredImageKey;
76486 }).classed("currentView", function(d2) {
76487 return d2.key === selectedImageKey;
76489 context.container().selectAll(".layer-kartaview .sequence").classed("highlighted", function(d2) {
76490 return d2.properties.key === hoveredSequenceKey;
76491 }).classed("currentView", function(d2) {
76492 return d2.properties.key === selectedSequenceKey;
76494 context.container().selectAll(".layer-kartaview .viewfield-group .viewfield").attr("d", viewfieldPath);
76495 function viewfieldPath() {
76496 var d2 = this.parentNode.__data__;
76497 if (d2.pano && d2.key !== selectedImageKey) {
76498 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
76500 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
76505 updateUrlImage: function(imageKey) {
76506 if (!window.mocha) {
76507 var hash = utilStringQs(window.location.hash);
76509 hash.photo = "kartaview/" + imageKey;
76513 window.location.replace("#" + utilQsString(hash, true));
76516 cache: function() {
76521 // modules/services/vegbilder.js
76522 var import_rbush9 = __toESM(require_rbush_min());
76524 // modules/services/pannellum_photo.js
76525 var pannellumViewerCSS = "pannellum/pannellum.css";
76526 var pannellumViewerJS = "pannellum/pannellum.js";
76527 var dispatch8 = dispatch_default("viewerChanged");
76528 var _currScenes = [];
76529 var _pannellumViewer;
76530 var pannellum_photo_default = {
76531 init: async function(context, selection2) {
76532 selection2.append("div").attr("class", "photo-frame pannellum-frame").attr("id", "ideditor-pannellum-viewer").classed("hide", true);
76533 if (!window.pannellum) {
76534 await this.loadPannellum(context);
76537 "default": { firstScene: "" },
76540 _pannellumViewer = window.pannellum.viewer("ideditor-pannellum-viewer", options2);
76541 _pannellumViewer.on("mousedown", () => {
76542 select_default2(window).on("pointermove.pannellum mousemove.pannellum", () => {
76543 dispatch8.call("viewerChanged");
76545 }).on("mouseup", () => {
76546 select_default2(window).on("pointermove.pannellum mousemove.pannellum", null);
76547 }).on("animatefinished", () => {
76548 dispatch8.call("viewerChanged");
76550 context.ui().photoviewer.on("resize.pannellum", () => {
76551 _pannellumViewer.resize();
76553 this.event = utilRebind(this, dispatch8, "on");
76556 loadPannellum: function(context) {
76557 const head = select_default2("head");
76558 return Promise.all([
76559 new Promise((resolve, reject) => {
76560 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);
76562 new Promise((resolve, reject) => {
76563 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);
76567 showPhotoFrame: function(context) {
76568 const isHidden = context.selectAll(".photo-frame.pannellum-frame.hide").size();
76570 context.selectAll(".photo-frame:not(.pannellum-frame)").classed("hide", true);
76571 context.selectAll(".photo-frame.pannellum-frame").classed("hide", false);
76575 hidePhotoFrame: function(viewerContext) {
76576 viewerContext.select("photo-frame.pannellum-frame").classed("hide", false);
76579 selectPhoto: function(data, keepOrientation) {
76580 const { key } = data;
76581 if (!(key in _currScenes)) {
76582 let newSceneOptions = {
76583 showFullscreenCtrl: false,
76587 type: "equirectangular",
76588 preview: data.preview_path,
76589 panorama: data.image_path,
76590 northOffset: data.ca
76592 _currScenes.push(key);
76593 _pannellumViewer.addScene(key, newSceneOptions);
76597 if (keepOrientation) {
76598 yaw = this.getYaw();
76599 pitch = _pannellumViewer.getPitch();
76601 _pannellumViewer.loadScene(key, pitch, yaw);
76602 dispatch8.call("viewerChanged");
76603 if (_currScenes.length > 3) {
76604 const old_key = _currScenes.shift();
76605 _pannellumViewer.removeScene(old_key);
76609 getYaw: function() {
76610 return _pannellumViewer.getYaw();
76614 // modules/services/vegbilder.js
76615 var owsEndpoint = "https://www.vegvesen.no/kart/ogc/vegbilder_1_0/ows?";
76616 var tileZoom2 = 14;
76617 var tiler5 = utilTiler().zoomExtent([tileZoom2, tileZoom2]).skipNullIsland(true);
76618 var dispatch9 = dispatch_default("loadedImages", "viewerChanged");
76619 var directionEnum = Object.freeze({
76620 forward: Symbol(0),
76621 backward: Symbol(1)
76624 var _pannellumFrame;
76626 var _loadViewerPromise3;
76627 var _vegbilderCache;
76628 async function fetchAvailableLayers() {
76631 request: "GetCapabilities",
76634 const urlForRequest = owsEndpoint + utilQsString(params);
76635 const response = await xml_default(urlForRequest);
76636 const xPathSelector = "/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType/wfs:Name";
76637 const regexMatcher = /^vegbilder_1_0:Vegbilder(?<image_type>_360)?_(?<year>\d{4})$/;
76638 const NSResolver = response.createNSResolver(response);
76639 const l2 = response.evaluate(
76643 XPathResult.ANY_TYPE
76646 const availableLayers = [];
76647 while ((node = l2.iterateNext()) !== null) {
76648 const match = node.textContent?.match(regexMatcher);
76650 availableLayers.push({
76652 is_sphere: !!match.groups?.image_type,
76653 year: parseInt(match.groups?.year, 10)
76657 return availableLayers;
76659 function filterAvailableLayers(photoContex) {
76660 const fromDateString = photoContex.fromDate();
76661 const toDateString = photoContex.toDate();
76662 const fromYear = fromDateString ? new Date(fromDateString).getFullYear() : 2016;
76663 const toYear = toDateString ? new Date(toDateString).getFullYear() : null;
76664 const showsFlat = photoContex.showsFlat();
76665 const showsPano = photoContex.showsPanoramic();
76666 return Array.from(_vegbilderCache.wfslayers.values()).filter(({ layerInfo }) => layerInfo.year >= fromYear && (!toYear || layerInfo.year <= toYear) && (!layerInfo.is_sphere && showsFlat || layerInfo.is_sphere && showsPano));
76668 function loadWFSLayers(projection2, margin, wfslayers) {
76669 const tiles = tiler5.margin(margin).getTiles(projection2);
76670 for (const cache of wfslayers) {
76671 loadWFSLayer(projection2, cache, tiles);
76674 function loadWFSLayer(projection2, cache, tiles) {
76675 for (const [key, controller] of cache.inflight.entries()) {
76676 const wanted = tiles.some((tile) => key === tile.id);
76678 controller.abort();
76679 cache.inflight.delete(key);
76682 Promise.all(tiles.map(
76683 (tile) => loadTile2(cache, cache.layerInfo.name, tile)
76684 )).then(() => orderSequences(projection2, cache));
76686 async function loadTile2(cache, typename, tile) {
76687 const bbox2 = tile.extent.bbox();
76688 const tileid = tile.id;
76689 if (cache.loaded.get(tileid) === true || cache.inflight.has(tileid))
76693 request: "GetFeature",
76695 typenames: typename,
76696 bbox: [bbox2.minY, bbox2.minX, bbox2.maxY, bbox2.maxX].join(","),
76697 outputFormat: "json"
76699 const controller = new AbortController();
76700 cache.inflight.set(tileid, controller);
76703 signal: controller.signal
76705 const urlForRequest = owsEndpoint + utilQsString(params);
76706 let featureCollection;
76708 featureCollection = await json_default(urlForRequest, options2);
76710 cache.loaded.set(tileid, false);
76713 cache.inflight.delete(tileid);
76715 cache.loaded.set(tileid, true);
76716 if (featureCollection.features.length === 0) {
76719 const features = featureCollection.features.map((feature3) => {
76720 const loc = feature3.geometry.coordinates;
76721 const key = feature3.id;
76722 const properties = feature3.properties;
76725 TIDSPUNKT: captured_at,
76727 URLPREVIEW: preview_path,
76728 BILDETYPE: image_type,
76730 FELTKODE: lane_code
76732 const lane_number = parseInt(lane_code.match(/^[0-9]+/)[0], 10);
76733 const direction = lane_number % 2 === 0 ? directionEnum.backward : directionEnum.forward;
76740 road_reference: roadReference(properties),
76744 captured_at: new Date(captured_at),
76745 is_sphere: image_type === "360"
76747 cache.points.set(key, data);
76756 _vegbilderCache.rtree.load(features);
76757 dispatch9.call("loadedImages");
76759 function orderSequences(projection2, cache) {
76760 const { points } = cache;
76761 const grouped = Array.from(points.values()).reduce((grouped2, image) => {
76762 const key = image.road_reference;
76763 if (grouped2.has(key)) {
76764 grouped2.get(key).push(image);
76766 grouped2.set(key, [image]);
76769 }, /* @__PURE__ */ new Map());
76770 const imageSequences = Array.from(grouped.values()).reduce((imageSequences2, imageGroup) => {
76771 imageGroup.sort((a2, b2) => {
76772 if (a2.captured_at.valueOf() > b2.captured_at.valueOf()) {
76774 } else if (a2.captured_at.valueOf() < b2.captured_at.valueOf()) {
76777 const { direction } = a2;
76778 if (direction === directionEnum.forward) {
76779 return a2.metering - b2.metering;
76781 return b2.metering - a2.metering;
76785 let imageSequence = [imageGroup[0]];
76787 for (const [lastImage, image] of pairs(imageGroup)) {
76788 if (lastImage.ca === null) {
76789 const b2 = projection2(lastImage.loc);
76790 const a2 = projection2(image.loc);
76791 if (!geoVecEqual(a2, b2)) {
76792 angle2 = geoVecAngle(a2, b2);
76793 angle2 *= 180 / Math.PI;
76795 angle2 = angle2 >= 0 ? angle2 : angle2 + 360;
76797 lastImage.ca = angle2;
76799 if (image.direction === lastImage.direction && image.captured_at.valueOf() - lastImage.captured_at.valueOf() <= 2e4) {
76800 imageSequence.push(image);
76802 imageSequences2.push(imageSequence);
76803 imageSequence = [image];
76806 imageSequences2.push(imageSequence);
76807 return imageSequences2;
76809 cache.sequences = imageSequences.map((images) => {
76812 key: images[0].key,
76814 type: "LineString",
76815 coordinates: images.map((image) => image.loc)
76818 for (const image of images) {
76819 _vegbilderCache.image2sequence_map.set(image.key, sequence);
76824 function roadReference(properties) {
76826 FYLKENUMMER: county_number,
76827 VEGKATEGORI: road_class,
76828 VEGSTATUS: road_status,
76829 VEGNUMMER: road_number,
76830 STREKNING: section,
76831 DELSTREKNING: subsection,
76833 KRYSSDEL: junction_part,
76834 SIDEANLEGGSDEL: services_part,
76835 ANKERPUNKT: anker_point,
76839 if (year >= 2020) {
76840 reference = `${road_class}${road_status}${road_number} S${section}D${subsection}`;
76841 if (junction_part) {
76842 reference = `${reference} M${anker_point} KD${junction_part}`;
76843 } else if (services_part) {
76844 reference = `${reference} M${anker_point} SD${services_part}`;
76847 reference = `${county_number}${road_class}${road_status}${road_number} HP${parcel}`;
76851 function localeTimestamp(date) {
76860 return date.toLocaleString(_mainLocalizer.localeCode(), options2);
76862 function partitionViewport3(projection2) {
76863 const zoom = geoScaleToZoom(projection2.scale());
76864 const roundZoom = Math.ceil(zoom * 2) / 2 + 2.5;
76865 const tiler9 = utilTiler().zoomExtent([roundZoom, roundZoom]);
76866 return tiler9.getTiles(projection2).map((tile) => tile.extent);
76868 function searchLimited3(limit, projection2, rtree) {
76870 return partitionViewport3(projection2).reduce((result, extent) => {
76871 const found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
76872 return result.concat(found);
76875 var vegbilder_default = {
76877 this.event = utilRebind(this, dispatch9, "on");
76879 reset: async function() {
76880 if (_vegbilderCache) {
76881 for (const layer of _vegbilderCache.wfslayers.values()) {
76882 for (const controller of layer.inflight.values()) {
76883 controller.abort();
76887 _vegbilderCache = {
76888 wfslayers: /* @__PURE__ */ new Map(),
76889 rtree: new import_rbush9.default(),
76890 image2sequence_map: /* @__PURE__ */ new Map()
76892 const availableLayers = await fetchAvailableLayers();
76893 const { wfslayers } = _vegbilderCache;
76894 for (const layerInfo of availableLayers) {
76897 loaded: /* @__PURE__ */ new Map(),
76898 inflight: /* @__PURE__ */ new Map(),
76899 points: /* @__PURE__ */ new Map(),
76902 wfslayers.set(layerInfo.name, cache);
76905 images: function(projection2) {
76907 return searchLimited3(limit, projection2, _vegbilderCache.rtree);
76909 sequences: function(projection2) {
76910 const viewport = projection2.clipExtent();
76911 const min3 = [viewport[0][0], viewport[1][1]];
76912 const max3 = [viewport[1][0], viewport[0][1]];
76913 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
76914 const seen = /* @__PURE__ */ new Set();
76915 const line_strings = [];
76916 for (const { data } of _vegbilderCache.rtree.search(bbox2)) {
76917 const sequence = _vegbilderCache.image2sequence_map.get(data.key);
76920 const { key, geometry, images } = sequence;
76925 type: "LineString",
76926 coordinates: geometry.coordinates,
76930 line_strings.push(line);
76932 return line_strings;
76934 cachedImage: function(key) {
76935 for (const { points } of _vegbilderCache.wfslayers.values()) {
76936 if (points.has(key))
76937 return points.get(key);
76940 getSequenceForImage: function(image) {
76941 return _vegbilderCache?.image2sequence_map.get(image?.key);
76943 loadImages: async function(context, margin) {
76944 if (!_vegbilderCache) {
76945 await this.reset();
76948 const wfslayers = filterAvailableLayers(context.photos());
76949 loadWFSLayers(context.projection, margin, wfslayers);
76951 photoFrame: function() {
76952 return _currentFrame;
76954 ensureViewerLoaded: function(context) {
76955 if (_loadViewerPromise3)
76956 return _loadViewerPromise3;
76957 const step = (stepBy) => () => {
76958 const viewer = context.container().select(".photoviewer");
76959 const selected = viewer.empty() ? void 0 : viewer.datum();
76962 const sequence = this.getSequenceForImage(selected);
76963 const nextIndex = sequence.images.indexOf(selected) + stepBy;
76964 const nextImage = sequence.images[nextIndex];
76967 context.map().centerEase(nextImage.loc);
76968 this.selectImage(context, nextImage.key, true);
76970 const wrap2 = context.container().select(".photoviewer").selectAll(".vegbilder-wrapper").data([0]);
76971 const wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper vegbilder-wrapper").classed("hide", true);
76972 wrapEnter.append("div").attr("class", "photo-attribution fillD");
76973 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
76974 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
76975 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
76976 _loadViewerPromise3 = Promise.all([
76977 pannellum_photo_default.init(context, wrapEnter),
76978 plane_photo_default.init(context, wrapEnter)
76979 ]).then(([pannellumPhotoFrame, planePhotoFrame]) => {
76980 _pannellumFrame = pannellumPhotoFrame;
76981 _pannellumFrame.event.on("viewerChanged", () => dispatch9.call("viewerChanged"));
76982 _planeFrame = planePhotoFrame;
76983 _planeFrame.event.on("viewerChanged", () => dispatch9.call("viewerChanged"));
76985 return _loadViewerPromise3;
76987 selectImage: function(context, key, keepOrientation) {
76988 const d2 = this.cachedImage(key);
76989 this.updateUrlImage(key);
76990 const viewer = context.container().select(".photoviewer");
76991 if (!viewer.empty()) {
76994 this.setStyles(context, null, true);
76997 const wrap2 = context.container().select(".photoviewer .vegbilder-wrapper");
76998 const attribution = wrap2.selectAll(".photo-attribution").text("");
76999 if (d2.captured_at) {
77000 attribution.append("span").attr("class", "captured_at").text(localeTimestamp(d2.captured_at));
77002 attribution.append("a").attr("target", "_blank").attr("href", "https://vegvesen.no").call(_t.append("vegbilder.publisher"));
77003 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"));
77004 _currentFrame = d2.is_sphere ? _pannellumFrame : _planeFrame;
77005 _currentFrame.selectPhoto(d2, keepOrientation).showPhotoFrame(wrap2);
77008 showViewer: function(context) {
77009 const viewer = context.container().select(".photoviewer").classed("hide", false);
77010 const isHidden = viewer.selectAll(".photo-wrapper.vegbilder-wrapper.hide").size();
77012 viewer.selectAll(".photo-wrapper:not(.vegbilder-wrapper)").classed("hide", true);
77013 viewer.selectAll(".photo-wrapper.vegbilder-wrapper").classed("hide", false);
77017 hideViewer: function(context) {
77018 this.updateUrlImage(null);
77019 const viewer = context.container().select(".photoviewer");
77020 if (!viewer.empty())
77021 viewer.datum(null);
77022 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
77023 context.container().selectAll(".viewfield-group, .sequence").classed("currentView", false);
77024 return this.setStyles(context, null, true);
77026 // Updates the currently highlighted sequence and selected bubble.
77027 // Reset is only necessary when interacting with the viewport because
77028 // this implicitly changes the currently selected bubble/sequence
77029 setStyles: function(context, hovered, reset) {
77031 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
77032 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
77034 const hoveredImageKey = hovered?.key;
77035 const hoveredSequence = this.getSequenceForImage(hovered);
77036 const hoveredSequenceKey = hoveredSequence?.key;
77037 const hoveredImageKeys = hoveredSequence?.images.map((d2) => d2.key) ?? [];
77038 const viewer = context.container().select(".photoviewer");
77039 const selected = viewer.empty() ? void 0 : viewer.datum();
77040 const selectedImageKey = selected?.key;
77041 const selectedSequence = this.getSequenceForImage(selected);
77042 const selectedSequenceKey = selectedSequence?.key;
77043 const selectedImageKeys = selectedSequence?.images.map((d2) => d2.key) ?? [];
77044 const highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
77045 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);
77046 context.container().selectAll(".layer-vegbilder .sequence").classed("highlighted", (d2) => d2.key === hoveredSequenceKey).classed("currentView", (d2) => d2.key === selectedSequenceKey);
77047 context.container().selectAll(".layer-vegbilder .viewfield-group .viewfield").attr("d", viewfieldPath);
77048 function viewfieldPath() {
77049 const d2 = this.parentNode.__data__;
77050 if (d2.is_sphere && d2.key !== selectedImageKey) {
77051 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
77053 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
77058 updateUrlImage: function(key) {
77059 if (!window.mocha) {
77060 const hash = utilStringQs(window.location.hash);
77062 hash.photo = "vegbilder/" + key;
77066 window.location.replace("#" + utilQsString(hash, true));
77069 validHere: function(extent) {
77070 const bbox2 = Object.values(extent.bbox());
77071 return iso1A2Codes(bbox2).includes("NO");
77073 cache: function() {
77074 return _vegbilderCache;
77078 // node_modules/osm-auth/src/osm-auth.mjs
77079 var import_store = __toESM(require_store_legacy(), 1);
77080 function osmAuth(o2) {
77082 oauth2.authenticated = function() {
77083 return !!token("oauth2_access_token");
77085 oauth2.logout = function() {
77086 token("oauth2_access_token", "");
77087 token("oauth_token", "");
77088 token("oauth_token_secret", "");
77089 token("oauth_request_token_secret", "");
77092 oauth2.authenticate = function(callback) {
77093 if (oauth2.authenticated()) {
77094 callback(null, oauth2);
77098 _generatePkceChallenge(function(pkce) {
77099 _authenticate(pkce, callback);
77102 oauth2.authenticateAsync = function() {
77103 if (oauth2.authenticated()) {
77104 return Promise.resolve(oauth2);
77107 return new Promise((resolve, reject) => {
77108 var errback = (err, result) => {
77110 reject(new Error(err));
77115 _generatePkceChallenge((pkce) => _authenticate(pkce, errback));
77118 function _authenticate(pkce, callback) {
77119 var state = generateState();
77120 var url = o2.url + "/oauth2/authorize?" + utilQsString2({
77121 client_id: o2.client_id,
77122 redirect_uri: o2.redirect_uri,
77123 response_type: "code",
77126 code_challenge: pkce.code_challenge,
77127 code_challenge_method: pkce.code_challenge_method
77129 if (o2.singlepage) {
77130 if (!import_store.default.enabled) {
77131 var error = new Error("local storage unavailable, but require in singlepage mode");
77132 error.status = "pkce-localstorage-unavailable";
77136 var params = utilStringQs2(window.location.search.slice(1));
77138 oauth2.bootstrapToken(params.code, callback);
77140 token("oauth2_state", state);
77141 token("oauth2_pkce_code_verifier", pkce.code_verifier);
77142 window.location = url;
77150 ["left", window.screen.width / 2 - w2 / 2],
77151 ["top", window.screen.height / 2 - h2 / 2]
77152 ].map(function(x2) {
77153 return x2.join("=");
77155 var popup = window.open("about:blank", "oauth_window", settings);
77156 oauth2.popupWindow = popup;
77157 popup.location = url;
77159 error = new Error("Popup was blocked");
77160 error.status = "popup-blocked";
77164 window.authComplete = function(url2) {
77165 var params2 = utilStringQs2(url2.split("?")[1]);
77166 if (params2.state !== state) {
77167 error = new Error("Invalid state");
77168 error.status = "invalid-state";
77172 _getAccessToken(params2.code, pkce.code_verifier, accessTokenDone);
77173 delete window.authComplete;
77175 function accessTokenDone(err, xhr) {
77181 var access_token = JSON.parse(xhr.response);
77182 token("oauth2_access_token", access_token.access_token);
77183 callback(null, oauth2);
77186 function _getAccessToken(auth_code, code_verifier, accessTokenDone) {
77187 var url = o2.url + "/oauth2/token?" + utilQsString2({
77188 client_id: o2.client_id,
77189 redirect_uri: o2.redirect_uri,
77190 grant_type: "authorization_code",
77194 oauth2.rawxhr("POST", url, null, null, null, accessTokenDone);
77197 oauth2.bringPopupWindowToFront = function() {
77198 var broughtPopupToFront = false;
77200 if (oauth2.popupWindow && !oauth2.popupWindow.closed) {
77201 oauth2.popupWindow.focus();
77202 broughtPopupToFront = true;
77206 return broughtPopupToFront;
77208 oauth2.bootstrapToken = function(auth_code, callback) {
77209 var state = token("oauth2_state");
77210 token("oauth2_state", "");
77211 var params = utilStringQs2(window.location.search.slice(1));
77212 if (params.state !== state) {
77213 var error = new Error("Invalid state");
77214 error.status = "invalid-state";
77218 var code_verifier = token("oauth2_pkce_code_verifier");
77219 token("oauth2_pkce_code_verifier", "");
77220 _getAccessToken(auth_code, code_verifier, accessTokenDone);
77221 function accessTokenDone(err, xhr) {
77227 var access_token = JSON.parse(xhr.response);
77228 token("oauth2_access_token", access_token.access_token);
77229 callback(null, oauth2);
77232 oauth2.fetch = function(resource, options2) {
77233 if (oauth2.authenticated()) {
77237 return oauth2.authenticateAsync().then(_doFetch);
77239 return Promise.reject(new Error("not authenticated"));
77242 function _doFetch() {
77243 options2 = options2 || {};
77244 if (!options2.headers) {
77245 options2.headers = { "Content-Type": "application/x-www-form-urlencoded" };
77247 options2.headers.Authorization = "Bearer " + token("oauth2_access_token");
77248 return fetch(resource, options2);
77251 oauth2.xhr = function(options2, callback) {
77252 if (oauth2.authenticated()) {
77256 oauth2.authenticate(_doXHR);
77259 callback("not authenticated", null);
77263 function _doXHR() {
77264 var url = options2.prefix !== false ? o2.url + options2.path : options2.path;
77265 return oauth2.rawxhr(
77268 token("oauth2_access_token"),
77274 function done(err, xhr) {
77277 } else if (xhr.responseXML) {
77278 callback(err, xhr.responseXML);
77280 callback(err, xhr.response);
77284 oauth2.rawxhr = function(method, url, access_token, data, headers, callback) {
77285 headers = headers || { "Content-Type": "application/x-www-form-urlencoded" };
77286 if (access_token) {
77287 headers.Authorization = "Bearer " + access_token;
77289 var xhr = new XMLHttpRequest();
77290 xhr.onreadystatechange = function() {
77291 if (4 === xhr.readyState && 0 !== xhr.status) {
77292 if (/^20\d$/.test(xhr.status)) {
77293 callback(null, xhr);
77295 callback(xhr, null);
77299 xhr.onerror = function(e3) {
77300 callback(e3, null);
77302 xhr.open(method, url, true);
77303 for (var h2 in headers)
77304 xhr.setRequestHeader(h2, headers[h2]);
77308 oauth2.preauth = function(val) {
77309 if (val && val.access_token) {
77310 token("oauth2_access_token", val.access_token);
77314 oauth2.options = function(val) {
77315 if (!arguments.length)
77318 o2.url = o2.url || "https://www.openstreetmap.org";
77319 o2.auto = o2.auto || false;
77320 o2.singlepage = o2.singlepage || false;
77321 o2.loading = o2.loading || function() {
77323 o2.done = o2.done || function() {
77325 return oauth2.preauth(o2);
77328 if (import_store.default.enabled) {
77329 token = function(x2, y2) {
77330 if (arguments.length === 1)
77331 return import_store.default.get(o2.url + x2);
77332 else if (arguments.length === 2)
77333 return import_store.default.set(o2.url + x2, y2);
77337 token = function(x2, y2) {
77338 if (arguments.length === 1)
77339 return storage[o2.url + x2];
77340 else if (arguments.length === 2)
77341 return storage[o2.url + x2] = y2;
77344 oauth2.options(o2);
77347 function utilQsString2(obj) {
77348 return Object.keys(obj).filter(function(key) {
77349 return obj[key] !== void 0;
77350 }).sort().map(function(key) {
77351 return encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]);
77354 function utilStringQs2(str2) {
77356 while (i3 < str2.length && (str2[i3] === "?" || str2[i3] === "#"))
77358 str2 = str2.slice(i3);
77359 return str2.split("&").reduce(function(obj, pair3) {
77360 var parts = pair3.split("=");
77361 if (parts.length === 2) {
77362 obj[parts[0]] = decodeURIComponent(parts[1]);
77367 function supportsWebCryptoAPI() {
77368 return window && window.crypto && window.crypto.getRandomValues && window.crypto.subtle && window.crypto.subtle.digest;
77370 function _generatePkceChallenge(callback) {
77372 if (supportsWebCryptoAPI()) {
77373 var random = window.crypto.getRandomValues(new Uint8Array(32));
77374 code_verifier = base64(random.buffer);
77375 var verifier = Uint8Array.from(Array.from(code_verifier).map(function(char) {
77376 return char.charCodeAt(0);
77378 window.crypto.subtle.digest("SHA-256", verifier).then(function(hash) {
77379 var code_challenge = base64(hash);
77383 code_challenge_method: "S256"
77387 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
77388 code_verifier = "";
77389 for (var i3 = 0; i3 < 64; i3++) {
77390 code_verifier += chars[Math.floor(Math.random() * chars.length)];
77394 code_challenge: code_verifier,
77395 code_challenge_method: "plain"
77399 function generateState() {
77401 if (supportsWebCryptoAPI()) {
77402 var random = window.crypto.getRandomValues(new Uint8Array(32));
77403 state = base64(random.buffer);
77405 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
77407 for (var i3 = 0; i3 < 64; i3++) {
77408 state += chars[Math.floor(Math.random() * chars.length)];
77413 function base64(buffer) {
77414 return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/[=]/g, "");
77417 // modules/services/osm.js
77418 var import_rbush10 = __toESM(require_rbush_min());
77419 var tiler6 = utilTiler();
77420 var dispatch10 = dispatch_default("apiStatusChange", "authLoading", "authDone", "change", "loading", "loaded", "loadedNotes");
77421 var urlroot = osmApiConnections[0].url;
77422 var redirectPath = window.location.origin + window.location.pathname;
77423 var oauth = osmAuth({
77425 client_id: osmApiConnections[0].client_id,
77426 client_secret: osmApiConnections[0].client_secret,
77427 scope: "read_prefs write_prefs write_api read_gpx write_notes",
77428 redirect_uri: redirectPath + "land.html",
77429 loading: authLoading,
77432 var _apiConnections = osmApiConnections;
77433 var _imageryBlocklists = [/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/];
77434 var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new import_rbush10.default() };
77435 var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new import_rbush10.default() };
77436 var _userCache = { toLoad: {}, user: {} };
77437 var _cachedApiStatus;
77438 var _changeset = {};
77439 var _deferred = /* @__PURE__ */ new Set();
77440 var _connectionID = 1;
77441 var _tileZoom4 = 16;
77442 var _noteZoom = 12;
77443 var _rateLimitError;
77444 var _userChangesets;
77447 var _maxWayNodes = 2e3;
77448 function authLoading() {
77449 dispatch10.call("authLoading");
77451 function authDone() {
77452 dispatch10.call("authDone");
77454 function abortRequest5(controllerOrXHR) {
77455 if (controllerOrXHR) {
77456 controllerOrXHR.abort();
77459 function hasInflightRequests(cache) {
77460 return Object.keys(cache.inflight).length;
77462 function abortUnwantedRequests4(cache, visibleTiles) {
77463 Object.keys(cache.inflight).forEach(function(k2) {
77464 if (cache.toLoad[k2])
77466 if (visibleTiles.find(function(tile) {
77467 return k2 === tile.id;
77470 abortRequest5(cache.inflight[k2]);
77471 delete cache.inflight[k2];
77474 function getLoc(attrs) {
77475 var lon = attrs.lon && attrs.lon.value;
77476 var lat = attrs.lat && attrs.lat.value;
77477 return [Number(lon), Number(lat)];
77479 function getNodes(obj) {
77480 var elems = obj.getElementsByTagName("nd");
77481 var nodes = new Array(elems.length);
77482 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77483 nodes[i3] = "n" + elems[i3].attributes.ref.value;
77487 function getNodesJSON(obj) {
77488 var elems = obj.nodes;
77489 var nodes = new Array(elems.length);
77490 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77491 nodes[i3] = "n" + elems[i3];
77495 function getTags(obj) {
77496 var elems = obj.getElementsByTagName("tag");
77498 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77499 var attrs = elems[i3].attributes;
77500 tags[attrs.k.value] = attrs.v.value;
77504 function getMembers(obj) {
77505 var elems = obj.getElementsByTagName("member");
77506 var members = new Array(elems.length);
77507 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77508 var attrs = elems[i3].attributes;
77510 id: attrs.type.value[0] + attrs.ref.value,
77511 type: attrs.type.value,
77512 role: attrs.role.value
77517 function getMembersJSON(obj) {
77518 var elems = obj.members;
77519 var members = new Array(elems.length);
77520 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77521 var attrs = elems[i3];
77523 id: attrs.type[0] + attrs.ref,
77530 function getVisible(attrs) {
77531 return !attrs.visible || attrs.visible.value !== "false";
77533 function parseComments(comments) {
77534 var parsedComments = [];
77535 for (var i3 = 0; i3 < comments.length; i3++) {
77536 var comment = comments[i3];
77537 if (comment.nodeName === "comment") {
77538 var childNodes = comment.childNodes;
77539 var parsedComment = {};
77540 for (var j3 = 0; j3 < childNodes.length; j3++) {
77541 var node = childNodes[j3];
77542 var nodeName = node.nodeName;
77543 if (nodeName === "#text")
77545 parsedComment[nodeName] = node.textContent;
77546 if (nodeName === "uid") {
77547 var uid = node.textContent;
77548 if (uid && !_userCache.user[uid]) {
77549 _userCache.toLoad[uid] = true;
77553 if (parsedComment) {
77554 parsedComments.push(parsedComment);
77558 return parsedComments;
77560 function encodeNoteRtree(note) {
77569 var jsonparsers = {
77570 node: function nodeData(obj, uid) {
77571 return new osmNode({
77573 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77574 version: obj.version && obj.version.toString(),
77575 changeset: obj.changeset && obj.changeset.toString(),
77576 timestamp: obj.timestamp,
77578 uid: obj.uid && obj.uid.toString(),
77579 loc: [Number(obj.lon), Number(obj.lat)],
77583 way: function wayData(obj, uid) {
77584 return new osmWay({
77586 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77587 version: obj.version && obj.version.toString(),
77588 changeset: obj.changeset && obj.changeset.toString(),
77589 timestamp: obj.timestamp,
77591 uid: obj.uid && obj.uid.toString(),
77593 nodes: getNodesJSON(obj)
77596 relation: function relationData(obj, uid) {
77597 return new osmRelation({
77599 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77600 version: obj.version && obj.version.toString(),
77601 changeset: obj.changeset && obj.changeset.toString(),
77602 timestamp: obj.timestamp,
77604 uid: obj.uid && obj.uid.toString(),
77606 members: getMembersJSON(obj)
77609 user: function parseUser(obj, uid) {
77612 display_name: obj.display_name,
77613 account_created: obj.account_created,
77614 image_url: obj.img && obj.img.href,
77615 changesets_count: obj.changesets && obj.changesets.count && obj.changesets.count.toString() || "0",
77616 active_blocks: obj.blocks && obj.blocks.received && obj.blocks.received.active && obj.blocks.received.active.toString() || "0"
77620 function parseJSON(payload, callback, options2) {
77621 options2 = Object.assign({ skipSeen: true }, options2);
77623 return callback({ message: "No JSON", status: -1 });
77625 var json = payload;
77626 if (typeof json !== "object")
77627 json = JSON.parse(payload);
77628 if (!json.elements)
77629 return callback({ message: "No JSON", status: -1 });
77630 var children2 = json.elements;
77631 var handle = window.requestIdleCallback(function() {
77632 _deferred.delete(handle);
77635 for (var i3 = 0; i3 < children2.length; i3++) {
77636 result = parseChild(children2[i3]);
77638 results.push(result);
77640 callback(null, results);
77642 _deferred.add(handle);
77643 function parseChild(child) {
77644 var parser3 = jsonparsers[child.type];
77648 uid = osmEntity.id.fromOSM(child.type, child.id);
77649 if (options2.skipSeen) {
77650 if (_tileCache.seen[uid])
77652 _tileCache.seen[uid] = true;
77654 return parser3(child, uid);
77657 function parseUserJSON(payload, callback, options2) {
77658 options2 = Object.assign({ skipSeen: true }, options2);
77660 return callback({ message: "No JSON", status: -1 });
77662 var json = payload;
77663 if (typeof json !== "object")
77664 json = JSON.parse(payload);
77665 if (!json.users && !json.user)
77666 return callback({ message: "No JSON", status: -1 });
77667 var objs = json.users || [json];
77668 var handle = window.requestIdleCallback(function() {
77669 _deferred.delete(handle);
77672 for (var i3 = 0; i3 < objs.length; i3++) {
77673 result = parseObj(objs[i3]);
77675 results.push(result);
77677 callback(null, results);
77679 _deferred.add(handle);
77680 function parseObj(obj) {
77681 var uid = obj.user.id && obj.user.id.toString();
77682 if (options2.skipSeen && _userCache.user[uid]) {
77683 delete _userCache.toLoad[uid];
77686 var user = jsonparsers.user(obj.user, uid);
77687 _userCache.user[uid] = user;
77688 delete _userCache.toLoad[uid];
77693 node: function nodeData2(obj, uid) {
77694 var attrs = obj.attributes;
77695 return new osmNode({
77697 visible: getVisible(attrs),
77698 version: attrs.version.value,
77699 changeset: attrs.changeset && attrs.changeset.value,
77700 timestamp: attrs.timestamp && attrs.timestamp.value,
77701 user: attrs.user && attrs.user.value,
77702 uid: attrs.uid && attrs.uid.value,
77703 loc: getLoc(attrs),
77707 way: function wayData2(obj, uid) {
77708 var attrs = obj.attributes;
77709 return new osmWay({
77711 visible: getVisible(attrs),
77712 version: attrs.version.value,
77713 changeset: attrs.changeset && attrs.changeset.value,
77714 timestamp: attrs.timestamp && attrs.timestamp.value,
77715 user: attrs.user && attrs.user.value,
77716 uid: attrs.uid && attrs.uid.value,
77717 tags: getTags(obj),
77718 nodes: getNodes(obj)
77721 relation: function relationData2(obj, uid) {
77722 var attrs = obj.attributes;
77723 return new osmRelation({
77725 visible: getVisible(attrs),
77726 version: attrs.version.value,
77727 changeset: attrs.changeset && attrs.changeset.value,
77728 timestamp: attrs.timestamp && attrs.timestamp.value,
77729 user: attrs.user && attrs.user.value,
77730 uid: attrs.uid && attrs.uid.value,
77731 tags: getTags(obj),
77732 members: getMembers(obj)
77735 note: function parseNote(obj, uid) {
77736 var attrs = obj.attributes;
77737 var childNodes = obj.childNodes;
77740 props.loc = getLoc(attrs);
77741 var coincident = false;
77742 var epsilon3 = 1e-5;
77745 props.loc = geoVecAdd(props.loc, [epsilon3, epsilon3]);
77747 var bbox2 = geoExtent(props.loc).bbox();
77748 coincident = _noteCache.rtree.search(bbox2).length;
77749 } while (coincident);
77750 for (var i3 = 0; i3 < childNodes.length; i3++) {
77751 var node = childNodes[i3];
77752 var nodeName = node.nodeName;
77753 if (nodeName === "#text")
77755 if (nodeName === "comments") {
77756 props[nodeName] = parseComments(node.childNodes);
77758 props[nodeName] = node.textContent;
77761 var note = new osmNote(props);
77762 var item = encodeNoteRtree(note);
77763 _noteCache.note[note.id] = note;
77764 _noteCache.rtree.insert(item);
77767 user: function parseUser2(obj, uid) {
77768 var attrs = obj.attributes;
77771 display_name: attrs.display_name && attrs.display_name.value,
77772 account_created: attrs.account_created && attrs.account_created.value,
77773 changesets_count: "0",
77776 var img = obj.getElementsByTagName("img");
77777 if (img && img[0] && img[0].getAttribute("href")) {
77778 user.image_url = img[0].getAttribute("href");
77780 var changesets = obj.getElementsByTagName("changesets");
77781 if (changesets && changesets[0] && changesets[0].getAttribute("count")) {
77782 user.changesets_count = changesets[0].getAttribute("count");
77784 var blocks = obj.getElementsByTagName("blocks");
77785 if (blocks && blocks[0]) {
77786 var received = blocks[0].getElementsByTagName("received");
77787 if (received && received[0] && received[0].getAttribute("active")) {
77788 user.active_blocks = received[0].getAttribute("active");
77791 _userCache.user[uid] = user;
77792 delete _userCache.toLoad[uid];
77796 function parseXML(xml, callback, options2) {
77797 options2 = Object.assign({ skipSeen: true }, options2);
77798 if (!xml || !xml.childNodes) {
77799 return callback({ message: "No XML", status: -1 });
77801 var root3 = xml.childNodes[0];
77802 var children2 = root3.childNodes;
77803 var handle = window.requestIdleCallback(function() {
77804 _deferred.delete(handle);
77807 for (var i3 = 0; i3 < children2.length; i3++) {
77808 result = parseChild(children2[i3]);
77810 results.push(result);
77812 callback(null, results);
77814 _deferred.add(handle);
77815 function parseChild(child) {
77816 var parser3 = parsers[child.nodeName];
77820 if (child.nodeName === "user") {
77821 uid = child.attributes.id.value;
77822 if (options2.skipSeen && _userCache.user[uid]) {
77823 delete _userCache.toLoad[uid];
77826 } else if (child.nodeName === "note") {
77827 uid = child.getElementsByTagName("id")[0].textContent;
77829 uid = osmEntity.id.fromOSM(child.nodeName, child.attributes.id.value);
77830 if (options2.skipSeen) {
77831 if (_tileCache.seen[uid])
77833 _tileCache.seen[uid] = true;
77836 return parser3(child, uid);
77839 function updateRtree4(item, replace) {
77840 _noteCache.rtree.remove(item, function isEql(a2, b2) {
77841 return a2.data.id === b2.data.id;
77844 _noteCache.rtree.insert(item);
77847 function wrapcb(thisArg, callback, cid) {
77848 return function(err, result) {
77850 if (err.status === 400 || err.status === 401 || err.status === 403) {
77853 return callback.call(thisArg, err);
77854 } else if (thisArg.getConnectionId() !== cid) {
77855 return callback.call(thisArg, { message: "Connection Switched", status: -1 });
77857 return callback.call(thisArg, err, result);
77861 var osm_default = {
77863 utilRebind(this, dispatch10, "on");
77865 reset: function() {
77866 Array.from(_deferred).forEach(function(handle) {
77867 window.cancelIdleCallback(handle);
77868 _deferred.delete(handle);
77871 _userChangesets = void 0;
77872 _userDetails = void 0;
77873 _rateLimitError = void 0;
77874 Object.values(_tileCache.inflight).forEach(abortRequest5);
77875 Object.values(_noteCache.inflight).forEach(abortRequest5);
77876 Object.values(_noteCache.inflightPost).forEach(abortRequest5);
77877 if (_changeset.inflight)
77878 abortRequest5(_changeset.inflight);
77879 _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new import_rbush10.default() };
77880 _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new import_rbush10.default() };
77881 _userCache = { toLoad: {}, user: {} };
77882 _cachedApiStatus = void 0;
77886 getConnectionId: function() {
77887 return _connectionID;
77889 getUrlRoot: function() {
77892 changesetURL: function(changesetID) {
77893 return urlroot + "/changeset/" + changesetID;
77895 changesetsURL: function(center, zoom) {
77896 var precision2 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
77897 return urlroot + "/history#map=" + Math.floor(zoom) + "/" + center[1].toFixed(precision2) + "/" + center[0].toFixed(precision2);
77899 entityURL: function(entity) {
77900 return urlroot + "/" + entity.type + "/" + entity.osmId();
77902 historyURL: function(entity) {
77903 return urlroot + "/" + entity.type + "/" + entity.osmId() + "/history";
77905 userURL: function(username) {
77906 return urlroot + "/user/" + encodeURIComponent(username);
77908 noteURL: function(note) {
77909 return urlroot + "/note/" + note.id;
77911 noteReportURL: function(note) {
77912 return urlroot + "/reports/new?reportable_type=Note&reportable_id=" + note.id;
77914 // Generic method to load data from the OSM API
77915 // Can handle either auth or unauth calls.
77916 loadFromAPI: function(path, callback, options2) {
77917 options2 = Object.assign({ skipSeen: true }, options2);
77919 var cid = _connectionID;
77920 function done(err, payload) {
77921 if (that.getConnectionId() !== cid) {
77923 callback({ message: "Connection Switched", status: -1 });
77926 var isAuthenticated = that.authenticated();
77927 if (isAuthenticated && err && err.status && (err.status === 400 || err.status === 401 || err.status === 403)) {
77929 that.loadFromAPI(path, callback, options2);
77931 if (!isAuthenticated && !_rateLimitError && err && err.status && (err.status === 509 || err.status === 429)) {
77932 _rateLimitError = err;
77933 dispatch10.call("change");
77934 that.reloadApiStatus();
77935 } else if (err && _cachedApiStatus === "online" || !err && _cachedApiStatus !== "online") {
77936 that.reloadApiStatus();
77940 return callback(err);
77942 if (path.indexOf(".json") !== -1) {
77943 return parseJSON(payload, callback, options2);
77945 return parseXML(payload, callback, options2);
77951 if (this.authenticated()) {
77952 return oauth.xhr({ method: "GET", path }, done);
77954 var url = urlroot + path;
77955 var controller = new AbortController();
77957 if (path.indexOf(".json") !== -1) {
77962 fn(url, { signal: controller.signal }).then(function(data) {
77964 }).catch(function(err) {
77965 if (err.name === "AbortError")
77967 var match = err.message.match(/^\d{3}/);
77969 done({ status: +match[0], statusText: err.message });
77977 // Load a single entity by id (ways and relations use the `/full` call to include
77978 // nodes and members). Parent relations are not included, see `loadEntityRelations`.
77979 // GET /api/0.6/node/#id
77980 // GET /api/0.6/[way|relation]/#id/full
77981 loadEntity: function(id2, callback) {
77982 var type2 = osmEntity.id.type(id2);
77983 var osmID = osmEntity.id.toOSM(id2);
77984 var options2 = { skipSeen: false };
77986 "/api/0.6/" + type2 + "/" + osmID + (type2 !== "node" ? "/full" : "") + ".json",
77987 function(err, entities) {
77989 callback(err, { data: entities });
77994 // Load a single entity with a specific version
77995 // GET /api/0.6/[node|way|relation]/#id/#version
77996 loadEntityVersion: function(id2, version, callback) {
77997 var type2 = osmEntity.id.type(id2);
77998 var osmID = osmEntity.id.toOSM(id2);
77999 var options2 = { skipSeen: false };
78001 "/api/0.6/" + type2 + "/" + osmID + "/" + version + ".json",
78002 function(err, entities) {
78004 callback(err, { data: entities });
78009 // Load the relations of a single entity with the given.
78010 // GET /api/0.6/[node|way|relation]/#id/relations
78011 loadEntityRelations: function(id2, callback) {
78012 var type2 = osmEntity.id.type(id2);
78013 var osmID = osmEntity.id.toOSM(id2);
78014 var options2 = { skipSeen: false };
78016 "/api/0.6/" + type2 + "/" + osmID + "/relations.json",
78017 function(err, entities) {
78019 callback(err, { data: entities });
78024 // Load multiple entities in chunks
78025 // (note: callback may be called multiple times)
78026 // Unlike `loadEntity`, child nodes and members are not fetched
78027 // GET /api/0.6/[nodes|ways|relations]?#parameters
78028 loadMultiple: function(ids, callback) {
78030 var groups = utilArrayGroupBy(utilArrayUniq(ids), osmEntity.id.type);
78031 Object.keys(groups).forEach(function(k2) {
78032 var type2 = k2 + "s";
78033 var osmIDs = groups[k2].map(function(id2) {
78034 return osmEntity.id.toOSM(id2);
78036 var options2 = { skipSeen: false };
78037 utilArrayChunk(osmIDs, 150).forEach(function(arr) {
78039 "/api/0.6/" + type2 + ".json?" + type2 + "=" + arr.join(),
78040 function(err, entities) {
78042 callback(err, { data: entities });
78049 // Create, upload, and close a changeset
78050 // PUT /api/0.6/changeset/create
78051 // POST /api/0.6/changeset/#id/upload
78052 // PUT /api/0.6/changeset/#id/close
78053 putChangeset: function(changeset, changes, callback) {
78054 var cid = _connectionID;
78055 if (_changeset.inflight) {
78056 return callback({ message: "Changeset already inflight", status: -2 }, changeset);
78057 } else if (_changeset.open) {
78058 return createdChangeset.call(this, null, _changeset.open);
78062 path: "/api/0.6/changeset/create",
78063 headers: { "Content-Type": "text/xml" },
78064 content: JXON.stringify(changeset.asJXON())
78066 _changeset.inflight = oauth.xhr(
78068 wrapcb(this, createdChangeset, cid)
78071 function createdChangeset(err, changesetID) {
78072 _changeset.inflight = null;
78074 return callback(err, changeset);
78076 _changeset.open = changesetID;
78077 changeset = changeset.update({ id: changesetID });
78080 path: "/api/0.6/changeset/" + changesetID + "/upload",
78081 headers: { "Content-Type": "text/xml" },
78082 content: JXON.stringify(changeset.osmChangeJXON(changes))
78084 _changeset.inflight = oauth.xhr(
78086 wrapcb(this, uploadedChangeset, cid)
78089 function uploadedChangeset(err) {
78090 _changeset.inflight = null;
78092 return callback(err, changeset);
78093 window.setTimeout(function() {
78094 callback(null, changeset);
78096 _changeset.open = null;
78097 if (this.getConnectionId() === cid) {
78100 path: "/api/0.6/changeset/" + changeset.id + "/close",
78101 headers: { "Content-Type": "text/xml" }
78108 // Load multiple users in chunks
78109 // (note: callback may be called multiple times)
78110 // GET /api/0.6/users?users=#id1,#id2,...,#idn
78111 loadUsers: function(uids, callback) {
78114 utilArrayUniq(uids).forEach(function(uid) {
78115 if (_userCache.user[uid]) {
78116 delete _userCache.toLoad[uid];
78117 cached.push(_userCache.user[uid]);
78122 if (cached.length || !this.authenticated()) {
78123 callback(void 0, cached);
78124 if (!this.authenticated())
78127 utilArrayChunk(toLoad, 150).forEach(function(arr) {
78129 { method: "GET", path: "/api/0.6/users.json?users=" + arr.join() },
78130 wrapcb(this, done, _connectionID)
78133 function done(err, payload) {
78135 return callback(err);
78136 var options2 = { skipSeen: true };
78137 return parseUserJSON(payload, function(err2, results) {
78139 return callback(err2);
78140 return callback(void 0, results);
78144 // Load a given user by id
78145 // GET /api/0.6/user/#id
78146 loadUser: function(uid, callback) {
78147 if (_userCache.user[uid] || !this.authenticated()) {
78148 delete _userCache.toLoad[uid];
78149 return callback(void 0, _userCache.user[uid]);
78152 { method: "GET", path: "/api/0.6/user/" + uid + ".json" },
78153 wrapcb(this, done, _connectionID)
78155 function done(err, payload) {
78157 return callback(err);
78158 var options2 = { skipSeen: true };
78159 return parseUserJSON(payload, function(err2, results) {
78161 return callback(err2);
78162 return callback(void 0, results[0]);
78166 // Load the details of the logged-in user
78167 // GET /api/0.6/user/details
78168 userDetails: function(callback) {
78169 if (_userDetails) {
78170 return callback(void 0, _userDetails);
78173 { method: "GET", path: "/api/0.6/user/details.json" },
78174 wrapcb(this, done, _connectionID)
78176 function done(err, payload) {
78178 return callback(err);
78179 var options2 = { skipSeen: false };
78180 return parseUserJSON(payload, function(err2, results) {
78182 return callback(err2);
78183 _userDetails = results[0];
78184 return callback(void 0, _userDetails);
78188 // Load previous changesets for the logged in user
78189 // GET /api/0.6/changesets?user=#id
78190 userChangesets: function(callback) {
78191 if (_userChangesets) {
78192 return callback(void 0, _userChangesets);
78195 wrapcb(this, gotDetails, _connectionID)
78197 function gotDetails(err, user) {
78199 return callback(err);
78202 { method: "GET", path: "/api/0.6/changesets?user=" + user.id },
78203 wrapcb(this, done, _connectionID)
78206 function done(err, xml) {
78208 return callback(err);
78210 _userChangesets = Array.prototype.map.call(
78211 xml.getElementsByTagName("changeset"),
78212 function(changeset) {
78213 return { tags: getTags(changeset) };
78215 ).filter(function(changeset) {
78216 var comment = changeset.tags.comment;
78217 return comment && comment !== "";
78219 return callback(void 0, _userChangesets);
78222 // Fetch the status of the OSM API
78223 // GET /api/capabilities
78224 status: function(callback) {
78225 var url = urlroot + "/api/capabilities";
78226 var errback = wrapcb(this, done, _connectionID);
78227 xml_default(url).then(function(data) {
78228 errback(null, data);
78229 }).catch(function(err) {
78230 errback(err.message);
78232 function done(err, xml) {
78234 return callback(err, null);
78236 var elements = xml.getElementsByTagName("blacklist");
78238 for (var i3 = 0; i3 < elements.length; i3++) {
78239 var regexString = elements[i3].getAttribute("regex");
78242 var regex = new RegExp(regexString);
78243 regexes.push(regex);
78248 if (regexes.length) {
78249 _imageryBlocklists = regexes;
78251 if (_rateLimitError) {
78252 return callback(_rateLimitError, "rateLimited");
78254 var waynodes = xml.getElementsByTagName("waynodes");
78255 var maxWayNodes = waynodes.length && parseInt(waynodes[0].getAttribute("maximum"), 10);
78256 if (maxWayNodes && isFinite(maxWayNodes))
78257 _maxWayNodes = maxWayNodes;
78258 var apiStatus = xml.getElementsByTagName("status");
78259 var val = apiStatus[0].getAttribute("api");
78260 return callback(void 0, val);
78264 // Calls `status` and dispatches an `apiStatusChange` event if the returned
78265 // status differs from the cached status.
78266 reloadApiStatus: function() {
78267 if (!this.throttledReloadApiStatus) {
78269 this.throttledReloadApiStatus = throttle_default(function() {
78270 that.status(function(err, status) {
78271 if (status !== _cachedApiStatus) {
78272 _cachedApiStatus = status;
78273 dispatch10.call("apiStatusChange", that, err, status);
78278 this.throttledReloadApiStatus();
78280 // Returns the maximum number of nodes a single way can have
78281 maxWayNodes: function() {
78282 return _maxWayNodes;
78284 // Load data (entities) from the API in tiles
78285 // GET /api/0.6/map?bbox=
78286 loadTiles: function(projection2, callback) {
78289 var tiles = tiler6.zoomExtent([_tileZoom4, _tileZoom4]).getTiles(projection2);
78290 var hadRequests = hasInflightRequests(_tileCache);
78291 abortUnwantedRequests4(_tileCache, tiles);
78292 if (hadRequests && !hasInflightRequests(_tileCache)) {
78293 dispatch10.call("loaded");
78295 tiles.forEach(function(tile) {
78296 this.loadTile(tile, callback);
78299 // Load a single data tile
78300 // GET /api/0.6/map?bbox=
78301 loadTile: function(tile, callback) {
78304 if (_tileCache.loaded[tile.id] || _tileCache.inflight[tile.id])
78306 if (!hasInflightRequests(_tileCache)) {
78307 dispatch10.call("loading");
78309 var path = "/api/0.6/map.json?bbox=";
78310 var options2 = { skipSeen: true };
78311 _tileCache.inflight[tile.id] = this.loadFromAPI(
78312 path + tile.extent.toParam(),
78316 function tileCallback(err, parsed) {
78317 delete _tileCache.inflight[tile.id];
78319 delete _tileCache.toLoad[tile.id];
78320 _tileCache.loaded[tile.id] = true;
78321 var bbox2 = tile.extent.bbox();
78322 bbox2.id = tile.id;
78323 _tileCache.rtree.insert(bbox2);
78326 callback(err, Object.assign({ data: parsed }, tile));
78328 if (!hasInflightRequests(_tileCache)) {
78329 dispatch10.call("loaded");
78333 isDataLoaded: function(loc) {
78334 var bbox2 = { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] };
78335 return _tileCache.rtree.collides(bbox2);
78337 // load the tile that covers the given `loc`
78338 loadTileAtLoc: function(loc, callback) {
78339 if (Object.keys(_tileCache.toLoad).length > 50)
78341 var k2 = geoZoomToScale(_tileZoom4 + 1);
78342 var offset = geoRawMercator().scale(k2)(loc);
78343 var projection2 = geoRawMercator().transform({ k: k2, x: -offset[0], y: -offset[1] });
78344 var tiles = tiler6.zoomExtent([_tileZoom4, _tileZoom4]).getTiles(projection2);
78345 tiles.forEach(function(tile) {
78346 if (_tileCache.toLoad[tile.id] || _tileCache.loaded[tile.id] || _tileCache.inflight[tile.id])
78348 _tileCache.toLoad[tile.id] = true;
78349 this.loadTile(tile, callback);
78352 // Load notes from the API in tiles
78353 // GET /api/0.6/notes?bbox=
78354 loadNotes: function(projection2, noteOptions) {
78355 noteOptions = Object.assign({ limit: 1e4, closed: 7 }, noteOptions);
78359 var path = "/api/0.6/notes?limit=" + noteOptions.limit + "&closed=" + noteOptions.closed + "&bbox=";
78360 var throttleLoadUsers = throttle_default(function() {
78361 var uids = Object.keys(_userCache.toLoad);
78364 that.loadUsers(uids, function() {
78367 var tiles = tiler6.zoomExtent([_noteZoom, _noteZoom]).getTiles(projection2);
78368 abortUnwantedRequests4(_noteCache, tiles);
78369 tiles.forEach(function(tile) {
78370 if (_noteCache.loaded[tile.id] || _noteCache.inflight[tile.id])
78372 var options2 = { skipSeen: false };
78373 _noteCache.inflight[tile.id] = that.loadFromAPI(
78374 path + tile.extent.toParam(),
78376 delete _noteCache.inflight[tile.id];
78378 _noteCache.loaded[tile.id] = true;
78380 throttleLoadUsers();
78381 dispatch10.call("loadedNotes");
78388 // POST /api/0.6/notes?params
78389 postNoteCreate: function(note, callback) {
78390 if (!this.authenticated()) {
78391 return callback({ message: "Not Authenticated", status: -3 }, note);
78393 if (_noteCache.inflightPost[note.id]) {
78394 return callback({ message: "Note update already inflight", status: -2 }, note);
78396 if (!note.loc[0] || !note.loc[1] || !note.newComment)
78398 var comment = note.newComment;
78399 if (note.newCategory && note.newCategory !== "None") {
78400 comment += " #" + note.newCategory;
78402 var path = "/api/0.6/notes?" + utilQsString({ lon: note.loc[0], lat: note.loc[1], text: comment });
78403 _noteCache.inflightPost[note.id] = oauth.xhr(
78404 { method: "POST", path },
78405 wrapcb(this, done, _connectionID)
78407 function done(err, xml) {
78408 delete _noteCache.inflightPost[note.id];
78410 return callback(err);
78412 this.removeNote(note);
78413 var options2 = { skipSeen: false };
78414 return parseXML(xml, function(err2, results) {
78416 return callback(err2);
78418 return callback(void 0, results[0]);
78424 // POST /api/0.6/notes/#id/comment?text=comment
78425 // POST /api/0.6/notes/#id/close?text=comment
78426 // POST /api/0.6/notes/#id/reopen?text=comment
78427 postNoteUpdate: function(note, newStatus, callback) {
78428 if (!this.authenticated()) {
78429 return callback({ message: "Not Authenticated", status: -3 }, note);
78431 if (_noteCache.inflightPost[note.id]) {
78432 return callback({ message: "Note update already inflight", status: -2 }, note);
78435 if (note.status !== "closed" && newStatus === "closed") {
78437 } else if (note.status !== "open" && newStatus === "open") {
78440 action = "comment";
78441 if (!note.newComment)
78444 var path = "/api/0.6/notes/" + note.id + "/" + action;
78445 if (note.newComment) {
78446 path += "?" + utilQsString({ text: note.newComment });
78448 _noteCache.inflightPost[note.id] = oauth.xhr(
78449 { method: "POST", path },
78450 wrapcb(this, done, _connectionID)
78452 function done(err, xml) {
78453 delete _noteCache.inflightPost[note.id];
78455 return callback(err);
78457 this.removeNote(note);
78458 if (action === "close") {
78459 _noteCache.closed[note.id] = true;
78460 } else if (action === "reopen") {
78461 delete _noteCache.closed[note.id];
78463 var options2 = { skipSeen: false };
78464 return parseXML(xml, function(err2, results) {
78466 return callback(err2);
78468 return callback(void 0, results[0]);
78473 /* connection options for source switcher (optional) */
78474 apiConnections: function(val) {
78475 if (!arguments.length)
78476 return _apiConnections;
78477 _apiConnections = val;
78480 switch: function(newOptions) {
78481 urlroot = newOptions.url;
78482 var oldOptions = utilObjectOmit(oauth.options(), "access_token");
78483 oauth.options(Object.assign(oldOptions, newOptions));
78485 this.userChangesets(function() {
78487 dispatch10.call("change");
78490 toggle: function(val) {
78494 isChangesetInflight: function() {
78495 return !!_changeset.inflight;
78497 // get/set cached data
78498 // This is used to save/restore the state when entering/exiting the walkthrough
78499 // Also used for testing purposes.
78500 caches: function(obj) {
78501 function cloneCache(source) {
78503 Object.keys(source).forEach(function(k2) {
78504 if (k2 === "rtree") {
78505 target.rtree = new import_rbush10.default().fromJSON(source.rtree.toJSON());
78506 } else if (k2 === "note") {
78508 Object.keys(source.note).forEach(function(id2) {
78509 target.note[id2] = osmNote(source.note[id2]);
78512 target[k2] = JSON.parse(JSON.stringify(source[k2]));
78517 if (!arguments.length) {
78519 tile: cloneCache(_tileCache),
78520 note: cloneCache(_noteCache),
78521 user: cloneCache(_userCache)
78524 if (obj === "get") {
78532 _tileCache = obj.tile;
78533 _tileCache.inflight = {};
78536 _noteCache = obj.note;
78537 _noteCache.inflight = {};
78538 _noteCache.inflightPost = {};
78541 _userCache = obj.user;
78545 logout: function() {
78546 _userChangesets = void 0;
78547 _userDetails = void 0;
78549 dispatch10.call("change");
78552 authenticated: function() {
78553 return oauth.authenticated();
78555 authenticate: function(callback) {
78557 var cid = _connectionID;
78558 _userChangesets = void 0;
78559 _userDetails = void 0;
78560 function done(err, res) {
78566 if (that.getConnectionId() !== cid) {
78568 callback({ message: "Connection Switched", status: -1 });
78571 _rateLimitError = void 0;
78572 dispatch10.call("change");
78574 callback(err, res);
78575 that.userChangesets(function() {
78578 oauth.authenticate(done);
78580 imageryBlocklists: function() {
78581 return _imageryBlocklists;
78583 tileZoom: function(val) {
78584 if (!arguments.length)
78589 // get all cached notes covering the viewport
78590 notes: function(projection2) {
78591 var viewport = projection2.clipExtent();
78592 var min3 = [viewport[0][0], viewport[1][1]];
78593 var max3 = [viewport[1][0], viewport[0][1]];
78594 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
78595 return _noteCache.rtree.search(bbox2).map(function(d2) {
78599 // get a single note from the cache
78600 getNote: function(id2) {
78601 return _noteCache.note[id2];
78603 // remove a single note from the cache
78604 removeNote: function(note) {
78605 if (!(note instanceof osmNote) || !note.id)
78607 delete _noteCache.note[note.id];
78608 updateRtree4(encodeNoteRtree(note), false);
78610 // replace a single note in the cache
78611 replaceNote: function(note) {
78612 if (!(note instanceof osmNote) || !note.id)
78614 _noteCache.note[note.id] = note;
78615 updateRtree4(encodeNoteRtree(note), true);
78618 // Get an array of note IDs closed during this session.
78619 // Used to populate `closed:note` changeset tag
78620 getClosedIDs: function() {
78621 return Object.keys(_noteCache.closed).sort();
78625 // modules/services/osm_wikibase.js
78626 var apibase3 = "https://wiki.openstreetmap.org/w/api.php";
78627 var _inflight2 = {};
78628 var _wikibaseCache = {};
78629 var _localeIDs = { en: false };
78630 var debouncedRequest = debounce_default(request, 500, { leading: false });
78631 function request(url, callback) {
78632 if (_inflight2[url])
78634 var controller = new AbortController();
78635 _inflight2[url] = controller;
78636 json_default(url, { signal: controller.signal }).then(function(result) {
78637 delete _inflight2[url];
78639 callback(null, result);
78640 }).catch(function(err) {
78641 delete _inflight2[url];
78642 if (err.name === "AbortError")
78645 callback(err.message);
78648 var osm_wikibase_default = {
78651 _wikibaseCache = {};
78654 reset: function() {
78655 Object.values(_inflight2).forEach(function(controller) {
78656 controller.abort();
78661 * Get the best value for the property, or undefined if not found
78662 * @param entity object from wikibase
78663 * @param property string e.g. 'P4' for image
78664 * @param langCode string e.g. 'fr' for French
78666 claimToValue: function(entity, property, langCode) {
78667 if (!entity.claims[property])
78669 var locale2 = _localeIDs[langCode];
78670 var preferredPick, localePick;
78671 entity.claims[property].forEach(function(stmt) {
78672 if (!preferredPick && stmt.rank === "preferred") {
78673 preferredPick = stmt;
78675 if (locale2 && stmt.qualifiers && stmt.qualifiers.P26 && stmt.qualifiers.P26[0].datavalue.value.id === locale2) {
78679 var result = localePick || preferredPick;
78681 var datavalue = result.mainsnak.datavalue;
78682 return datavalue.type === "wikibase-entityid" ? datavalue.value.id : datavalue.value;
78688 * Convert monolingual property into a key-value object (language -> value)
78689 * @param entity object from wikibase
78690 * @param property string e.g. 'P31' for monolingual wiki page title
78692 monolingualClaimToValueObj: function(entity, property) {
78693 if (!entity || !entity.claims[property])
78695 return entity.claims[property].reduce(function(acc, obj) {
78696 var value = obj.mainsnak.datavalue.value;
78697 acc[value.language] = value.text;
78701 toSitelink: function(key, value) {
78702 var result = value ? "Tag:" + key + "=" + value : "Key:" + key;
78703 return result.replace(/_/g, " ").trim();
78706 // Pass params object of the form:
78709 // value: 'string',
78710 // langCode: 'string'
78713 getEntity: function(params, callback) {
78714 var doRequest = params.debounce ? debouncedRequest : request;
78718 var rtypeSitelink = params.key === "type" && params.value ? ("Relation:" + params.value).replace(/_/g, " ").trim() : false;
78719 var keySitelink = params.key ? this.toSitelink(params.key) : false;
78720 var tagSitelink = params.key && params.value ? this.toSitelink(params.key, params.value) : false;
78721 var localeSitelink;
78722 if (params.langCodes) {
78723 params.langCodes.forEach(function(langCode) {
78724 if (_localeIDs[langCode] === void 0) {
78725 localeSitelink = ("Locale:" + langCode).replace(/_/g, " ").trim();
78726 titles.push(localeSitelink);
78730 if (rtypeSitelink) {
78731 if (_wikibaseCache[rtypeSitelink]) {
78732 result.rtype = _wikibaseCache[rtypeSitelink];
78734 titles.push(rtypeSitelink);
78738 if (_wikibaseCache[keySitelink]) {
78739 result.key = _wikibaseCache[keySitelink];
78741 titles.push(keySitelink);
78745 if (_wikibaseCache[tagSitelink]) {
78746 result.tag = _wikibaseCache[tagSitelink];
78748 titles.push(tagSitelink);
78751 if (!titles.length) {
78752 return callback(null, result);
78755 action: "wbgetentities",
78757 titles: titles.join("|"),
78758 languages: params.langCodes.join("|"),
78759 languagefallback: 1,
78762 // There is an MW Wikibase API bug https://phabricator.wikimedia.org/T212069
78763 // We shouldn't use v1 until it gets fixed, but should switch to it afterwards
78764 // formatversion: 2,
78766 var url = apibase3 + "?" + utilQsString(obj);
78767 doRequest(url, function(err, d2) {
78770 } else if (!d2.success || d2.error) {
78771 callback(d2.error.messages.map(function(v2) {
78772 return v2.html["*"];
78775 var localeID = false;
78776 Object.values(d2.entities).forEach(function(res) {
78777 if (res.missing !== "") {
78778 var title = res.sitelinks.wiki.title;
78779 if (title === rtypeSitelink) {
78780 _wikibaseCache[rtypeSitelink] = res;
78781 result.rtype = res;
78782 } else if (title === keySitelink) {
78783 _wikibaseCache[keySitelink] = res;
78785 } else if (title === tagSitelink) {
78786 _wikibaseCache[tagSitelink] = res;
78788 } else if (title === localeSitelink) {
78791 console.log("Unexpected title " + title);
78795 if (localeSitelink) {
78796 that.addLocale(params.langCodes[0], localeID);
78798 callback(null, result);
78803 // Pass params object of the form:
78805 // key: 'string', // required
78806 // value: 'string' // optional
78809 // Get an result object used to display tag documentation
78811 // title: 'string',
78812 // description: 'string',
78813 // editURL: 'string',
78814 // imageURL: 'string',
78815 // wiki: { title: 'string', text: 'string', url: 'string' }
78818 getDocs: function(params, callback) {
78820 var langCodes = _mainLocalizer.localeCodes().map(function(code) {
78821 return code.toLowerCase();
78823 params.langCodes = langCodes;
78824 this.getEntity(params, function(err, data) {
78829 var entity = data.rtype || data.tag || data.key;
78831 callback("No entity");
78836 for (i3 in langCodes) {
78837 let code2 = langCodes[i3];
78838 if (entity.descriptions[code2] && entity.descriptions[code2].language === code2) {
78839 description = entity.descriptions[code2];
78843 if (!description && Object.values(entity.descriptions).length)
78844 description = Object.values(entity.descriptions)[0];
78846 title: entity.title,
78847 description: description ? description.value : "",
78848 descriptionLocaleCode: description ? description.language : "",
78849 editURL: "https://wiki.openstreetmap.org/wiki/" + entity.title
78851 if (entity.claims) {
78853 var image = that.claimToValue(entity, "P4", langCodes[0]);
78855 imageroot = "https://commons.wikimedia.org/w/index.php";
78857 image = that.claimToValue(entity, "P28", langCodes[0]);
78859 imageroot = "https://wiki.openstreetmap.org/w/index.php";
78862 if (imageroot && image) {
78863 result.imageURL = imageroot + "?" + utilQsString({
78864 title: "Special:Redirect/file/" + image,
78869 var rtypeWiki = that.monolingualClaimToValueObj(data.rtype, "P31");
78870 var tagWiki = that.monolingualClaimToValueObj(data.tag, "P31");
78871 var keyWiki = that.monolingualClaimToValueObj(data.key, "P31");
78872 var wikis = [rtypeWiki, tagWiki, keyWiki];
78873 for (i3 in wikis) {
78874 var wiki = wikis[i3];
78875 for (var j3 in langCodes) {
78876 var code = langCodes[j3];
78877 var referenceId = langCodes[0].split("-")[0] !== "en" && code.split("-")[0] === "en" ? "inspector.wiki_en_reference" : "inspector.wiki_reference";
78878 var info = getWikiInfo(wiki, code, referenceId);
78880 result.wiki = info;
78887 callback(null, result);
78888 function getWikiInfo(wiki2, langCode, tKey) {
78889 if (wiki2 && wiki2[langCode]) {
78891 title: wiki2[langCode],
78893 url: "https://wiki.openstreetmap.org/wiki/" + wiki2[langCode]
78899 addLocale: function(langCode, qid) {
78900 _localeIDs[langCode] = qid;
78902 apibase: function(val) {
78903 if (!arguments.length)
78910 // modules/services/streetside.js
78911 var import_rbush11 = __toESM(require_rbush_min());
78913 // modules/util/jsonp_request.js
78914 var jsonpCache = {};
78915 window.jsonpCache = jsonpCache;
78916 function jsonpRequest(url, callback) {
78918 abort: function() {
78921 if (window.JSONP_FIX) {
78922 if (window.JSONP_DELAY === 0) {
78923 callback(window.JSONP_FIX);
78925 var t2 = window.setTimeout(function() {
78926 callback(window.JSONP_FIX);
78927 }, window.JSONP_DELAY || 0);
78928 request3.abort = function() {
78929 window.clearTimeout(t2);
78935 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
78939 c2 += chars.charAt(Math.floor(Math.random() * 52));
78942 function create2(url2) {
78943 var e3 = url2.match(/callback=(\w+)/);
78944 var c2 = e3 ? e3[1] : rand();
78945 jsonpCache[c2] = function(data) {
78946 if (jsonpCache[c2]) {
78951 function finalize() {
78952 delete jsonpCache[c2];
78955 request3.abort = finalize;
78956 return "jsonpCache." + c2;
78958 var cb = create2(url);
78959 var script = select_default2("head").append("script").attr("type", "text/javascript").attr("src", url.replace(/(\{|%7B)callback(\}|%7D)/, cb));
78963 // modules/services/streetside.js
78964 var bubbleApi = "https://dev.virtualearth.net/mapcontrol/HumanScaleServices/GetBubbles.ashx?";
78965 var streetsideImagesApi = "https://t.ssl.ak.tiles.virtualearth.net/tiles/";
78966 var bubbleAppKey = "AuftgJsO0Xs8Ts4M1xZUQJQXJNsvmh3IV8DkNieCiy3tCwCUMq76-WpkrBtNAuEm";
78967 var pannellumViewerCSS2 = "pannellum/pannellum.css";
78968 var pannellumViewerJS2 = "pannellum/pannellum.js";
78969 var maxResults2 = 2e3;
78970 var tileZoom3 = 16.5;
78971 var tiler7 = utilTiler().zoomExtent([tileZoom3, tileZoom3]).skipNullIsland(true);
78972 var dispatch11 = dispatch_default("loadedImages", "viewerChanged");
78975 var defaultHfov = 45;
78976 var _hires = false;
78977 var _resolution = 512;
78978 var _currScene = 0;
78980 var _pannellumViewer2;
78981 var _sceneOptions = {
78982 showFullscreenCtrl: false,
78992 var _loadViewerPromise4;
78993 function abortRequest6(i3) {
78996 function localeTimestamp2(s2) {
78999 const options2 = { day: "numeric", month: "short", year: "numeric" };
79000 const d2 = new Date(s2);
79001 if (isNaN(d2.getTime()))
79003 return d2.toLocaleString(_mainLocalizer.localeCode(), options2);
79005 function loadTiles3(which, url, projection2, margin) {
79006 const tiles = tiler7.margin(margin).getTiles(projection2);
79007 const cache = _ssCache[which];
79008 Object.keys(cache.inflight).forEach((k2) => {
79009 const wanted = tiles.find((tile) => k2.indexOf(tile.id + ",") === 0);
79011 abortRequest6(cache.inflight[k2]);
79012 delete cache.inflight[k2];
79015 tiles.forEach((tile) => loadNextTilePage2(which, url, tile));
79017 function loadNextTilePage2(which, url, tile) {
79018 const cache = _ssCache[which];
79019 const nextPage = cache.nextPage[tile.id] || 0;
79020 const id2 = tile.id + "," + String(nextPage);
79021 if (cache.loaded[id2] || cache.inflight[id2])
79023 cache.inflight[id2] = getBubbles(url, tile, (bubbles) => {
79024 cache.loaded[id2] = true;
79025 delete cache.inflight[id2];
79029 const features = bubbles.map((bubble) => {
79030 if (cache.points[bubble.id])
79032 const loc = [bubble.lo, bubble.la];
79037 captured_at: bubble.cd,
79038 captured_by: "microsoft",
79039 // nbn: bubble.nbn,
79040 // pbn: bubble.pbn,
79050 cache.points[bubble.id] = d2;
79051 if (bubble.pr === void 0) {
79052 cache.leaders.push(bubble.id);
79061 }).filter(Boolean);
79062 cache.rtree.load(features);
79063 connectSequences();
79064 if (which === "bubbles") {
79065 dispatch11.call("loadedImages");
79069 function connectSequences() {
79070 let cache = _ssCache.bubbles;
79071 let keepLeaders = [];
79072 for (let i3 = 0; i3 < cache.leaders.length; i3++) {
79073 let bubble = cache.points[cache.leaders[i3]];
79075 let sequence = { key: bubble.key, bubbles: [] };
79076 let complete = false;
79078 sequence.bubbles.push(bubble);
79079 seen[bubble.key] = true;
79080 if (bubble.ne === void 0) {
79083 bubble = cache.points[bubble.ne];
79085 } while (bubble && !seen[bubble.key] && !complete);
79087 _ssCache.sequences[sequence.key] = sequence;
79088 for (let j3 = 0; j3 < sequence.bubbles.length; j3++) {
79089 sequence.bubbles[j3].sequenceKey = sequence.key;
79091 sequence.geojson = {
79092 type: "LineString",
79094 captured_at: sequence.bubbles[0] ? sequence.bubbles[0].captured_at : null,
79095 captured_by: sequence.bubbles[0] ? sequence.bubbles[0].captured_by : null,
79098 coordinates: sequence.bubbles.map((d2) => d2.loc)
79101 keepLeaders.push(cache.leaders[i3]);
79104 cache.leaders = keepLeaders;
79106 function getBubbles(url, tile, callback) {
79107 let rect = tile.extent.rectangle();
79108 let urlForRequest = url + utilQsString({
79114 appkey: bubbleAppKey,
79115 jsCallback: "{callback}"
79117 return jsonpRequest(urlForRequest, (data) => {
79118 if (!data || data.error) {
79125 function partitionViewport4(projection2) {
79126 let z2 = geoScaleToZoom(projection2.scale());
79127 let z22 = Math.ceil(z2 * 2) / 2 + 2.5;
79128 let tiler9 = utilTiler().zoomExtent([z22, z22]);
79129 return tiler9.getTiles(projection2).map((tile) => tile.extent);
79131 function searchLimited4(limit, projection2, rtree) {
79132 limit = limit || 5;
79133 return partitionViewport4(projection2).reduce((result, extent) => {
79134 let found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
79135 return found.length ? result.concat(found) : result;
79138 function loadImage2(imgInfo) {
79139 return new Promise((resolve) => {
79140 let img = new Image();
79141 img.onload = () => {
79142 let canvas = document.getElementById("ideditor-canvas" + imgInfo.face);
79143 let ctx = canvas.getContext("2d");
79144 ctx.drawImage(img, imgInfo.x, imgInfo.y);
79145 resolve({ imgInfo, status: "ok" });
79147 img.onerror = () => {
79148 resolve({ data: imgInfo, status: "error" });
79150 img.setAttribute("crossorigin", "");
79151 img.src = imgInfo.url;
79154 function loadCanvas(imageGroup) {
79155 return Promise.all(imageGroup.map(loadImage2)).then((data) => {
79156 let canvas = document.getElementById("ideditor-canvas" + data[0].imgInfo.face);
79157 const which = { "01": 0, "02": 1, "03": 2, "10": 3, "11": 4, "12": 5 };
79158 let face = data[0].imgInfo.face;
79159 _sceneOptions.cubeMap[which[face]] = canvas.toDataURL("image/jpeg", 1);
79160 return { status: "loadCanvas for face " + data[0].imgInfo.face + "ok" };
79163 function loadFaces(faceGroup) {
79164 return Promise.all(faceGroup.map(loadCanvas)).then(() => {
79165 return { status: "loadFaces done" };
79168 function setupCanvas(selection2, reset) {
79170 selection2.selectAll("#ideditor-stitcher-canvases").remove();
79172 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);
79174 function qkToXY(qk) {
79178 for (let i3 = qk.length; i3 > 0; i3--) {
79179 const key = qk[i3 - 1];
79180 x2 += +(key === "1" || key === "3") * scale;
79181 y2 += +(key === "2" || key === "3") * scale;
79186 function getQuadKeys() {
79187 let dim = _resolution / 256;
79448 } else if (dim === 8) {
79515 } else if (dim === 4) {
79544 var streetside_default = {
79546 * init() initialize streetside.
79552 this.event = utilRebind(this, dispatch11, "on");
79555 * reset() reset the cache.
79557 reset: function() {
79559 Object.values(_ssCache.bubbles.inflight).forEach(abortRequest6);
79562 bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: new import_rbush11.default(), points: {}, leaders: [] },
79569 bubbles: function(projection2) {
79571 return searchLimited4(limit, projection2, _ssCache.bubbles.rtree);
79573 cachedImage: function(imageKey) {
79574 return _ssCache.bubbles.points[imageKey];
79576 sequences: function(projection2) {
79577 const viewport = projection2.clipExtent();
79578 const min3 = [viewport[0][0], viewport[1][1]];
79579 const max3 = [viewport[1][0], viewport[0][1]];
79580 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
79583 _ssCache.bubbles.rtree.search(bbox2).forEach((d2) => {
79584 const key = d2.data.sequenceKey;
79585 if (key && !seen[key]) {
79587 results.push(_ssCache.sequences[key].geojson);
79595 loadBubbles: function(projection2, margin) {
79596 if (margin === void 0)
79598 loadTiles3("bubbles", bubbleApi, projection2, margin);
79600 viewer: function() {
79601 return _pannellumViewer2;
79603 initViewer: function() {
79604 if (!window.pannellum)
79606 if (_pannellumViewer2)
79609 const sceneID = _currScene.toString();
79611 "default": { firstScene: sceneID },
79614 options2.scenes[sceneID] = _sceneOptions;
79615 _pannellumViewer2 = window.pannellum.viewer("ideditor-viewer-streetside", options2);
79617 ensureViewerLoaded: function(context) {
79618 if (_loadViewerPromise4)
79619 return _loadViewerPromise4;
79620 let wrap2 = context.container().select(".photoviewer").selectAll(".ms-wrapper").data([0]);
79621 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper ms-wrapper").classed("hide", true);
79623 let pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
79624 wrapEnter.append("div").attr("id", "ideditor-viewer-streetside").on(pointerPrefix + "down.streetside", () => {
79625 select_default2(window).on(pointerPrefix + "move.streetside", () => {
79626 dispatch11.call("viewerChanged");
79628 }).on(pointerPrefix + "up.streetside pointercancel.streetside", () => {
79629 select_default2(window).on(pointerPrefix + "move.streetside", null);
79630 let t2 = timer((elapsed) => {
79631 dispatch11.call("viewerChanged");
79632 if (elapsed > 2e3) {
79636 }).append("div").attr("class", "photo-attribution fillD");
79637 let controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
79638 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
79639 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
79640 wrap2 = wrap2.merge(wrapEnter).call(setupCanvas, true);
79641 context.ui().photoviewer.on("resize.streetside", () => {
79642 if (_pannellumViewer2) {
79643 _pannellumViewer2.resize();
79646 _loadViewerPromise4 = new Promise((resolve, reject) => {
79647 let loadedCount = 0;
79648 function loaded() {
79650 if (loadedCount === 2)
79653 const head = select_default2("head");
79654 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() {
79657 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() {
79660 }).catch(function() {
79661 _loadViewerPromise4 = null;
79663 return _loadViewerPromise4;
79664 function step(stepBy) {
79666 let viewer = context.container().select(".photoviewer");
79667 let selected = viewer.empty() ? void 0 : viewer.datum();
79670 let nextID = stepBy === 1 ? selected.ne : selected.pr;
79671 let yaw = _pannellumViewer2.getYaw();
79672 let ca = selected.ca + yaw;
79673 let origin = selected.loc;
79676 origin[0] + geoMetersToLon(meters / 5, origin[1]),
79680 origin[0] + geoMetersToLon(meters / 2, origin[1]),
79681 origin[1] + geoMetersToLat(meters)
79684 origin[0] - geoMetersToLon(meters / 2, origin[1]),
79685 origin[1] + geoMetersToLat(meters)
79688 origin[0] - geoMetersToLon(meters / 5, origin[1]),
79691 let poly = [p1, p2, p3, p4, p1];
79692 let angle2 = (stepBy === 1 ? ca : ca + 180) * (Math.PI / 180);
79693 poly = geoRotate(poly, -angle2, origin);
79694 let extent = poly.reduce((extent2, point2) => {
79695 return extent2.extend(geoExtent(point2));
79697 let minDist = Infinity;
79698 _ssCache.bubbles.rtree.search(extent.bbox()).forEach((d2) => {
79699 if (d2.data.key === selected.key)
79701 if (!geoPointInPolygon(d2.data.loc, poly))
79703 let dist = geoVecLength(d2.data.loc, selected.loc);
79704 let theta = selected.ca - d2.data.ca;
79705 let minTheta = Math.min(Math.abs(theta), 360 - Math.abs(theta));
79706 if (minTheta > 20) {
79709 if (dist < minDist) {
79710 nextID = d2.data.key;
79714 let nextBubble = nextID && that.cachedImage(nextID);
79717 context.map().centerEase(nextBubble.loc);
79718 that.selectImage(context, nextBubble.key).yaw(yaw).showViewer(context);
79722 yaw: function(yaw) {
79723 if (typeof yaw !== "number")
79725 _sceneOptions.yaw = yaw;
79731 showViewer: function(context) {
79732 let wrap2 = context.container().select(".photoviewer").classed("hide", false);
79733 let isHidden = wrap2.selectAll(".photo-wrapper.ms-wrapper.hide").size();
79735 wrap2.selectAll(".photo-wrapper:not(.ms-wrapper)").classed("hide", true);
79736 wrap2.selectAll(".photo-wrapper.ms-wrapper").classed("hide", false);
79743 hideViewer: function(context) {
79744 let viewer = context.container().select(".photoviewer");
79745 if (!viewer.empty())
79746 viewer.datum(null);
79747 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
79748 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
79749 this.updateUrlImage(null);
79750 return this.setStyles(context, null, true);
79755 selectImage: function(context, key) {
79757 let d2 = this.cachedImage(key);
79758 let viewer = context.container().select(".photoviewer");
79759 if (!viewer.empty())
79761 this.setStyles(context, null, true);
79762 let wrap2 = context.container().select(".photoviewer .ms-wrapper");
79763 let attribution = wrap2.selectAll(".photo-attribution").html("");
79764 wrap2.selectAll(".pnlm-load-box").style("display", "block");
79767 this.updateUrlImage(key);
79768 _sceneOptions.northOffset = d2.ca;
79769 let line1 = attribution.append("div").attr("class", "attribution-row");
79770 const hiresDomId = utilUniqueDomId("streetside-hires");
79771 let label = line1.append("label").attr("for", hiresDomId).attr("class", "streetside-hires");
79772 label.append("input").attr("type", "checkbox").attr("id", hiresDomId).property("checked", _hires).on("click", (d3_event) => {
79773 d3_event.stopPropagation();
79775 _resolution = _hires ? 1024 : 512;
79776 wrap2.call(setupCanvas, true);
79778 yaw: _pannellumViewer2.getYaw(),
79779 pitch: _pannellumViewer2.getPitch(),
79780 hfov: _pannellumViewer2.getHfov()
79782 _sceneOptions = Object.assign(_sceneOptions, viewstate);
79783 that.selectImage(context, d2.key).showViewer(context);
79785 label.append("span").call(_t.append("streetside.hires"));
79786 let captureInfo = line1.append("div").attr("class", "attribution-capture-info");
79787 if (d2.captured_by) {
79788 const yyyy = (/* @__PURE__ */ new Date()).getFullYear();
79789 captureInfo.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://www.microsoft.com/en-us/maps/streetside").text("\xA9" + yyyy + " Microsoft");
79790 captureInfo.append("span").text("|");
79792 if (d2.captured_at) {
79793 captureInfo.append("span").attr("class", "captured_at").text(localeTimestamp2(d2.captured_at));
79795 let line2 = attribution.append("div").attr("class", "attribution-row");
79796 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"));
79797 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"));
79798 let bubbleIdQuadKey = d2.key.toString(4);
79799 const paddingNeeded = 16 - bubbleIdQuadKey.length;
79800 for (let i3 = 0; i3 < paddingNeeded; i3++) {
79801 bubbleIdQuadKey = "0" + bubbleIdQuadKey;
79803 const imgUrlPrefix = streetsideImagesApi + "hs" + bubbleIdQuadKey;
79804 const imgUrlSuffix = ".jpg?g=13515&n=z";
79805 const faceKeys = ["01", "02", "03", "10", "11", "12"];
79806 let quadKeys = getQuadKeys();
79807 let faces = faceKeys.map((faceKey) => {
79808 return quadKeys.map((quadKey) => {
79809 const xy = qkToXY(quadKey);
79812 url: imgUrlPrefix + faceKey + quadKey + imgUrlSuffix,
79818 loadFaces(faces).then(function() {
79819 if (!_pannellumViewer2) {
79823 let sceneID = _currScene.toString();
79824 _pannellumViewer2.addScene(sceneID, _sceneOptions).loadScene(sceneID);
79825 if (_currScene > 2) {
79826 sceneID = (_currScene - 1).toString();
79827 _pannellumViewer2.removeScene(sceneID);
79833 getSequenceKeyForBubble: function(d2) {
79834 return d2 && d2.sequenceKey;
79836 // Updates the currently highlighted sequence and selected bubble.
79837 // Reset is only necessary when interacting with the viewport because
79838 // this implicitly changes the currently selected bubble/sequence
79839 setStyles: function(context, hovered, reset) {
79841 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
79842 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
79844 let hoveredBubbleKey = hovered && hovered.key;
79845 let hoveredSequenceKey = this.getSequenceKeyForBubble(hovered);
79846 let hoveredSequence = hoveredSequenceKey && _ssCache.sequences[hoveredSequenceKey];
79847 let hoveredBubbleKeys = hoveredSequence && hoveredSequence.bubbles.map((d2) => d2.key) || [];
79848 let viewer = context.container().select(".photoviewer");
79849 let selected = viewer.empty() ? void 0 : viewer.datum();
79850 let selectedBubbleKey = selected && selected.key;
79851 let selectedSequenceKey = this.getSequenceKeyForBubble(selected);
79852 let selectedSequence = selectedSequenceKey && _ssCache.sequences[selectedSequenceKey];
79853 let selectedBubbleKeys = selectedSequence && selectedSequence.bubbles.map((d2) => d2.key) || [];
79854 let highlightedBubbleKeys = utilArrayUnion(hoveredBubbleKeys, selectedBubbleKeys);
79855 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);
79856 context.container().selectAll(".layer-streetside-images .sequence").classed("highlighted", (d2) => d2.properties.key === hoveredSequenceKey).classed("currentView", (d2) => d2.properties.key === selectedSequenceKey);
79857 context.container().selectAll(".layer-streetside-images .viewfield-group .viewfield").attr("d", viewfieldPath);
79858 function viewfieldPath() {
79859 let d2 = this.parentNode.__data__;
79860 if (d2.pano && d2.key !== selectedBubbleKey) {
79861 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
79863 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
79868 updateUrlImage: function(imageKey) {
79869 if (!window.mocha) {
79870 var hash = utilStringQs(window.location.hash);
79872 hash.photo = "streetside/" + imageKey;
79876 window.location.replace("#" + utilQsString(hash, true));
79882 cache: function() {
79887 // modules/services/taginfo.js
79888 var apibase4 = taginfoApiUrl;
79889 var _inflight3 = {};
79890 var _popularKeys = {};
79891 var _taginfoCache = {};
79893 point: "count_nodes",
79894 vertex: "count_nodes",
79895 area: "count_ways",
79898 var tag_sort_members = {
79899 point: "count_node_members",
79900 vertex: "count_node_members",
79901 area: "count_way_members",
79902 line: "count_way_members",
79903 relation: "count_relation_members"
79905 var tag_filters = {
79911 var tag_members_fractions = {
79912 point: "count_node_members_fraction",
79913 vertex: "count_node_members_fraction",
79914 area: "count_way_members_fraction",
79915 line: "count_way_members_fraction",
79916 relation: "count_relation_members_fraction"
79918 function sets(params, n3, o2) {
79919 if (params.geometry && o2[params.geometry]) {
79920 params[n3] = o2[params.geometry];
79924 function setFilter(params) {
79925 return sets(params, "filter", tag_filters);
79927 function setSort(params) {
79928 return sets(params, "sortname", tag_sorts);
79930 function setSortMembers(params) {
79931 return sets(params, "sortname", tag_sort_members);
79933 function clean(params) {
79934 return utilObjectOmit(params, ["geometry", "debounce"]);
79936 function filterKeys(type2) {
79937 var count_type = type2 ? "count_" + type2 : "count_all";
79938 return function(d2) {
79939 return Number(d2[count_type]) > 2500 || d2.in_wiki;
79942 function filterMultikeys(prefix) {
79943 return function(d2) {
79944 var re3 = new RegExp("^" + prefix + "(.*)$", "i");
79945 var matches = d2.key.match(re3) || [];
79946 return matches.length === 2 && matches[1].indexOf(":") === -1;
79949 function filterValues(allowUpperCase) {
79950 return function(d2) {
79951 if (d2.value.match(/[;,]/) !== null)
79953 if (!allowUpperCase && d2.value.match(/[A-Z*]/) !== null)
79955 return d2.count > 100 || d2.in_wiki;
79958 function filterRoles(geometry) {
79959 return function(d2) {
79960 if (d2.role === "")
79962 if (d2.role.match(/[A-Z*;,]/) !== null)
79964 return Number(d2[tag_members_fractions[geometry]]) > 0;
79967 function valKey(d2) {
79973 function valKeyDescription(d2) {
79976 title: d2.description || d2.value
79980 function roleKey(d2) {
79986 function sortKeys(a2, b2) {
79987 return a2.key.indexOf(":") === -1 && b2.key.indexOf(":") !== -1 ? -1 : a2.key.indexOf(":") !== -1 && b2.key.indexOf(":") === -1 ? 1 : 0;
79989 var debouncedRequest2 = debounce_default(request2, 300, { leading: false });
79990 function request2(url, params, exactMatch, callback, loaded) {
79991 if (_inflight3[url])
79993 if (checkCache(url, params, exactMatch, callback))
79995 var controller = new AbortController();
79996 _inflight3[url] = controller;
79997 json_default(url, { signal: controller.signal }).then(function(result) {
79998 delete _inflight3[url];
80000 loaded(null, result);
80001 }).catch(function(err) {
80002 delete _inflight3[url];
80003 if (err.name === "AbortError")
80006 loaded(err.message);
80009 function checkCache(url, params, exactMatch, callback) {
80010 var rp = params.rp || 25;
80011 var testQuery = params.query || "";
80014 var hit = _taginfoCache[testUrl];
80015 if (hit && (url === testUrl || hit.length < rp)) {
80016 callback(null, hit);
80019 if (exactMatch || !testQuery.length)
80021 testQuery = testQuery.slice(0, -1);
80022 testUrl = url.replace(/&query=(.*?)&/, "&query=" + testQuery + "&");
80023 } while (testQuery.length >= 0);
80026 var taginfo_default = {
80029 _taginfoCache = {};
80031 // manually exclude some keys – #5377, #7485
80037 sorting_name: true,
80042 "bridge:name": true
80046 sortname: "values_all",
80050 lang: _mainLocalizer.languageCode()
80052 this.keys(params, function(err, data) {
80055 data.forEach(function(d2) {
80056 if (d2.value === "opening_hours")
80058 _popularKeys[d2.value] = true;
80062 reset: function() {
80063 Object.values(_inflight3).forEach(function(controller) {
80064 controller.abort();
80068 keys: function(params, callback) {
80069 var doRequest = params.debounce ? debouncedRequest2 : request2;
80070 params = clean(setSort(params));
80071 params = Object.assign({
80073 sortname: "count_all",
80076 lang: _mainLocalizer.languageCode()
80078 var url = apibase4 + "keys/all?" + utilQsString(params);
80079 doRequest(url, params, false, callback, function(err, d2) {
80083 var f3 = filterKeys(params.filter);
80084 var result = d2.data.filter(f3).sort(sortKeys).map(valKey);
80085 _taginfoCache[url] = result;
80086 callback(null, result);
80090 multikeys: function(params, callback) {
80091 var doRequest = params.debounce ? debouncedRequest2 : request2;
80092 params = clean(setSort(params));
80093 params = Object.assign({
80095 sortname: "count_all",
80098 lang: _mainLocalizer.languageCode()
80100 var prefix = params.query;
80101 var url = apibase4 + "keys/all?" + utilQsString(params);
80102 doRequest(url, params, true, callback, function(err, d2) {
80106 var f3 = filterMultikeys(prefix);
80107 var result = d2.data.filter(f3).map(valKey);
80108 _taginfoCache[url] = result;
80109 callback(null, result);
80113 values: function(params, callback) {
80114 var key = params.key;
80115 if (key && _popularKeys[key]) {
80116 callback(null, []);
80119 var doRequest = params.debounce ? debouncedRequest2 : request2;
80120 params = clean(setSort(setFilter(params)));
80121 params = Object.assign({
80123 sortname: "count_all",
80126 lang: _mainLocalizer.languageCode()
80128 var url = apibase4 + "key/values?" + utilQsString(params);
80129 doRequest(url, params, false, callback, function(err, d2) {
80133 var allowUpperCase = allowUpperCaseTagValues.test(params.key);
80134 var f3 = filterValues(allowUpperCase);
80135 var result = d2.data.filter(f3).map(valKeyDescription);
80136 _taginfoCache[url] = result;
80137 callback(null, result);
80141 roles: function(params, callback) {
80142 var doRequest = params.debounce ? debouncedRequest2 : request2;
80143 var geometry = params.geometry;
80144 params = clean(setSortMembers(params));
80145 params = Object.assign({
80147 sortname: "count_all_members",
80150 lang: _mainLocalizer.languageCode()
80152 var url = apibase4 + "relation/roles?" + utilQsString(params);
80153 doRequest(url, params, true, callback, function(err, d2) {
80157 var f3 = filterRoles(geometry);
80158 var result = d2.data.filter(f3).map(roleKey);
80159 _taginfoCache[url] = result;
80160 callback(null, result);
80164 docs: function(params, callback) {
80165 var doRequest = params.debounce ? debouncedRequest2 : request2;
80166 params = clean(setSort(params));
80167 var path = "key/wiki_pages?";
80168 if (params.value) {
80169 path = "tag/wiki_pages?";
80170 } else if (params.rtype) {
80171 path = "relation/wiki_pages?";
80173 var url = apibase4 + path + utilQsString(params);
80174 doRequest(url, params, true, callback, function(err, d2) {
80178 _taginfoCache[url] = d2.data;
80179 callback(null, d2.data);
80183 apibase: function(_2) {
80184 if (!arguments.length)
80191 // modules/services/vector_tile.js
80192 var import_fast_deep_equal11 = __toESM(require_fast_deep_equal());
80193 var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify());
80194 var import_polygon_clipping2 = __toESM(require_polygon_clipping_umd());
80195 var import_pbf2 = __toESM(require_pbf());
80196 var import_vector_tile2 = __toESM(require_vector_tile());
80197 var tiler8 = utilTiler().tileSize(512).margin(1);
80198 var dispatch12 = dispatch_default("loadedData");
80200 function abortRequest7(controller) {
80201 controller.abort();
80203 function vtToGeoJSON(data, tile, mergeCache) {
80204 var vectorTile = new import_vector_tile2.default.VectorTile(new import_pbf2.default(data));
80205 var layers = Object.keys(vectorTile.layers);
80206 if (!Array.isArray(layers)) {
80210 layers.forEach(function(layerID) {
80211 var layer = vectorTile.layers[layerID];
80213 for (var i3 = 0; i3 < layer.length; i3++) {
80214 var feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80215 var geometry = feature3.geometry;
80216 if (geometry.type === "Polygon") {
80217 geometry.type = "MultiPolygon";
80218 geometry.coordinates = [geometry.coordinates];
80220 var isClipped = false;
80221 if (geometry.type === "MultiPolygon") {
80222 var featureClip = bboxClip(feature3, tile.extent.rectangle());
80223 if (!(0, import_fast_deep_equal11.default)(feature3.geometry, featureClip.geometry)) {
80226 if (!feature3.geometry.coordinates.length)
80228 if (!feature3.geometry.coordinates[0].length)
80231 var featurehash = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature3));
80232 var propertyhash = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature3.properties || {}));
80233 feature3.__layerID__ = layerID.replace(/[^_a-zA-Z0-9\-]/g, "_");
80234 feature3.__featurehash__ = featurehash;
80235 feature3.__propertyhash__ = propertyhash;
80236 features.push(feature3);
80237 if (isClipped && geometry.type === "MultiPolygon") {
80238 var merged = mergeCache[propertyhash];
80239 if (merged && merged.length) {
80240 var other = merged[0];
80241 var coords = import_polygon_clipping2.default.union(
80242 feature3.geometry.coordinates,
80243 other.geometry.coordinates
80245 if (!coords || !coords.length) {
80248 merged.push(feature3);
80249 for (var j3 = 0; j3 < merged.length; j3++) {
80250 merged[j3].geometry.coordinates = coords;
80251 merged[j3].__featurehash__ = featurehash;
80254 mergeCache[propertyhash] = [feature3];
80262 function loadTile3(source, tile) {
80263 if (source.loaded[tile.id] || source.inflight[tile.id])
80265 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) {
80266 var subdomains = r2.split(",");
80267 return subdomains[(tile.xyz[0] + tile.xyz[1]) % subdomains.length];
80269 var controller = new AbortController();
80270 source.inflight[tile.id] = controller;
80271 fetch(url, { signal: controller.signal }).then(function(response) {
80272 if (!response.ok) {
80273 throw new Error(response.status + " " + response.statusText);
80275 source.loaded[tile.id] = [];
80276 delete source.inflight[tile.id];
80277 return response.arrayBuffer();
80278 }).then(function(data) {
80280 throw new Error("No Data");
80282 var z2 = tile.xyz[2];
80283 if (!source.canMerge[z2]) {
80284 source.canMerge[z2] = {};
80286 source.loaded[tile.id] = vtToGeoJSON(data, tile, source.canMerge[z2]);
80287 dispatch12.call("loadedData");
80288 }).catch(function() {
80289 source.loaded[tile.id] = [];
80290 delete source.inflight[tile.id];
80293 var vector_tile_default = {
80298 this.event = utilRebind(this, dispatch12, "on");
80300 reset: function() {
80301 for (var sourceID in _vtCache) {
80302 var source = _vtCache[sourceID];
80303 if (source && source.inflight) {
80304 Object.values(source.inflight).forEach(abortRequest7);
80309 addSource: function(sourceID, template) {
80310 _vtCache[sourceID] = { template, inflight: {}, loaded: {}, canMerge: {} };
80311 return _vtCache[sourceID];
80313 data: function(sourceID, projection2) {
80314 var source = _vtCache[sourceID];
80317 var tiles = tiler8.getTiles(projection2);
80320 for (var i3 = 0; i3 < tiles.length; i3++) {
80321 var features = source.loaded[tiles[i3].id];
80322 if (!features || !features.length)
80324 for (var j3 = 0; j3 < features.length; j3++) {
80325 var feature3 = features[j3];
80326 var hash = feature3.__featurehash__;
80330 results.push(Object.assign({}, feature3));
80335 loadTiles: function(sourceID, template, projection2) {
80336 var source = _vtCache[sourceID];
80338 source = this.addSource(sourceID, template);
80340 var tiles = tiler8.getTiles(projection2);
80341 Object.keys(source.inflight).forEach(function(k2) {
80342 var wanted = tiles.find(function(tile) {
80343 return k2 === tile.id;
80346 abortRequest7(source.inflight[k2]);
80347 delete source.inflight[k2];
80350 tiles.forEach(function(tile) {
80351 loadTile3(source, tile);
80354 cache: function() {
80359 // modules/services/wikidata.js
80360 var apibase5 = "https://www.wikidata.org/w/api.php?";
80361 var _wikidataCache = {};
80362 var wikidata_default = {
80365 reset: function() {
80366 _wikidataCache = {};
80368 // Search for Wikidata items matching the query
80369 itemsForSearchQuery: function(query, callback, language) {
80372 callback("No query", {});
80375 var lang = this.languagesToQuery()[0];
80376 var url = apibase5 + utilQsString({
80377 action: "wbsearchentities",
80382 // the language to search
80383 language: language || lang,
80384 // the language for the label and description in the result
80389 json_default(url).then((result) => {
80390 if (result && result.error) {
80391 if (result.error.code === "badvalue" && result.error.info.includes(lang) && !language && lang.includes("-")) {
80392 this.itemsForSearchQuery(query, callback, lang.split("-")[0]);
80395 throw new Error(result.error);
80399 callback(null, result.search || {});
80400 }).catch(function(err) {
80402 callback(err.message, {});
80405 // Given a Wikipedia language and article title,
80406 // return an array of corresponding Wikidata entities.
80407 itemsByTitle: function(lang, title, callback) {
80410 callback("No title", {});
80413 lang = lang || "en";
80414 var url = apibase5 + utilQsString({
80415 action: "wbgetentities",
80418 sites: lang.replace(/-/g, "_") + "wiki",
80421 // shrink response by filtering to one language
80424 json_default(url).then(function(result) {
80425 if (result && result.error) {
80426 throw new Error(result.error);
80429 callback(null, result.entities || {});
80430 }).catch(function(err) {
80432 callback(err.message, {});
80435 languagesToQuery: function() {
80436 return _mainLocalizer.localeCodes().map(function(code) {
80437 return code.toLowerCase();
80438 }).filter(function(code) {
80439 return code !== "en-us";
80442 entityByQID: function(qid, callback) {
80444 callback("No qid", {});
80447 if (_wikidataCache[qid]) {
80449 callback(null, _wikidataCache[qid]);
80452 var langs = this.languagesToQuery();
80453 var url = apibase5 + utilQsString({
80454 action: "wbgetentities",
80458 props: "labels|descriptions|claims|sitelinks",
80459 sitefilter: langs.map(function(d2) {
80460 return d2 + "wiki";
80462 languages: langs.join("|"),
80463 languagefallback: 1,
80466 json_default(url).then(function(result) {
80467 if (result && result.error) {
80468 throw new Error(result.error);
80471 callback(null, result.entities[qid] || {});
80472 }).catch(function(err) {
80474 callback(err.message, {});
80477 // Pass `params` object of the form:
80479 // qid: 'string' // brand wikidata (e.g. 'Q37158')
80482 // Get an result object used to display tag documentation
80484 // title: 'string',
80485 // description: 'string',
80486 // editURL: 'string',
80487 // imageURL: 'string',
80488 // wiki: { title: 'string', text: 'string', url: 'string' }
80491 getDocs: function(params, callback) {
80492 var langs = this.languagesToQuery();
80493 this.entityByQID(params.qid, function(err, entity) {
80494 if (err || !entity) {
80495 callback(err || "No entity");
80500 for (i3 in langs) {
80501 let code = langs[i3];
80502 if (entity.descriptions[code] && entity.descriptions[code].language === code) {
80503 description = entity.descriptions[code];
80507 if (!description && Object.values(entity.descriptions).length)
80508 description = Object.values(entity.descriptions)[0];
80511 description: description ? description.value : "",
80512 descriptionLocaleCode: description ? description.language : "",
80513 editURL: "https://www.wikidata.org/wiki/" + entity.id
80515 if (entity.claims) {
80516 var imageroot = "https://commons.wikimedia.org/w/index.php";
80517 var props = ["P154", "P18"];
80519 for (i3 = 0; i3 < props.length; i3++) {
80520 prop = entity.claims[props[i3]];
80521 if (prop && Object.keys(prop).length > 0) {
80522 image = prop[Object.keys(prop)[0]].mainsnak.datavalue.value;
80524 result.imageURL = imageroot + "?" + utilQsString({
80525 title: "Special:Redirect/file/" + image,
80533 if (entity.sitelinks) {
80534 var englishLocale = _mainLocalizer.languageCode().toLowerCase() === "en";
80535 for (i3 = 0; i3 < langs.length; i3++) {
80536 var w2 = langs[i3] + "wiki";
80537 if (entity.sitelinks[w2]) {
80538 var title = entity.sitelinks[w2].title;
80539 var tKey = "inspector.wiki_reference";
80540 if (!englishLocale && langs[i3] === "en") {
80541 tKey = "inspector.wiki_en_reference";
80546 url: "https://" + langs[i3] + ".wikipedia.org/wiki/" + title.replace(/ /g, "_")
80552 callback(null, result);
80557 // modules/services/wikipedia.js
80558 var endpoint = "https://en.wikipedia.org/w/api.php?";
80559 var wikipedia_default = {
80562 reset: function() {
80564 search: function(lang, query, callback) {
80567 callback("No Query", []);
80570 lang = lang || "en";
80571 var url = endpoint.replace("en", lang) + utilQsString({
80575 srinfo: "suggestion",
80580 json_default(url).then(function(result) {
80581 if (result && result.error) {
80582 throw new Error(result.error);
80583 } else if (!result || !result.query || !result.query.search) {
80584 throw new Error("No Results");
80587 var titles = result.query.search.map(function(d2) {
80590 callback(null, titles);
80592 }).catch(function(err) {
80597 suggestions: function(lang, query, callback) {
80603 lang = lang || "en";
80604 var url = endpoint.replace("en", lang) + utilQsString({
80605 action: "opensearch",
80612 json_default(url).then(function(result) {
80613 if (result && result.error) {
80614 throw new Error(result.error);
80615 } else if (!result || result.length < 2) {
80616 throw new Error("No Results");
80619 callback(null, result[1] || []);
80620 }).catch(function(err) {
80622 callback(err.message, []);
80625 translations: function(lang, title, callback) {
80628 callback("No Title");
80631 var url = endpoint.replace("en", lang) + utilQsString({
80639 json_default(url).then(function(result) {
80640 if (result && result.error) {
80641 throw new Error(result.error);
80642 } else if (!result || !result.query || !result.query.pages) {
80643 throw new Error("No Results");
80646 var list = result.query.pages[Object.keys(result.query.pages)[0]];
80647 var translations = {};
80648 if (list && list.langlinks) {
80649 list.langlinks.forEach(function(d2) {
80650 translations[d2.lang] = d2["*"];
80653 callback(null, translations);
80655 }).catch(function(err) {
80657 callback(err.message);
80662 // modules/services/mapilio.js
80663 var import_pbf3 = __toESM(require_pbf());
80664 var import_rbush12 = __toESM(require_rbush_min());
80665 var import_vector_tile3 = __toESM(require_vector_tile());
80666 var apiUrl2 = "https://end.mapilio.com";
80667 var imageBaseUrl = "https://cdn.mapilio.com/im";
80668 var baseTileUrl2 = "https://geo.mapilio.com/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=mapilio:";
80669 var pointLayer = "map_points";
80670 var lineLayer = "map_roads_line";
80671 var tileStyle = "&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}";
80673 var dispatch13 = dispatch_default("loadedImages", "loadedLines");
80674 var imgZoom3 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
80675 var pannellumViewerCSS3 = "pannellum/pannellum.css";
80676 var pannellumViewerJS3 = "pannellum/pannellum.js";
80677 var resolution = 1080;
80678 var _mlyActiveImage2;
80680 var _loadViewerPromise5;
80681 var _pannellumViewer3;
80682 var _mlySceneOptions = {
80683 showFullscreenCtrl: false,
80690 var _currScene2 = 0;
80691 function partitionViewport5(projection2) {
80692 const z2 = geoScaleToZoom(projection2.scale());
80693 const z22 = Math.ceil(z2 * 2) / 2 + 2.5;
80694 const tiler9 = utilTiler().zoomExtent([z22, z22]);
80695 return tiler9.getTiles(projection2).map(function(tile) {
80696 return tile.extent;
80699 function searchLimited5(limit, projection2, rtree) {
80700 limit = limit || 5;
80701 return partitionViewport5(projection2).reduce(function(result, extent) {
80702 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
80705 return found.length ? result.concat(found) : result;
80708 function loadTiles4(which, url, maxZoom2, projection2) {
80709 const tiler9 = utilTiler().zoomExtent([minZoom3, maxZoom2]).skipNullIsland(true);
80710 const tiles = tiler9.getTiles(projection2);
80711 tiles.forEach(function(tile) {
80712 loadTile4(which, url, tile);
80715 function loadTile4(which, url, tile) {
80716 const cache = _mlyCache2.requests;
80717 const tileId = `${tile.id}-${which}`;
80718 if (cache.loaded[tileId] || cache.inflight[tileId])
80720 const controller = new AbortController();
80721 cache.inflight[tileId] = controller;
80722 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
80723 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
80724 if (!response.ok) {
80725 throw new Error(response.status + " " + response.statusText);
80727 cache.loaded[tileId] = true;
80728 delete cache.inflight[tileId];
80729 return response.arrayBuffer();
80730 }).then(function(data) {
80731 if (data.byteLength === 0) {
80732 throw new Error("No Data");
80734 loadTileDataToCache2(data, tile, which);
80735 if (which === "images") {
80736 dispatch13.call("loadedImages");
80738 dispatch13.call("loadedLines");
80740 }).catch(function(e3) {
80741 if (e3.message === "No Data") {
80742 cache.loaded[tileId] = true;
80748 function loadTileDataToCache2(data, tile) {
80749 const vectorTile = new import_vector_tile3.VectorTile(new import_pbf3.default(data));
80750 let features, cache, layer, i3, feature3, loc, d2;
80751 if (vectorTile.layers.hasOwnProperty(pointLayer)) {
80753 cache = _mlyCache2.images;
80754 layer = vectorTile.layers[pointLayer];
80755 for (i3 = 0; i3 < layer.length; i3++) {
80756 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80757 loc = feature3.geometry.coordinates;
80758 let resolutionArr = feature3.properties.resolution.split("x");
80759 let sourceWidth = Math.max(resolutionArr[0], resolutionArr[1]);
80760 let sourceHeight = Math.min(resolutionArr[0], resolutionArr[1]);
80761 let isPano = sourceWidth % sourceHeight === 0;
80764 capture_time: feature3.properties.capture_time,
80765 id: feature3.properties.id,
80766 sequence_id: feature3.properties.sequence_uuid,
80767 heading: feature3.properties.heading,
80768 resolution: feature3.properties.resolution,
80771 cache.forImageId[d2.id] = d2;
80781 cache.rtree.load(features);
80784 if (vectorTile.layers.hasOwnProperty(lineLayer)) {
80785 cache = _mlyCache2.sequences;
80786 layer = vectorTile.layers[lineLayer];
80787 for (i3 = 0; i3 < layer.length; i3++) {
80788 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80789 if (cache.lineString[feature3.properties.sequence_uuid]) {
80790 cache.lineString[feature3.properties.sequence_uuid].push(feature3);
80792 cache.lineString[feature3.properties.sequence_uuid] = [feature3];
80797 function getImageData(imageId, sequenceId) {
80798 return fetch(apiUrl2 + `/api/sequence-detail?sequence_uuid=${sequenceId}`, { method: "GET" }).then(function(response) {
80799 if (!response.ok) {
80800 throw new Error(response.status + " " + response.statusText);
80802 return response.json();
80803 }).then(function(data) {
80804 let index = data.data.findIndex((feature3) => feature3.id === imageId);
80805 const { filename, uploaded_hash } = data.data[index];
80806 _mlySceneOptions.panorama = imageBaseUrl + "/" + uploaded_hash + "/" + filename + "/" + resolution;
80809 var mapilio_default = {
80810 // Initialize Mapilio
80815 this.event = utilRebind(this, dispatch13, "on");
80817 // Reset cache and state
80818 reset: function() {
80820 Object.values(_mlyCache2.requests.inflight).forEach(function(request3) {
80825 images: { rtree: new import_rbush12.default(), forImageId: {} },
80826 sequences: { rtree: new import_rbush12.default(), lineString: {} },
80827 requests: { loaded: {}, inflight: {} }
80829 _mlyActiveImage2 = null;
80831 // Get visible images
80832 images: function(projection2) {
80834 return searchLimited5(limit, projection2, _mlyCache2.images.rtree);
80836 cachedImage: function(imageKey) {
80837 return _mlyCache2.images.forImageId[imageKey];
80839 // Load images in the visible area
80840 loadImages: function(projection2) {
80841 let url = baseTileUrl2 + pointLayer + tileStyle;
80842 loadTiles4("images", url, 14, projection2);
80844 // Load line in the visible area
80845 loadLines: function(projection2) {
80846 let url = baseTileUrl2 + lineLayer + tileStyle;
80847 loadTiles4("line", url, 14, projection2);
80849 // Get visible sequences
80850 sequences: function(projection2) {
80851 const viewport = projection2.clipExtent();
80852 const min3 = [viewport[0][0], viewport[1][1]];
80853 const max3 = [viewport[1][0], viewport[0][1]];
80854 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
80855 const sequenceIds = {};
80856 let lineStrings = [];
80857 _mlyCache2.images.rtree.search(bbox2).forEach(function(d2) {
80858 if (d2.data.sequence_id) {
80859 sequenceIds[d2.data.sequence_id] = true;
80862 Object.keys(sequenceIds).forEach(function(sequenceId) {
80863 if (_mlyCache2.sequences.lineString[sequenceId]) {
80864 lineStrings = lineStrings.concat(_mlyCache2.sequences.lineString[sequenceId]);
80867 return lineStrings;
80869 // Set the currently visible image
80870 setActiveImage: function(image) {
80872 _mlyActiveImage2 = {
80874 sequence_id: image.sequence_id
80877 _mlyActiveImage2 = null;
80880 // Update the currently highlighted sequence and selected bubble.
80881 setStyles: function(context, hovered) {
80882 const hoveredImageId = hovered && hovered.id;
80883 const hoveredSequenceId = hovered && hovered.sequence_id;
80884 const selectedSequenceId = _mlyActiveImage2 && _mlyActiveImage2.sequence_id;
80885 const selectedImageId = _mlyActiveImage2 && _mlyActiveImage2.id;
80886 const markers = context.container().selectAll(".layer-mapilio .viewfield-group");
80887 const sequences = context.container().selectAll(".layer-mapilio .sequence");
80888 markers.classed("highlighted", function(d2) {
80889 return d2.id === hoveredImageId;
80890 }).classed("hovered", function(d2) {
80891 return d2.id === hoveredImageId;
80892 }).classed("currentView", function(d2) {
80893 return d2.id === selectedImageId;
80895 sequences.classed("highlighted", function(d2) {
80896 return d2.properties.sequence_uuid === hoveredSequenceId;
80897 }).classed("currentView", function(d2) {
80898 return d2.properties.sequence_uuid === selectedSequenceId;
80902 updateUrlImage: function(imageKey) {
80903 if (!window.mocha) {
80904 var hash = utilStringQs(window.location.hash);
80906 hash.photo = "mapilio/" + imageKey;
80910 window.location.replace("#" + utilQsString(hash, true));
80913 initViewer: function() {
80914 if (!window.pannellum)
80916 if (_pannellumViewer3)
80919 const sceneID = _currScene2.toString();
80921 "default": { firstScene: sceneID },
80924 options2.scenes[sceneID] = _mlySceneOptions;
80925 _pannellumViewer3 = window.pannellum.viewer("ideditor-viewer-mapilio-pnlm", options2);
80927 selectImage: function(context, id2) {
80929 let d2 = this.cachedImage(id2);
80930 this.setActiveImage(d2);
80931 this.updateUrlImage(d2.id);
80932 let viewer = context.container().select(".photoviewer");
80933 if (!viewer.empty())
80935 this.setStyles(context, null);
80938 let wrap2 = context.container().select(".photoviewer .mapilio-wrapper");
80939 let attribution = wrap2.selectAll(".photo-attribution").text("");
80940 if (d2.capture_time) {
80941 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.capture_time));
80942 attribution.append("span").text("|");
80944 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");
80945 wrap2.transition().duration(100).call(imgZoom3.transform, identity2);
80946 wrap2.selectAll("img").remove();
80947 getImageData(d2.id, d2.sequence_id).then(function() {
80949 if (!_pannellumViewer3) {
80953 let sceneID = _currScene2.toString();
80954 _pannellumViewer3.addScene(sceneID, _mlySceneOptions).loadScene(sceneID);
80955 if (_currScene2 > 2) {
80956 sceneID = (_currScene2 - 1).toString();
80957 _pannellumViewer3.removeScene(sceneID);
80961 that.initOnlyPhoto(context);
80964 function localeDateString2(s2) {
80967 var options2 = { day: "numeric", month: "short", year: "numeric" };
80968 var d4 = new Date(s2);
80969 if (isNaN(d4.getTime()))
80971 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options2);
80975 initOnlyPhoto: function(context) {
80976 if (_pannellumViewer3) {
80977 _pannellumViewer3.destroy();
80978 _pannellumViewer3 = null;
80980 let wrap2 = context.container().select("#ideditor-viewer-mapilio-simple");
80981 let imgWrap = wrap2.select("img");
80982 if (!imgWrap.empty()) {
80983 imgWrap.attr("src", _mlySceneOptions.panorama);
80985 wrap2.append("img").attr("src", _mlySceneOptions.panorama);
80988 ensureViewerLoaded: function(context) {
80990 let imgWrap = context.container().select("#ideditor-viewer-mapilio-simple > img");
80991 if (!imgWrap.empty()) {
80994 if (_loadViewerPromise5)
80995 return _loadViewerPromise5;
80996 let wrap2 = context.container().select(".photoviewer").selectAll(".mapilio-wrapper").data([0]);
80997 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper mapilio-wrapper").classed("hide", true).on("dblclick.zoom", null);
80998 wrapEnter.append("div").attr("class", "photo-attribution fillD");
80999 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-mapilio");
81000 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
81001 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
81002 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-pnlm");
81003 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-simple-wrap").call(imgZoom3.on("zoom", zoomPan2)).append("div").attr("id", "ideditor-viewer-mapilio-simple");
81004 context.ui().photoviewer.on("resize.mapilio", () => {
81005 if (_pannellumViewer3) {
81006 _pannellumViewer3.resize();
81009 _loadViewerPromise5 = new Promise((resolve, reject) => {
81010 let loadedCount = 0;
81011 function loaded() {
81013 if (loadedCount === 2)
81016 const head = select_default2("head");
81017 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() {
81020 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() {
81023 }).catch(function() {
81024 _loadViewerPromise5 = null;
81026 function step(stepBy) {
81027 return function() {
81028 if (!_mlyActiveImage2)
81030 const imageId = _mlyActiveImage2.id;
81031 const nextIndex = imageId + stepBy;
81034 const nextImage = _mlyCache2.images.forImageId[nextIndex];
81035 context.map().centerEase(nextImage.loc);
81036 that.selectImage(context, nextImage.id);
81039 function zoomPan2(d3_event) {
81040 var t2 = d3_event.transform;
81041 context.container().select(".photoviewer #ideditor-viewer-mapilio-simple").call(utilSetTransform, t2.x, t2.y, t2.k);
81043 return _loadViewerPromise5;
81045 showViewer: function(context) {
81046 let wrap2 = context.container().select(".photoviewer").classed("hide", false);
81047 let isHidden = wrap2.selectAll(".photo-wrapper.mapilio-wrapper.hide").size();
81049 wrap2.selectAll(".photo-wrapper:not(.mapilio-wrapper)").classed("hide", true);
81050 wrap2.selectAll(".photo-wrapper.mapilio-wrapper").classed("hide", false);
81057 hideViewer: function(context) {
81058 let viewer = context.container().select(".photoviewer");
81059 if (!viewer.empty())
81060 viewer.datum(null);
81061 this.updateUrlImage(null);
81062 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
81063 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
81064 this.setActiveImage();
81065 return this.setStyles(context, null);
81067 // Return the current cache
81068 cache: function() {
81073 // modules/services/index.js
81075 geocoder: nominatim_default,
81076 keepRight: keepRight_default,
81077 improveOSM: improveOSM_default,
81078 osmose: osmose_default,
81079 mapillary: mapillary_default,
81081 kartaview: kartaview_default,
81082 vegbilder: vegbilder_default,
81084 osmWikibase: osm_wikibase_default,
81085 maprules: maprules_default,
81086 streetside: streetside_default,
81087 taginfo: taginfo_default,
81088 vectorTile: vector_tile_default,
81089 wikidata: wikidata_default,
81090 wikipedia: wikipedia_default,
81091 mapilio: mapilio_default
81094 // modules/modes/drag_note.js
81095 function modeDragNote(context) {
81100 var edit2 = behaviorEdit(context);
81101 var _nudgeInterval;
81104 function startNudge(d3_event, nudge) {
81105 if (_nudgeInterval)
81106 window.clearInterval(_nudgeInterval);
81107 _nudgeInterval = window.setInterval(function() {
81108 context.map().pan(nudge);
81109 doMove(d3_event, nudge);
81112 function stopNudge() {
81113 if (_nudgeInterval) {
81114 window.clearInterval(_nudgeInterval);
81115 _nudgeInterval = null;
81118 function origin(note) {
81119 return context.projection(note.loc);
81121 function start2(d3_event, note) {
81123 var osm = services.osm;
81125 _note = osm.getNote(_note.id);
81127 context.surface().selectAll(".note-" + _note.id).classed("active", true);
81128 context.perform(actionNoop());
81129 context.enter(mode);
81130 context.selectedNoteID(_note.id);
81132 function move(d3_event, entity, point2) {
81133 d3_event.stopPropagation();
81134 _lastLoc = context.projection.invert(point2);
81136 var nudge = geoViewportEdge(point2, context.map().dimensions());
81138 startNudge(d3_event, nudge);
81143 function doMove(d3_event, nudge) {
81144 nudge = nudge || [0, 0];
81145 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
81146 var currMouse = geoVecSubtract(currPoint, nudge);
81147 var loc = context.projection.invert(currMouse);
81148 _note = _note.move(loc);
81149 var osm = services.osm;
81151 osm.replaceNote(_note);
81153 context.replace(actionNoop());
81156 context.replace(actionNoop());
81157 context.selectedNoteID(_note.id).enter(modeSelectNote(context, _note.id));
81159 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);
81160 mode.enter = function() {
81161 context.install(edit2);
81163 mode.exit = function() {
81164 context.ui().sidebar.hover.cancel();
81165 context.uninstall(edit2);
81166 context.surface().selectAll(".active").classed("active", false);
81169 mode.behavior = drag;
81173 // modules/modes/select_data.js
81174 function modeSelectData(context, selectedDatum) {
81179 var keybinding = utilKeybinding("select-data");
81180 var dataEditor = uiDataEditor(context);
81182 behaviorBreathe(context),
81183 behaviorHover(context),
81184 behaviorSelect(context),
81185 behaviorLasso(context),
81186 modeDragNode(context).behavior,
81187 modeDragNote(context).behavior
81189 function selectData(d3_event, drawn) {
81190 var selection2 = context.surface().selectAll(".layer-mapdata .data" + selectedDatum.__featurehash__);
81191 if (selection2.empty()) {
81192 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
81193 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
81194 context.enter(modeBrowse(context));
81197 selection2.classed("selected", true);
81201 if (context.container().select(".combobox").size())
81203 context.enter(modeBrowse(context));
81205 mode.zoomToSelected = function() {
81206 var extent = geoExtent(bounds_default(selectedDatum));
81207 context.map().centerZoomEase(extent.center(), context.map().trimmedExtentZoom(extent));
81209 mode.enter = function() {
81210 behaviors.forEach(context.install);
81211 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
81212 select_default2(document).call(keybinding);
81214 var sidebar = context.ui().sidebar;
81215 sidebar.show(dataEditor.datum(selectedDatum));
81216 var extent = geoExtent(bounds_default(selectedDatum));
81217 sidebar.expand(sidebar.intersects(extent));
81218 context.map().on("drawn.select-data", selectData);
81220 mode.exit = function() {
81221 behaviors.forEach(context.uninstall);
81222 select_default2(document).call(keybinding.unbind);
81223 context.surface().selectAll(".layer-mapdata .selected").classed("selected hover", false);
81224 context.map().on("drawn.select-data", null);
81225 context.ui().sidebar.hide();
81230 // modules/behavior/select.js
81231 function behaviorSelect(context) {
81232 var _tolerancePx = 4;
81233 var _lastMouseEvent = null;
81234 var _showMenu = false;
81235 var _downPointers = {};
81236 var _longPressTimeout = null;
81237 var _lastInteractionType = null;
81238 var _multiselectionPointerId = null;
81239 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
81240 function keydown(d3_event) {
81241 if (d3_event.keyCode === 32) {
81242 var activeNode = document.activeElement;
81243 if (activeNode && (/* @__PURE__ */ new Set(["INPUT", "TEXTAREA"])).has(activeNode.nodeName))
81246 if (d3_event.keyCode === 93 || // context menu key
81247 d3_event.keyCode === 32) {
81248 d3_event.preventDefault();
81250 if (d3_event.repeat)
81253 if (d3_event.shiftKey) {
81254 context.surface().classed("behavior-multiselect", true);
81256 if (d3_event.keyCode === 32) {
81257 if (!_downPointers.spacebar && _lastMouseEvent) {
81259 _longPressTimeout = window.setTimeout(didLongPress, 500, "spacebar", "spacebar");
81260 _downPointers.spacebar = {
81261 firstEvent: _lastMouseEvent,
81262 lastEvent: _lastMouseEvent
81267 function keyup(d3_event) {
81269 if (!d3_event.shiftKey) {
81270 context.surface().classed("behavior-multiselect", false);
81272 if (d3_event.keyCode === 93) {
81273 d3_event.preventDefault();
81274 _lastInteractionType = "menukey";
81275 contextmenu(d3_event);
81276 } else if (d3_event.keyCode === 32) {
81277 var pointer = _downPointers.spacebar;
81279 delete _downPointers.spacebar;
81282 d3_event.preventDefault();
81283 _lastInteractionType = "spacebar";
81284 click(pointer.firstEvent, pointer.lastEvent, "spacebar");
81288 function pointerdown(d3_event) {
81289 var id2 = (d3_event.pointerId || "mouse").toString();
81291 if (d3_event.buttons && d3_event.buttons !== 1)
81293 context.ui().closeEditMenu();
81294 if (d3_event.pointerType !== "mouse") {
81295 _longPressTimeout = window.setTimeout(didLongPress, 500, id2, "longdown-" + (d3_event.pointerType || "mouse"));
81297 _downPointers[id2] = {
81298 firstEvent: d3_event,
81299 lastEvent: d3_event
81302 function didLongPress(id2, interactionType) {
81303 var pointer = _downPointers[id2];
81306 for (var i3 in _downPointers) {
81307 _downPointers[i3].done = true;
81309 _longPressTimeout = null;
81310 _lastInteractionType = interactionType;
81312 click(pointer.firstEvent, pointer.lastEvent, id2);
81314 function pointermove(d3_event) {
81315 var id2 = (d3_event.pointerId || "mouse").toString();
81316 if (_downPointers[id2]) {
81317 _downPointers[id2].lastEvent = d3_event;
81319 if (!d3_event.pointerType || d3_event.pointerType === "mouse") {
81320 _lastMouseEvent = d3_event;
81321 if (_downPointers.spacebar) {
81322 _downPointers.spacebar.lastEvent = d3_event;
81326 function pointerup(d3_event) {
81327 var id2 = (d3_event.pointerId || "mouse").toString();
81328 var pointer = _downPointers[id2];
81331 delete _downPointers[id2];
81332 if (_multiselectionPointerId === id2) {
81333 _multiselectionPointerId = null;
81337 click(pointer.firstEvent, d3_event, id2);
81339 function pointercancel(d3_event) {
81340 var id2 = (d3_event.pointerId || "mouse").toString();
81341 if (!_downPointers[id2])
81343 delete _downPointers[id2];
81344 if (_multiselectionPointerId === id2) {
81345 _multiselectionPointerId = null;
81348 function contextmenu(d3_event) {
81349 d3_event.preventDefault();
81350 if (!+d3_event.clientX && !+d3_event.clientY) {
81351 if (_lastMouseEvent) {
81352 d3_event = _lastMouseEvent;
81357 _lastMouseEvent = d3_event;
81358 if (d3_event.pointerType === "touch" || d3_event.pointerType === "pen" || d3_event.mozInputSource && // firefox doesn't give a pointerType on contextmenu events
81359 (d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_TOUCH || d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_PEN)) {
81360 _lastInteractionType = "touch";
81362 _lastInteractionType = "rightclick";
81366 click(d3_event, d3_event);
81368 function click(firstEvent, lastEvent, pointerId) {
81370 var mapNode = context.container().select(".main-map").node();
81371 var pointGetter = utilFastMouse(mapNode);
81372 var p1 = pointGetter(firstEvent);
81373 var p2 = pointGetter(lastEvent);
81374 var dist = geoVecLength(p1, p2);
81375 if (dist > _tolerancePx || !mapContains(lastEvent)) {
81379 var targetDatum = lastEvent.target.__data__;
81380 var multiselectEntityId;
81381 if (!_multiselectionPointerId) {
81382 var selectPointerInfo = pointerDownOnSelection(pointerId);
81383 if (selectPointerInfo) {
81384 _multiselectionPointerId = selectPointerInfo.pointerId;
81385 multiselectEntityId = !selectPointerInfo.selected && selectPointerInfo.entityId;
81386 _downPointers[selectPointerInfo.pointerId].done = true;
81389 var isMultiselect = context.mode().id === "select" && // and shift key is down
81390 (lastEvent && lastEvent.shiftKey || // or we're lasso-selecting
81391 context.surface().select(".lasso").node() || // or a pointer is down over a selected feature
81392 _multiselectionPointerId && !multiselectEntityId);
81393 processClick(targetDatum, isMultiselect, p2, multiselectEntityId);
81394 function mapContains(event) {
81395 var rect = mapNode.getBoundingClientRect();
81396 return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
81398 function pointerDownOnSelection(skipPointerId) {
81399 var mode = context.mode();
81400 var selectedIDs = mode.id === "select" ? mode.selectedIDs() : [];
81401 for (var pointerId2 in _downPointers) {
81402 if (pointerId2 === "spacebar" || pointerId2 === skipPointerId)
81404 var pointerInfo = _downPointers[pointerId2];
81405 var p12 = pointGetter(pointerInfo.firstEvent);
81406 var p22 = pointGetter(pointerInfo.lastEvent);
81407 if (geoVecLength(p12, p22) > _tolerancePx)
81409 var datum2 = pointerInfo.firstEvent.target.__data__;
81410 var entity = datum2 && datum2.properties && datum2.properties.entity || datum2;
81411 if (context.graph().hasEntity(entity.id)) {
81413 pointerId: pointerId2,
81414 entityId: entity.id,
81415 selected: selectedIDs.indexOf(entity.id) !== -1
81422 function processClick(datum2, isMultiselect, point2, alsoSelectId) {
81423 var mode = context.mode();
81424 var showMenu = _showMenu;
81425 var interactionType = _lastInteractionType;
81426 var entity = datum2 && datum2.properties && datum2.properties.entity;
81429 if (datum2 && datum2.type === "midpoint") {
81430 datum2 = datum2.parents[0];
81433 if (datum2 instanceof osmEntity) {
81434 var selectedIDs = context.selectedIDs();
81435 context.selectedNoteID(null);
81436 context.selectedErrorID(null);
81437 if (!isMultiselect) {
81438 if (!showMenu || selectedIDs.length <= 1 || selectedIDs.indexOf(datum2.id) === -1) {
81439 if (alsoSelectId === datum2.id)
81440 alsoSelectId = null;
81441 selectedIDs = (alsoSelectId ? [alsoSelectId] : []).concat([datum2.id]);
81442 newMode = mode.id === "select" ? mode.selectedIDs(selectedIDs) : modeSelect(context, selectedIDs).selectBehavior(behavior);
81443 context.enter(newMode);
81446 if (selectedIDs.indexOf(datum2.id) !== -1) {
81448 selectedIDs = selectedIDs.filter(function(id2) {
81449 return id2 !== datum2.id;
81451 newMode = selectedIDs.length ? mode.selectedIDs(selectedIDs) : modeBrowse(context).selectBehavior(behavior);
81452 context.enter(newMode);
81455 selectedIDs = selectedIDs.concat([datum2.id]);
81456 newMode = mode.selectedIDs(selectedIDs);
81457 context.enter(newMode);
81460 } else if (datum2 && datum2.__featurehash__ && !isMultiselect) {
81461 context.selectedNoteID(null).enter(modeSelectData(context, datum2));
81462 } else if (datum2 instanceof osmNote && !isMultiselect) {
81463 context.selectedNoteID(datum2.id).enter(modeSelectNote(context, datum2.id));
81464 } else if (datum2 instanceof QAItem && !isMultiselect) {
81465 context.selectedErrorID(datum2.id).enter(modeSelectError(context, datum2.id, datum2.service));
81467 context.selectedNoteID(null);
81468 context.selectedErrorID(null);
81469 if (!isMultiselect && mode.id !== "browse") {
81470 context.enter(modeBrowse(context));
81473 context.ui().closeEditMenu();
81475 context.ui().showEditMenu(point2, interactionType);
81478 function cancelLongPress() {
81479 if (_longPressTimeout)
81480 window.clearTimeout(_longPressTimeout);
81481 _longPressTimeout = null;
81483 function resetProperties() {
81486 _lastInteractionType = null;
81488 function behavior(selection2) {
81490 _lastMouseEvent = context.map().lastPointerEvent();
81491 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) {
81493 if (+e3.clientX === 0 && +e3.clientY === 0) {
81494 d3_event.preventDefault();
81497 selection2.on(_pointerPrefix + "down.select", pointerdown).on("contextmenu.select", contextmenu);
81499 behavior.off = function(selection2) {
81501 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);
81502 selection2.on(_pointerPrefix + "down.select", null).on("contextmenu.select", null);
81503 context.surface().classed("behavior-multiselect", false);
81508 // modules/operations/index.js
81509 var operations_exports = {};
81510 __export(operations_exports, {
81511 operationCircularize: () => operationCircularize,
81512 operationContinue: () => operationContinue,
81513 operationCopy: () => operationCopy,
81514 operationDelete: () => operationDelete,
81515 operationDisconnect: () => operationDisconnect,
81516 operationDowngrade: () => operationDowngrade,
81517 operationExtract: () => operationExtract,
81518 operationMerge: () => operationMerge,
81519 operationMove: () => operationMove,
81520 operationOrthogonalize: () => operationOrthogonalize,
81521 operationPaste: () => operationPaste,
81522 operationReflectLong: () => operationReflectLong,
81523 operationReflectShort: () => operationReflectShort,
81524 operationReverse: () => operationReverse,
81525 operationRotate: () => operationRotate,
81526 operationSplit: () => operationSplit,
81527 operationStraighten: () => operationStraighten
81530 // modules/operations/continue.js
81531 function operationContinue(context, selectedIDs) {
81532 var _entities = selectedIDs.map(function(id2) {
81533 return context.graph().entity(id2);
81535 var _geometries = Object.assign(
81536 { line: [], vertex: [] },
81537 utilArrayGroupBy(_entities, function(entity) {
81538 return entity.geometry(context.graph());
81541 var _vertex = _geometries.vertex.length && _geometries.vertex[0];
81542 function candidateWays() {
81543 return _vertex ? context.graph().parentWays(_vertex).filter(function(parent) {
81544 return parent.geometry(context.graph()) === "line" && !parent.isClosed() && parent.affix(_vertex.id) && (_geometries.line.length === 0 || _geometries.line[0] === parent);
81547 var _candidates = candidateWays();
81548 var operation = function() {
81549 var candidate = _candidates[0];
81551 modeDrawLine(context, candidate.id, context.graph(), "line", candidate.affix(_vertex.id), true)
81554 operation.relatedEntityIds = function() {
81555 return _candidates.length ? [_candidates[0].id] : [];
81557 operation.available = function() {
81558 return _geometries.vertex.length === 1 && _geometries.line.length <= 1 && !context.features().hasHiddenConnections(_vertex, context.graph());
81560 operation.disabled = function() {
81561 if (_candidates.length === 0) {
81562 return "not_eligible";
81563 } else if (_candidates.length > 1) {
81568 operation.tooltip = function() {
81569 var disable = operation.disabled();
81570 return disable ? _t.append("operations.continue." + disable) : _t.append("operations.continue.description");
81572 operation.annotation = function() {
81573 return _t("operations.continue.annotation.line");
81575 operation.id = "continue";
81576 operation.keys = [_t("operations.continue.key")];
81577 operation.title = _t.append("operations.continue.title");
81578 operation.behavior = behaviorOperation(context).which(operation);
81582 // modules/operations/copy.js
81583 function operationCopy(context, selectedIDs) {
81584 function getFilteredIdsToCopy() {
81585 return selectedIDs.filter(function(selectedID) {
81586 var entity = context.graph().hasEntity(selectedID);
81587 return entity.hasInterestingTags() || entity.geometry(context.graph()) !== "vertex";
81590 var operation = function() {
81591 var graph = context.graph();
81592 var selected = groupEntities(getFilteredIdsToCopy(), graph);
81597 for (i3 = 0; i3 < selected.relation.length; i3++) {
81598 entity = selected.relation[i3];
81599 if (!skip[entity.id] && entity.isComplete(graph)) {
81600 canCopy.push(entity.id);
81601 skip = getDescendants(entity.id, graph, skip);
81604 for (i3 = 0; i3 < selected.way.length; i3++) {
81605 entity = selected.way[i3];
81606 if (!skip[entity.id]) {
81607 canCopy.push(entity.id);
81608 skip = getDescendants(entity.id, graph, skip);
81611 for (i3 = 0; i3 < selected.node.length; i3++) {
81612 entity = selected.node[i3];
81613 if (!skip[entity.id]) {
81614 canCopy.push(entity.id);
81617 context.copyIDs(canCopy);
81618 if (_point && (canCopy.length !== 1 || graph.entity(canCopy[0]).type !== "node")) {
81619 context.copyLonLat(context.projection.invert(_point));
81621 context.copyLonLat(null);
81624 function groupEntities(ids, graph) {
81625 var entities = ids.map(function(id2) {
81626 return graph.entity(id2);
81628 return Object.assign(
81629 { relation: [], way: [], node: [] },
81630 utilArrayGroupBy(entities, "type")
81633 function getDescendants(id2, graph, descendants) {
81634 var entity = graph.entity(id2);
81636 descendants = descendants || {};
81637 if (entity.type === "relation") {
81638 children2 = entity.members.map(function(m2) {
81641 } else if (entity.type === "way") {
81642 children2 = entity.nodes;
81646 for (var i3 = 0; i3 < children2.length; i3++) {
81647 if (!descendants[children2[i3]]) {
81648 descendants[children2[i3]] = true;
81649 descendants = getDescendants(children2[i3], graph, descendants);
81652 return descendants;
81654 operation.available = function() {
81655 return getFilteredIdsToCopy().length > 0;
81657 operation.disabled = function() {
81658 var extent = utilTotalExtent(getFilteredIdsToCopy(), context.graph());
81659 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
81660 return "too_large";
81664 operation.availableForKeypress = function() {
81665 var selection2 = window.getSelection && window.getSelection();
81666 return !selection2 || !selection2.toString();
81668 operation.tooltip = function() {
81669 var disable = operation.disabled();
81670 return disable ? _t.append("operations.copy." + disable, { n: selectedIDs.length }) : _t.append("operations.copy.description", { n: selectedIDs.length });
81672 operation.annotation = function() {
81673 return _t("operations.copy.annotation", { n: selectedIDs.length });
81676 operation.point = function(val) {
81680 operation.id = "copy";
81681 operation.keys = [uiCmd("\u2318C")];
81682 operation.title = _t.append("operations.copy.title");
81683 operation.behavior = behaviorOperation(context).which(operation);
81687 // modules/operations/disconnect.js
81688 function operationDisconnect(context, selectedIDs) {
81689 var _vertexIDs = [];
81691 var _otherIDs = [];
81693 selectedIDs.forEach(function(id2) {
81694 var entity = context.entity(id2);
81695 if (entity.type === "way") {
81697 } else if (entity.geometry(context.graph()) === "vertex") {
81698 _vertexIDs.push(id2);
81700 _otherIDs.push(id2);
81703 var _coords, _descriptionID = "", _annotationID = "features";
81704 var _disconnectingVertexIds = [];
81705 var _disconnectingWayIds = [];
81706 if (_vertexIDs.length > 0) {
81707 _disconnectingVertexIds = _vertexIDs;
81708 _vertexIDs.forEach(function(vertexID) {
81709 var action = actionDisconnect(vertexID);
81710 if (_wayIDs.length > 0) {
81711 var waysIDsForVertex = _wayIDs.filter(function(wayID) {
81712 var way = context.entity(wayID);
81713 return way.nodes.indexOf(vertexID) !== -1;
81715 action.limitWays(waysIDsForVertex);
81717 _actions.push(action);
81718 _disconnectingWayIds = _disconnectingWayIds.concat(context.graph().parentWays(context.graph().entity(vertexID)).map((d2) => d2.id));
81720 _disconnectingWayIds = utilArrayUniq(_disconnectingWayIds).filter(function(id2) {
81721 return _wayIDs.indexOf(id2) === -1;
81723 _descriptionID += _actions.length === 1 ? "single_point." : "multiple_points.";
81724 if (_wayIDs.length === 1) {
81725 _descriptionID += "single_way." + context.graph().geometry(_wayIDs[0]);
81727 _descriptionID += _wayIDs.length === 0 ? "no_ways" : "multiple_ways";
81729 } else if (_wayIDs.length > 0) {
81730 var ways = _wayIDs.map(function(id2) {
81731 return context.entity(id2);
81733 var nodes = utilGetAllNodes(_wayIDs, context.graph());
81734 _coords = nodes.map(function(n3) {
81737 var sharedActions = [];
81738 var sharedNodes = [];
81739 var unsharedActions = [];
81740 var unsharedNodes = [];
81741 nodes.forEach(function(node) {
81742 var action = actionDisconnect(node.id).limitWays(_wayIDs);
81743 if (action.disabled(context.graph()) !== "not_connected") {
81745 for (var i3 in ways) {
81746 var way = ways[i3];
81747 if (way.nodes.indexOf(node.id) !== -1) {
81754 sharedActions.push(action);
81755 sharedNodes.push(node);
81757 unsharedActions.push(action);
81758 unsharedNodes.push(node);
81762 _descriptionID += "no_points.";
81763 _descriptionID += _wayIDs.length === 1 ? "single_way." : "multiple_ways.";
81764 if (sharedActions.length) {
81765 _actions = sharedActions;
81766 _disconnectingVertexIds = sharedNodes.map((node) => node.id);
81767 _descriptionID += "conjoined";
81768 _annotationID = "from_each_other";
81770 _actions = unsharedActions;
81771 _disconnectingVertexIds = unsharedNodes.map((node) => node.id);
81772 if (_wayIDs.length === 1) {
81773 _descriptionID += context.graph().geometry(_wayIDs[0]);
81775 _descriptionID += "separate";
81779 var _extent = utilTotalExtent(_disconnectingVertexIds, context.graph());
81780 var operation = function() {
81781 context.perform(function(graph) {
81782 return _actions.reduce(function(graph2, action) {
81783 return action(graph2);
81785 }, operation.annotation());
81786 context.validator().validate();
81788 operation.relatedEntityIds = function() {
81789 if (_vertexIDs.length) {
81790 return _disconnectingWayIds;
81792 return _disconnectingVertexIds;
81794 operation.available = function() {
81795 if (_actions.length === 0)
81797 if (_otherIDs.length !== 0)
81799 if (_vertexIDs.length !== 0 && _wayIDs.length !== 0 && !_wayIDs.every(function(wayID) {
81800 return _vertexIDs.some(function(vertexID) {
81801 var way = context.entity(wayID);
81802 return way.nodes.indexOf(vertexID) !== -1;
81808 operation.disabled = function() {
81810 for (var actionIndex in _actions) {
81811 reason = _actions[actionIndex].disabled(context.graph());
81815 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
81816 return "too_large." + ((_vertexIDs.length ? _vertexIDs : _wayIDs).length === 1 ? "single" : "multiple");
81817 } else if (_coords && someMissing()) {
81818 return "not_downloaded";
81819 } else if (selectedIDs.some(context.hasHiddenConnections)) {
81820 return "connected_to_hidden";
81823 function someMissing() {
81824 if (context.inIntro())
81826 var osm = context.connection();
81828 var missing = _coords.filter(function(loc) {
81829 return !osm.isDataLoaded(loc);
81831 if (missing.length) {
81832 missing.forEach(function(loc) {
81833 context.loadTileAtLoc(loc);
81841 operation.tooltip = function() {
81842 var disable = operation.disabled();
81843 return disable ? _t.append("operations.disconnect." + disable) : _t.append("operations.disconnect.description." + _descriptionID);
81845 operation.annotation = function() {
81846 return _t("operations.disconnect.annotation." + _annotationID);
81848 operation.id = "disconnect";
81849 operation.keys = [_t("operations.disconnect.key")];
81850 operation.title = _t.append("operations.disconnect.title");
81851 operation.behavior = behaviorOperation(context).which(operation);
81855 // modules/operations/downgrade.js
81856 function operationDowngrade(context, selectedIDs) {
81857 var _affectedFeatureCount = 0;
81858 var _downgradeType = downgradeTypeForEntityIDs(selectedIDs);
81859 var _multi = _affectedFeatureCount === 1 ? "single" : "multiple";
81860 function downgradeTypeForEntityIDs(entityIds) {
81862 _affectedFeatureCount = 0;
81863 for (var i3 in entityIds) {
81864 var entityID = entityIds[i3];
81865 var type2 = downgradeTypeForEntityID(entityID);
81867 _affectedFeatureCount += 1;
81868 if (downgradeType && type2 !== downgradeType) {
81869 if (downgradeType !== "generic" && type2 !== "generic") {
81870 downgradeType = "building_address";
81872 downgradeType = "generic";
81875 downgradeType = type2;
81879 return downgradeType;
81881 function downgradeTypeForEntityID(entityID) {
81882 var graph = context.graph();
81883 var entity = graph.entity(entityID);
81884 var preset = _mainPresetIndex.match(entity, graph);
81885 if (!preset || preset.isFallback())
81887 if (entity.type === "node" && preset.id !== "address" && Object.keys(entity.tags).some(function(key) {
81888 return key.match(/^addr:.{1,}/);
81892 var geometry = entity.geometry(graph);
81893 if (geometry === "area" && entity.tags.building && !preset.tags.building) {
81896 if (geometry === "vertex" && Object.keys(entity.tags).length) {
81901 var buildingKeysToKeep = ["architect", "building", "height", "layer", "source", "type", "wheelchair"];
81902 var addressKeysToKeep = ["source"];
81903 var operation = function() {
81904 context.perform(function(graph) {
81905 for (var i3 in selectedIDs) {
81906 var entityID = selectedIDs[i3];
81907 var type2 = downgradeTypeForEntityID(entityID);
81910 var tags = Object.assign({}, graph.entity(entityID).tags);
81911 for (var key in tags) {
81912 if (type2 === "address" && addressKeysToKeep.indexOf(key) !== -1)
81914 if (type2 === "building") {
81915 if (buildingKeysToKeep.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/))
81918 if (type2 !== "generic") {
81919 if (key.match(/^addr:.{1,}/) || key.match(/^source:.{1,}/))
81924 graph = actionChangeTags(entityID, tags)(graph);
81927 }, operation.annotation());
81928 context.validator().validate();
81929 context.enter(modeSelect(context, selectedIDs));
81931 operation.available = function() {
81932 return _downgradeType;
81934 operation.disabled = function() {
81935 if (selectedIDs.some(hasWikidataTag)) {
81936 return "has_wikidata_tag";
81939 function hasWikidataTag(id2) {
81940 var entity = context.entity(id2);
81941 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
81944 operation.tooltip = function() {
81945 var disable = operation.disabled();
81946 return disable ? _t.append("operations.downgrade." + disable + "." + _multi) : _t.append("operations.downgrade.description." + _downgradeType);
81948 operation.annotation = function() {
81950 if (_downgradeType === "building_address") {
81951 suffix = "generic";
81953 suffix = _downgradeType;
81955 return _t("operations.downgrade.annotation." + suffix, { n: _affectedFeatureCount });
81957 operation.id = "downgrade";
81958 operation.keys = [uiCmd("\u232B")];
81959 operation.title = _t.append("operations.downgrade.title");
81960 operation.behavior = behaviorOperation(context).which(operation);
81964 // modules/operations/extract.js
81965 function operationExtract(context, selectedIDs) {
81966 var _amount = selectedIDs.length === 1 ? "single" : "multiple";
81967 var _geometries = utilArrayUniq(selectedIDs.map(function(entityID) {
81968 return context.graph().hasEntity(entityID) && context.graph().geometry(entityID);
81969 }).filter(Boolean));
81970 var _geometryID = _geometries.length === 1 ? _geometries[0] : "feature";
81972 var _actions = selectedIDs.map(function(entityID) {
81973 var graph = context.graph();
81974 var entity = graph.hasEntity(entityID);
81975 if (!entity || !entity.hasInterestingTags())
81977 if (entity.type === "node" && graph.parentWays(entity).length === 0)
81979 if (entity.type !== "node") {
81980 var preset = _mainPresetIndex.match(entity, graph);
81981 if (preset.geometry.indexOf("point") === -1)
81984 _extent = _extent ? _extent.extend(entity.extent(graph)) : entity.extent(graph);
81985 return actionExtract(entityID, context.projection);
81986 }).filter(Boolean);
81987 var operation = function() {
81988 var combinedAction = function(graph) {
81989 _actions.forEach(function(action) {
81990 graph = action(graph);
81994 context.perform(combinedAction, operation.annotation());
81995 var extractedNodeIDs = _actions.map(function(action) {
81996 return action.getExtractedNodeID();
81998 context.enter(modeSelect(context, extractedNodeIDs));
82000 operation.available = function() {
82001 return _actions.length && selectedIDs.length === _actions.length;
82003 operation.disabled = function() {
82004 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
82005 return "too_large";
82006 } else if (selectedIDs.some(function(entityID) {
82007 return context.graph().geometry(entityID) === "vertex" && context.hasHiddenConnections(entityID);
82009 return "connected_to_hidden";
82013 operation.tooltip = function() {
82014 var disableReason = operation.disabled();
82015 if (disableReason) {
82016 return _t.append("operations.extract." + disableReason + "." + _amount);
82018 return _t.append("operations.extract.description." + _geometryID + "." + _amount);
82021 operation.annotation = function() {
82022 return _t("operations.extract.annotation", { n: selectedIDs.length });
82024 operation.id = "extract";
82025 operation.keys = [_t("operations.extract.key")];
82026 operation.title = _t.append("operations.extract.title");
82027 operation.behavior = behaviorOperation(context).which(operation);
82031 // modules/operations/merge.js
82032 function operationMerge(context, selectedIDs) {
82033 var _action = getAction();
82034 function getAction() {
82035 var join = actionJoin(selectedIDs);
82036 if (!join.disabled(context.graph()))
82038 var merge2 = actionMerge(selectedIDs);
82039 if (!merge2.disabled(context.graph()))
82041 var mergePolygon = actionMergePolygon(selectedIDs);
82042 if (!mergePolygon.disabled(context.graph()))
82043 return mergePolygon;
82044 var mergeNodes = actionMergeNodes(selectedIDs);
82045 if (!mergeNodes.disabled(context.graph()))
82047 if (join.disabled(context.graph()) !== "not_eligible")
82049 if (merge2.disabled(context.graph()) !== "not_eligible")
82051 if (mergePolygon.disabled(context.graph()) !== "not_eligible")
82052 return mergePolygon;
82055 var operation = function() {
82056 if (operation.disabled())
82058 context.perform(_action, operation.annotation());
82059 context.validator().validate();
82060 var resultIDs = selectedIDs.filter(context.hasEntity);
82061 if (resultIDs.length > 1) {
82062 var interestingIDs = resultIDs.filter(function(id2) {
82063 return context.entity(id2).hasInterestingTags();
82065 if (interestingIDs.length)
82066 resultIDs = interestingIDs;
82068 context.enter(modeSelect(context, resultIDs));
82070 operation.available = function() {
82071 return selectedIDs.length >= 2;
82073 operation.disabled = function() {
82074 var actionDisabled = _action.disabled(context.graph());
82075 if (actionDisabled)
82076 return actionDisabled;
82077 var osm = context.connection();
82078 if (osm && _action.resultingWayNodesLength && _action.resultingWayNodesLength(context.graph()) > osm.maxWayNodes()) {
82079 return "too_many_vertices";
82083 operation.tooltip = function() {
82084 var disabled = operation.disabled();
82086 if (disabled === "conflicting_relations") {
82087 return _t.append("operations.merge.conflicting_relations");
82089 if (disabled === "restriction" || disabled === "connectivity") {
82091 "operations.merge.damage_relation",
82092 { relation: _mainPresetIndex.item("type/" + disabled).name() }
82095 return _t.append("operations.merge." + disabled);
82097 return _t.append("operations.merge.description");
82099 operation.annotation = function() {
82100 return _t("operations.merge.annotation", { n: selectedIDs.length });
82102 operation.id = "merge";
82103 operation.keys = [_t("operations.merge.key")];
82104 operation.title = _t.append("operations.merge.title");
82105 operation.behavior = behaviorOperation(context).which(operation);
82109 // modules/operations/paste.js
82110 function operationPaste(context) {
82112 var operation = function() {
82115 var oldIDs = context.copyIDs();
82116 if (!oldIDs.length)
82118 var projection2 = context.projection;
82119 var extent = geoExtent();
82120 var oldGraph = context.copyGraph();
82122 var action = actionCopyEntities(oldIDs, oldGraph);
82123 context.perform(action);
82124 var copies = action.copies();
82125 var originals = /* @__PURE__ */ new Set();
82126 Object.values(copies).forEach(function(entity) {
82127 originals.add(entity.id);
82129 for (var id2 in copies) {
82130 var oldEntity = oldGraph.entity(id2);
82131 var newEntity = copies[id2];
82132 extent._extend(oldEntity.extent(oldGraph));
82133 var parents = context.graph().parentWays(newEntity);
82134 var parentCopied = parents.some(function(parent) {
82135 return originals.has(parent.id);
82137 if (!parentCopied) {
82138 newIDs.push(newEntity.id);
82141 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
82142 var delta = geoVecSubtract(_pastePoint, copyPoint);
82143 context.replace(actionMove(newIDs, delta, projection2), operation.annotation());
82144 context.enter(modeSelect(context, newIDs));
82146 operation.point = function(val) {
82150 operation.available = function() {
82151 return context.mode().id === "browse";
82153 operation.disabled = function() {
82154 return !context.copyIDs().length;
82156 operation.tooltip = function() {
82157 var oldGraph = context.copyGraph();
82158 var ids = context.copyIDs();
82160 return _t.append("operations.paste.nothing_copied");
82162 return _t.append("operations.paste.description", { feature: utilDisplayLabel(oldGraph.entity(ids[0]), oldGraph), n: ids.length });
82164 operation.annotation = function() {
82165 var ids = context.copyIDs();
82166 return _t("operations.paste.annotation", { n: ids.length });
82168 operation.id = "paste";
82169 operation.keys = [uiCmd("\u2318V")];
82170 operation.title = _t.append("operations.paste.title");
82174 // modules/operations/reverse.js
82175 function operationReverse(context, selectedIDs) {
82176 var operation = function() {
82177 context.perform(function combinedReverseAction(graph) {
82178 actions().forEach(function(action) {
82179 graph = action(graph);
82182 }, operation.annotation());
82183 context.validator().validate();
82185 function actions(situation) {
82186 return selectedIDs.map(function(entityID) {
82187 var entity = context.hasEntity(entityID);
82190 if (situation === "toolbar") {
82191 if (entity.type === "way" && (!entity.isOneWay() && !entity.isSided()))
82194 var geometry = entity.geometry(context.graph());
82195 if (entity.type !== "node" && geometry !== "line")
82197 var action = actionReverse(entityID);
82198 if (action.disabled(context.graph()))
82201 }).filter(Boolean);
82203 function reverseTypeID() {
82204 var acts = actions();
82205 var nodeActionCount = acts.filter(function(act) {
82206 var entity = context.hasEntity(act.entityID());
82207 return entity && entity.type === "node";
82209 if (nodeActionCount === 0)
82211 if (nodeActionCount === acts.length)
82215 operation.available = function(situation) {
82216 return actions(situation).length > 0;
82218 operation.disabled = function() {
82221 operation.tooltip = function() {
82222 return _t.append("operations.reverse.description." + reverseTypeID());
82224 operation.annotation = function() {
82225 var acts = actions();
82226 return _t("operations.reverse.annotation." + reverseTypeID(), { n: acts.length });
82228 operation.id = "reverse";
82229 operation.keys = [_t("operations.reverse.key")];
82230 operation.title = _t.append("operations.reverse.title");
82231 operation.behavior = behaviorOperation(context).which(operation);
82235 // modules/operations/split.js
82236 function operationSplit(context, selectedIDs) {
82237 var _vertexIds = selectedIDs.filter(function(id2) {
82238 return context.graph().geometry(id2) === "vertex";
82240 var _selectedWayIds = selectedIDs.filter(function(id2) {
82241 var entity = context.graph().hasEntity(id2);
82242 return entity && entity.type === "way";
82244 var _isAvailable = _vertexIds.length > 0 && _vertexIds.length + _selectedWayIds.length === selectedIDs.length;
82245 var _action = actionSplit(_vertexIds);
82247 var _geometry = "feature";
82248 var _waysAmount = "single";
82249 var _nodesAmount = _vertexIds.length === 1 ? "single" : "multiple";
82250 if (_isAvailable) {
82251 if (_selectedWayIds.length)
82252 _action.limitWays(_selectedWayIds);
82253 _ways = _action.ways(context.graph());
82254 var geometries = {};
82255 _ways.forEach(function(way) {
82256 geometries[way.geometry(context.graph())] = true;
82258 if (Object.keys(geometries).length === 1) {
82259 _geometry = Object.keys(geometries)[0];
82261 _waysAmount = _ways.length === 1 ? "single" : "multiple";
82263 var operation = function() {
82264 var difference = context.perform(_action, operation.annotation());
82265 var idsToSelect = _vertexIds.concat(difference.extantIDs().filter(function(id2) {
82266 return context.entity(id2).type === "way";
82268 context.enter(modeSelect(context, idsToSelect));
82270 operation.relatedEntityIds = function() {
82271 return _selectedWayIds.length ? [] : _ways.map((way) => way.id);
82273 operation.available = function() {
82274 return _isAvailable;
82276 operation.disabled = function() {
82277 var reason = _action.disabled(context.graph());
82280 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82281 return "connected_to_hidden";
82285 operation.tooltip = function() {
82286 var disable = operation.disabled();
82287 return disable ? _t.append("operations.split." + disable) : _t.append("operations.split.description." + _geometry + "." + _waysAmount + "." + _nodesAmount + "_node");
82289 operation.annotation = function() {
82290 return _t("operations.split.annotation." + _geometry, { n: _ways.length });
82292 operation.icon = function() {
82293 if (_waysAmount === "multiple") {
82294 return "#iD-operation-split-multiple";
82296 return "#iD-operation-split";
82299 operation.id = "split";
82300 operation.keys = [_t("operations.split.key")];
82301 operation.title = _t.append("operations.split.title");
82302 operation.behavior = behaviorOperation(context).which(operation);
82306 // modules/operations/straighten.js
82307 function operationStraighten(context, selectedIDs) {
82308 var _wayIDs = selectedIDs.filter(function(id2) {
82309 return id2.charAt(0) === "w";
82311 var _nodeIDs = selectedIDs.filter(function(id2) {
82312 return id2.charAt(0) === "n";
82314 var _amount = (_wayIDs.length ? _wayIDs : _nodeIDs).length === 1 ? "single" : "multiple";
82315 var _nodes = utilGetAllNodes(selectedIDs, context.graph());
82316 var _coords = _nodes.map(function(n3) {
82319 var _extent = utilTotalExtent(selectedIDs, context.graph());
82320 var _action = chooseAction();
82322 function chooseAction() {
82323 if (_wayIDs.length === 0 && _nodeIDs.length > 2) {
82324 _geometry = "point";
82325 return actionStraightenNodes(_nodeIDs, context.projection);
82326 } else if (_wayIDs.length > 0 && (_nodeIDs.length === 0 || _nodeIDs.length === 2)) {
82327 var startNodeIDs = [];
82328 var endNodeIDs = [];
82329 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82330 var entity = context.entity(selectedIDs[i3]);
82331 if (entity.type === "node") {
82333 } else if (entity.type !== "way" || entity.isClosed()) {
82336 startNodeIDs.push(entity.first());
82337 endNodeIDs.push(entity.last());
82339 startNodeIDs = startNodeIDs.filter(function(n3) {
82340 return startNodeIDs.indexOf(n3) === startNodeIDs.lastIndexOf(n3);
82342 endNodeIDs = endNodeIDs.filter(function(n3) {
82343 return endNodeIDs.indexOf(n3) === endNodeIDs.lastIndexOf(n3);
82345 if (utilArrayDifference(startNodeIDs, endNodeIDs).length + utilArrayDifference(endNodeIDs, startNodeIDs).length !== 2)
82347 var wayNodeIDs = utilGetAllNodes(_wayIDs, context.graph()).map(function(node) {
82350 if (wayNodeIDs.length <= 2)
82352 if (_nodeIDs.length === 2 && (wayNodeIDs.indexOf(_nodeIDs[0]) === -1 || wayNodeIDs.indexOf(_nodeIDs[1]) === -1))
82354 if (_nodeIDs.length) {
82355 _extent = utilTotalExtent(_nodeIDs, context.graph());
82357 _geometry = "line";
82358 return actionStraightenWay(selectedIDs, context.projection);
82362 function operation() {
82365 context.perform(_action, operation.annotation());
82366 window.setTimeout(function() {
82367 context.validator().validate();
82370 operation.available = function() {
82371 return Boolean(_action);
82373 operation.disabled = function() {
82374 var reason = _action.disabled(context.graph());
82377 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
82378 return "too_large";
82379 } else if (someMissing()) {
82380 return "not_downloaded";
82381 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82382 return "connected_to_hidden";
82385 function someMissing() {
82386 if (context.inIntro())
82388 var osm = context.connection();
82390 var missing = _coords.filter(function(loc) {
82391 return !osm.isDataLoaded(loc);
82393 if (missing.length) {
82394 missing.forEach(function(loc) {
82395 context.loadTileAtLoc(loc);
82403 operation.tooltip = function() {
82404 var disable = operation.disabled();
82405 return disable ? _t.append("operations.straighten." + disable + "." + _amount) : _t.append("operations.straighten.description." + _geometry + (_wayIDs.length === 1 ? "" : "s"));
82407 operation.annotation = function() {
82408 return _t("operations.straighten.annotation." + _geometry, { n: _wayIDs.length ? _wayIDs.length : _nodeIDs.length });
82410 operation.id = "straighten";
82411 operation.keys = [_t("operations.straighten.key")];
82412 operation.title = _t.append("operations.straighten.title");
82413 operation.behavior = behaviorOperation(context).which(operation);
82417 // modules/modes/select.js
82418 function modeSelect(context, selectedIDs) {
82423 var keybinding = utilKeybinding("select");
82424 var _breatheBehavior = behaviorBreathe(context);
82425 var _modeDragNode = modeDragNode(context);
82426 var _selectBehavior;
82427 var _behaviors = [];
82428 var _operations = [];
82429 var _newFeature = false;
82430 var _follow = false;
82431 var _focusedParentWayId;
82432 var _focusedVertexIds;
82433 function singular() {
82434 if (selectedIDs && selectedIDs.length === 1) {
82435 return context.hasEntity(selectedIDs[0]);
82438 function selectedEntities() {
82439 return selectedIDs.map(function(id2) {
82440 return context.hasEntity(id2);
82441 }).filter(Boolean);
82443 function checkSelectedIDs() {
82445 if (Array.isArray(selectedIDs)) {
82446 ids = selectedIDs.filter(function(id2) {
82447 return context.hasEntity(id2);
82451 context.enter(modeBrowse(context));
82453 } else if (selectedIDs.length > 1 && ids.length === 1 || selectedIDs.length === 1 && ids.length > 1) {
82454 context.enter(modeSelect(context, ids));
82460 function parentWaysIdsOfSelection(onlyCommonParents) {
82461 var graph = context.graph();
82463 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82464 var entity = context.hasEntity(selectedIDs[i3]);
82465 if (!entity || entity.geometry(graph) !== "vertex") {
82468 var currParents = graph.parentWays(entity).map(function(w2) {
82471 if (!parents.length) {
82472 parents = currParents;
82475 parents = (onlyCommonParents ? utilArrayIntersection : utilArrayUnion)(parents, currParents);
82476 if (!parents.length) {
82482 function childNodeIdsOfSelection(onlyCommon) {
82483 var graph = context.graph();
82485 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82486 var entity = context.hasEntity(selectedIDs[i3]);
82487 if (!entity || !["area", "line"].includes(entity.geometry(graph))) {
82490 var currChilds = graph.childNodes(entity).map(function(node) {
82493 if (!childs.length) {
82494 childs = currChilds;
82497 childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds);
82498 if (!childs.length) {
82504 function checkFocusedParent() {
82505 if (_focusedParentWayId) {
82506 var parents = parentWaysIdsOfSelection(true);
82507 if (parents.indexOf(_focusedParentWayId) === -1)
82508 _focusedParentWayId = null;
82511 function parentWayIdForVertexNavigation() {
82512 var parentIds = parentWaysIdsOfSelection(true);
82513 if (_focusedParentWayId && parentIds.indexOf(_focusedParentWayId) !== -1) {
82514 return _focusedParentWayId;
82516 return parentIds.length ? parentIds[0] : null;
82518 mode.selectedIDs = function(val) {
82519 if (!arguments.length)
82520 return selectedIDs;
82524 mode.zoomToSelected = function() {
82525 context.map().zoomToEase(selectedEntities());
82527 mode.newFeature = function(val) {
82528 if (!arguments.length)
82529 return _newFeature;
82533 mode.selectBehavior = function(val) {
82534 if (!arguments.length)
82535 return _selectBehavior;
82536 _selectBehavior = val;
82539 mode.follow = function(val) {
82540 if (!arguments.length)
82545 function loadOperations() {
82546 _operations.forEach(function(operation) {
82547 if (operation.behavior) {
82548 context.uninstall(operation.behavior);
82551 _operations = Object.values(operations_exports).map(function(o2) {
82552 return o2(context, selectedIDs);
82553 }).filter(function(o2) {
82554 return o2.id !== "delete" && o2.id !== "downgrade" && o2.id !== "copy";
82556 // group copy/downgrade/delete operation together at the end of the list
82557 operationCopy(context, selectedIDs),
82558 operationDowngrade(context, selectedIDs),
82559 operationDelete(context, selectedIDs)
82560 ]).filter(function(operation) {
82561 return operation.available();
82563 _operations.forEach(function(operation) {
82564 if (operation.behavior) {
82565 context.install(operation.behavior);
82568 context.ui().closeEditMenu();
82570 mode.operations = function() {
82571 return _operations;
82573 mode.enter = function() {
82574 if (!checkSelectedIDs())
82576 context.features().forceVisible(selectedIDs);
82577 _modeDragNode.restoreSelectedIDs(selectedIDs);
82579 if (!_behaviors.length) {
82580 if (!_selectBehavior)
82581 _selectBehavior = behaviorSelect(context);
82583 behaviorPaste(context),
82585 behaviorHover(context).on("hover", context.ui().sidebar.hoverModeSelect),
82587 behaviorLasso(context),
82588 _modeDragNode.behavior,
82589 modeDragNote(context).behavior
82592 _behaviors.forEach(context.install);
82593 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);
82594 select_default2(document).call(keybinding);
82595 context.ui().sidebar.select(selectedIDs, _newFeature);
82596 context.history().on("change.select", function() {
82599 }).on("undone.select", checkSelectedIDs).on("redone.select", checkSelectedIDs);
82600 context.map().on("drawn.select", selectElements).on("crossEditableZoom.select", function() {
82602 _breatheBehavior.restartIfNeeded(context.surface());
82604 context.map().doubleUpHandler().on("doubleUp.modeSelect", didDoubleUp);
82607 var extent = geoExtent();
82608 var graph = context.graph();
82609 selectedIDs.forEach(function(id2) {
82610 var entity = context.entity(id2);
82611 extent._extend(entity.extent(graph));
82613 var loc = extent.center();
82614 context.map().centerEase(loc);
82617 function nudgeSelection(delta) {
82618 return function() {
82619 if (!context.map().withinEditableZoom())
82621 var moveOp = operationMove(context, selectedIDs);
82622 if (moveOp.disabled()) {
82623 context.ui().flash.duration(4e3).iconName("#iD-operation-" + moveOp.id).iconClass("operation disabled").label(moveOp.tooltip())();
82625 context.perform(actionMove(selectedIDs, delta, context.projection), moveOp.annotation());
82626 context.validator().validate();
82630 function scaleSelection(factor) {
82631 return function() {
82632 if (!context.map().withinEditableZoom())
82634 let nodes = utilGetAllNodes(selectedIDs, context.graph());
82635 let isUp = factor > 1;
82636 if (nodes.length <= 1)
82638 let extent2 = utilTotalExtent(selectedIDs, context.graph());
82639 function scalingDisabled() {
82641 return "too_small";
82642 } else if (extent2.percentContainedIn(context.map().extent()) < 0.8) {
82643 return "too_large";
82644 } else if (someMissing() || selectedIDs.some(incompleteRelation)) {
82645 return "not_downloaded";
82646 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82647 return "connected_to_hidden";
82650 function tooSmall() {
82653 let dLon = Math.abs(extent2[1][0] - extent2[0][0]);
82654 let dLat = Math.abs(extent2[1][1] - extent2[0][1]);
82655 return dLon < geoMetersToLon(1, extent2[1][1]) && dLat < geoMetersToLat(1);
82657 function someMissing() {
82658 if (context.inIntro())
82660 let osm = context.connection();
82662 let missing = nodes.filter(function(n3) {
82663 return !osm.isDataLoaded(n3.loc);
82665 if (missing.length) {
82666 missing.forEach(function(loc2) {
82667 context.loadTileAtLoc(loc2);
82674 function incompleteRelation(id2) {
82675 let entity = context.entity(id2);
82676 return entity.type === "relation" && !entity.isComplete(context.graph());
82679 const disabled = scalingDisabled();
82681 let multi = selectedIDs.length === 1 ? "single" : "multiple";
82682 context.ui().flash.duration(4e3).iconName("#iD-icon-no").iconClass("operation disabled").label(_t.append("operations.scale." + disabled + "." + multi))();
82684 const pivot = context.projection(extent2.center());
82685 const annotation = _t("operations.scale.annotation." + (isUp ? "up" : "down") + ".feature", { n: selectedIDs.length });
82686 context.perform(actionScale(selectedIDs, pivot, factor, context.projection), annotation);
82687 context.validator().validate();
82691 function didDoubleUp(d3_event, loc2) {
82692 if (!context.map().withinEditableZoom())
82694 var target = select_default2(d3_event.target);
82695 var datum2 = target.datum();
82696 var entity = datum2 && datum2.properties && datum2.properties.entity;
82699 if (entity instanceof osmWay && target.classed("target")) {
82700 var choice = geoChooseEdge(context.graph().childNodes(entity), loc2, context.projection);
82701 var prev = entity.nodes[choice.index - 1];
82702 var next = entity.nodes[choice.index];
82704 actionAddMidpoint({ loc: choice.loc, edge: [prev, next] }, osmNode()),
82705 _t("operations.add.annotation.vertex")
82707 context.validator().validate();
82708 } else if (entity.type === "midpoint") {
82710 actionAddMidpoint({ loc: entity.loc, edge: entity.edge }, osmNode()),
82711 _t("operations.add.annotation.vertex")
82713 context.validator().validate();
82716 function selectElements() {
82717 if (!checkSelectedIDs())
82719 var surface = context.surface();
82720 surface.selectAll(".selected-member").classed("selected-member", false);
82721 surface.selectAll(".selected").classed("selected", false);
82722 surface.selectAll(".related").classed("related", false);
82723 checkFocusedParent();
82724 if (_focusedParentWayId) {
82725 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
82727 if (context.map().withinEditableZoom()) {
82728 surface.selectAll(utilDeepMemberSelector(
82732 /* skipMultipolgonMembers */
82733 )).classed("selected-member", true);
82734 surface.selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())).classed("selected", true);
82738 if (context.container().select(".combobox").size())
82740 context.enter(modeBrowse(context));
82742 function firstVertex(d3_event) {
82743 d3_event.preventDefault();
82744 var entity = singular();
82745 var parentId = parentWayIdForVertexNavigation();
82747 if (entity && entity.type === "way") {
82749 } else if (parentId) {
82750 way = context.entity(parentId);
82752 _focusedParentWayId = way && way.id;
82755 mode.selectedIDs([way.first()]).follow(true)
82759 function lastVertex(d3_event) {
82760 d3_event.preventDefault();
82761 var entity = singular();
82762 var parentId = parentWayIdForVertexNavigation();
82764 if (entity && entity.type === "way") {
82766 } else if (parentId) {
82767 way = context.entity(parentId);
82769 _focusedParentWayId = way && way.id;
82772 mode.selectedIDs([way.last()]).follow(true)
82776 function previousVertex(d3_event) {
82777 d3_event.preventDefault();
82778 var parentId = parentWayIdForVertexNavigation();
82779 _focusedParentWayId = parentId;
82782 var way = context.entity(parentId);
82783 var length = way.nodes.length;
82784 var curr = way.nodes.indexOf(selectedIDs[0]);
82788 } else if (way.isClosed()) {
82789 index = length - 2;
82791 if (index !== -1) {
82793 mode.selectedIDs([way.nodes[index]]).follow(true)
82797 function nextVertex(d3_event) {
82798 d3_event.preventDefault();
82799 var parentId = parentWayIdForVertexNavigation();
82800 _focusedParentWayId = parentId;
82803 var way = context.entity(parentId);
82804 var length = way.nodes.length;
82805 var curr = way.nodes.indexOf(selectedIDs[0]);
82807 if (curr < length - 1) {
82809 } else if (way.isClosed()) {
82812 if (index !== -1) {
82814 mode.selectedIDs([way.nodes[index]]).follow(true)
82818 function focusNextParent(d3_event) {
82819 d3_event.preventDefault();
82820 var parents = parentWaysIdsOfSelection(true);
82821 if (!parents || parents.length < 2)
82823 var index = parents.indexOf(_focusedParentWayId);
82824 if (index < 0 || index > parents.length - 2) {
82825 _focusedParentWayId = parents[0];
82827 _focusedParentWayId = parents[index + 1];
82829 var surface = context.surface();
82830 surface.selectAll(".related").classed("related", false);
82831 if (_focusedParentWayId) {
82832 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
82835 function selectParent(d3_event) {
82836 d3_event.preventDefault();
82837 var currentSelectedIds = mode.selectedIDs();
82838 var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false);
82839 if (!parentIds.length)
82842 mode.selectedIDs(parentIds)
82844 _focusedVertexIds = currentSelectedIds;
82846 function selectChild(d3_event) {
82847 d3_event.preventDefault();
82848 var currentSelectedIds = mode.selectedIDs();
82849 var childIds = _focusedVertexIds ? _focusedVertexIds.filter((id2) => context.hasEntity(id2)) : childNodeIdsOfSelection(true);
82850 if (!childIds || !childIds.length)
82852 if (currentSelectedIds.length === 1)
82853 _focusedParentWayId = currentSelectedIds[0];
82855 mode.selectedIDs(childIds)
82859 mode.exit = function() {
82860 _newFeature = false;
82861 _focusedVertexIds = null;
82862 _operations.forEach(function(operation) {
82863 if (operation.behavior) {
82864 context.uninstall(operation.behavior);
82868 _behaviors.forEach(context.uninstall);
82869 select_default2(document).call(keybinding.unbind);
82870 context.ui().closeEditMenu();
82871 context.history().on("change.select", null).on("undone.select", null).on("redone.select", null);
82872 var surface = context.surface();
82873 surface.selectAll(".selected-member").classed("selected-member", false);
82874 surface.selectAll(".selected").classed("selected", false);
82875 surface.selectAll(".highlighted").classed("highlighted", false);
82876 surface.selectAll(".related").classed("related", false);
82877 context.map().on("drawn.select", null);
82878 context.ui().sidebar.hide();
82879 context.features().forceVisible([]);
82880 var entity = singular();
82881 if (_newFeature && entity && entity.type === "relation" && // no tags
82882 Object.keys(entity.tags).length === 0 && // no parent relations
82883 context.graph().parentRelations(entity).length === 0 && // no members or one member with no role
82884 (entity.members.length === 0 || entity.members.length === 1 && !entity.members[0].role)) {
82885 var deleteAction = actionDeleteRelation(
82888 /* don't delete untagged members */
82890 context.perform(deleteAction, _t("operations.delete.annotation.relation"));
82891 context.validator().validate();
82897 // modules/behavior/lasso.js
82898 function behaviorLasso(context) {
82899 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
82900 var behavior = function(selection2) {
82902 function pointerdown(d3_event) {
82904 if (d3_event.button === button && d3_event.shiftKey === true) {
82906 select_default2(window).on(_pointerPrefix + "move.lasso", pointermove).on(_pointerPrefix + "up.lasso", pointerup);
82907 d3_event.stopPropagation();
82910 function pointermove() {
82912 lasso = uiLasso(context);
82913 context.surface().call(lasso);
82915 lasso.p(context.map().mouse());
82917 function normalize2(a2, b2) {
82919 [Math.min(a2[0], b2[0]), Math.min(a2[1], b2[1])],
82920 [Math.max(a2[0], b2[0]), Math.max(a2[1], b2[1])]
82923 function lassoed() {
82926 var graph = context.graph();
82928 if (context.map().editableDataEnabled(
82930 /* skipZoomCheck */
82931 ) && context.map().isInWideSelection()) {
82932 limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), graph));
82933 } else if (!context.map().editableDataEnabled()) {
82936 var bounds = lasso.extent().map(context.projection.invert);
82937 var extent = geoExtent(normalize2(bounds[0], bounds[1]));
82938 var intersects = context.history().intersects(extent).filter(function(entity) {
82939 return entity.type === "node" && (!limitToNodes || limitToNodes.has(entity)) && geoPointInPolygon(context.projection(entity.loc), lasso.coordinates) && !context.features().isHidden(entity, graph, entity.geometry(graph));
82941 intersects.sort(function(node1, node2) {
82942 var parents1 = graph.parentWays(node1);
82943 var parents2 = graph.parentWays(node2);
82944 if (parents1.length && parents2.length) {
82945 var sharedParents = utilArrayIntersection(parents1, parents2);
82946 if (sharedParents.length) {
82947 var sharedParentNodes = sharedParents[0].nodes;
82948 return sharedParentNodes.indexOf(node1.id) - sharedParentNodes.indexOf(node2.id);
82950 return Number(parents1[0].id.slice(1)) - Number(parents2[0].id.slice(1));
82952 } else if (parents1.length || parents2.length) {
82953 return parents1.length - parents2.length;
82955 return node1.loc[0] - node2.loc[0];
82957 return intersects.map(function(entity) {
82961 function pointerup() {
82962 select_default2(window).on(_pointerPrefix + "move.lasso", null).on(_pointerPrefix + "up.lasso", null);
82965 var ids = lassoed();
82968 context.enter(modeSelect(context, ids));
82971 selection2.on(_pointerPrefix + "down.lasso", pointerdown);
82973 behavior.off = function(selection2) {
82974 selection2.on(_pointerPrefix + "down.lasso", null);
82979 // modules/modes/browse.js
82980 function modeBrowse(context) {
82984 title: _t.append("modes.browse.title"),
82985 description: _t.append("modes.browse.description")
82988 var _selectBehavior;
82989 var _behaviors = [];
82990 mode.selectBehavior = function(val) {
82991 if (!arguments.length)
82992 return _selectBehavior;
82993 _selectBehavior = val;
82996 mode.enter = function() {
82997 if (!_behaviors.length) {
82998 if (!_selectBehavior)
82999 _selectBehavior = behaviorSelect(context);
83001 behaviorPaste(context),
83002 behaviorHover(context).on("hover", context.ui().sidebar.hover),
83004 behaviorLasso(context),
83005 modeDragNode(context).behavior,
83006 modeDragNote(context).behavior
83009 _behaviors.forEach(context.install);
83010 if (document.activeElement && document.activeElement.blur) {
83011 document.activeElement.blur();
83014 context.ui().sidebar.show(sidebar);
83016 context.ui().sidebar.select(null);
83019 mode.exit = function() {
83020 context.ui().sidebar.hover.cancel();
83021 _behaviors.forEach(context.uninstall);
83023 context.ui().sidebar.hide();
83026 mode.sidebar = function(_2) {
83027 if (!arguments.length)
83032 mode.operations = function() {
83033 return [operationPaste(context)];
83038 // modules/behavior/add_way.js
83039 function behaviorAddWay(context) {
83040 var dispatch14 = dispatch_default("start", "startFromWay", "startFromNode");
83041 var draw = behaviorDraw(context);
83042 function behavior(surface) {
83043 draw.on("click", function() {
83044 dispatch14.apply("start", this, arguments);
83045 }).on("clickWay", function() {
83046 dispatch14.apply("startFromWay", this, arguments);
83047 }).on("clickNode", function() {
83048 dispatch14.apply("startFromNode", this, arguments);
83049 }).on("cancel", behavior.cancel).on("finish", behavior.cancel);
83050 context.map().dblclickZoomEnable(false);
83051 surface.call(draw);
83053 behavior.off = function(surface) {
83054 surface.call(draw.off);
83056 behavior.cancel = function() {
83057 window.setTimeout(function() {
83058 context.map().dblclickZoomEnable(true);
83060 context.enter(modeBrowse(context));
83062 return utilRebind(behavior, dispatch14, "on");
83065 // modules/behavior/hash.js
83066 function behaviorHash(context) {
83067 var _cachedHash = null;
83068 var _latitudeLimit = 90 - 1e-8;
83069 function computedHashParameters() {
83070 var map2 = context.map();
83071 var center = map2.center();
83072 var zoom = map2.zoom();
83073 var precision2 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
83074 var oldParams = utilObjectOmit(
83075 utilStringQs(window.location.hash),
83076 ["comment", "source", "hashtags", "walkthrough"]
83078 var newParams = {};
83079 delete oldParams.id;
83080 var selected = context.selectedIDs().filter(function(id2) {
83081 return context.hasEntity(id2);
83083 if (selected.length) {
83084 newParams.id = selected.join(",");
83086 newParams.map = zoom.toFixed(2) + "/" + center[1].toFixed(precision2) + "/" + center[0].toFixed(precision2);
83087 return Object.assign(oldParams, newParams);
83089 function computedHash() {
83090 return "#" + utilQsString(computedHashParameters(), true);
83092 function computedTitle(includeChangeCount) {
83093 var baseTitle = context.documentTitleBase() || "iD";
83097 var selected = context.selectedIDs().filter(function(id2) {
83098 return context.hasEntity(id2);
83100 if (selected.length) {
83101 var firstLabel = utilDisplayLabel(context.entity(selected[0]), context.graph());
83102 if (selected.length > 1) {
83103 contextual = _t("title.labeled_and_more", {
83104 labeled: firstLabel,
83105 count: selected.length - 1
83108 contextual = firstLabel;
83110 titleID = "context";
83112 if (includeChangeCount) {
83113 changeCount = context.history().difference().summary().length;
83114 if (changeCount > 0) {
83115 titleID = contextual ? "changes_context" : "changes";
83119 return _t("title.format." + titleID, {
83120 changes: changeCount,
83122 context: contextual
83127 function updateTitle(includeChangeCount) {
83128 if (!context.setsDocumentTitle())
83130 var newTitle = computedTitle(includeChangeCount);
83131 if (document.title !== newTitle) {
83132 document.title = newTitle;
83135 function updateHashIfNeeded() {
83136 if (context.inIntro())
83138 var latestHash = computedHash();
83139 if (_cachedHash !== latestHash) {
83140 _cachedHash = latestHash;
83141 window.history.replaceState(null, computedTitle(
83143 /* includeChangeCount */
83147 /* includeChangeCount */
83149 const q2 = utilStringQs(latestHash);
83151 corePreferences("map-location", q2.map);
83155 var _throttledUpdate = throttle_default(updateHashIfNeeded, 500);
83156 var _throttledUpdateTitle = throttle_default(function() {
83159 /* includeChangeCount */
83162 function hashchange() {
83163 if (window.location.hash === _cachedHash)
83165 _cachedHash = window.location.hash;
83166 var q2 = utilStringQs(_cachedHash);
83167 var mapArgs = (q2.map || "").split("/").map(Number);
83168 if (mapArgs.length < 3 || mapArgs.some(isNaN)) {
83169 updateHashIfNeeded();
83171 if (_cachedHash === computedHash())
83173 var mode = context.mode();
83174 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
83175 if (q2.id && mode) {
83176 var ids = q2.id.split(",").filter(function(id2) {
83177 return context.hasEntity(id2);
83179 if (ids.length && (mode.id === "browse" || mode.id === "select" && !utilArrayIdentical(mode.selectedIDs(), ids))) {
83180 context.enter(modeSelect(context, ids));
83184 var center = context.map().center();
83185 var dist = geoSphericalDistance(center, [mapArgs[2], mapArgs[1]]);
83187 if (mode && mode.id.match(/^draw/) !== null && dist > maxdist) {
83188 context.enter(modeBrowse(context));
83193 function behavior() {
83194 context.map().on("move.behaviorHash", _throttledUpdate);
83195 context.history().on("change.behaviorHash", _throttledUpdateTitle);
83196 context.on("enter.behaviorHash", _throttledUpdate);
83197 select_default2(window).on("hashchange.behaviorHash", hashchange);
83198 var q2 = utilStringQs(window.location.hash);
83200 context.zoomToEntity(q2.id.split(",")[0], !q2.map);
83202 if (q2.walkthrough === "true") {
83203 behavior.startWalkthrough = true;
83206 behavior.hadLocation = true;
83207 } else if (!q2.id && corePreferences("map-location")) {
83208 const mapArgs = corePreferences("map-location").split("/").map(Number);
83209 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
83210 updateHashIfNeeded();
83211 behavior.hadLocation = true;
83214 updateTitle(false);
83216 behavior.off = function() {
83217 _throttledUpdate.cancel();
83218 _throttledUpdateTitle.cancel();
83219 context.map().on("move.behaviorHash", null);
83220 context.on("enter.behaviorHash", null);
83221 select_default2(window).on("hashchange.behaviorHash", null);
83222 window.location.hash = "";
83227 // node_modules/d3-brush/src/brush.js
83228 var { abs: abs2, max: max2, min: min2 } = Math;
83229 function number1(e3) {
83230 return [+e3[0], +e3[1]];
83232 function number22(e3) {
83233 return [number1(e3[0]), number1(e3[1])];
83237 handles: ["w", "e"].map(type),
83238 input: function(x2, e3) {
83239 return x2 == null ? null : [[+x2[0], e3[0][1]], [+x2[1], e3[1][1]]];
83241 output: function(xy) {
83242 return xy && [xy[0][0], xy[1][0]];
83247 handles: ["n", "s"].map(type),
83248 input: function(y2, e3) {
83249 return y2 == null ? null : [[e3[0][0], +y2[0]], [e3[1][0], +y2[1]]];
83251 output: function(xy) {
83252 return xy && [xy[0][1], xy[1][1]];
83257 handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
83258 input: function(xy) {
83259 return xy == null ? null : number22(xy);
83261 output: function(xy) {
83265 function type(t2) {
83266 return { type: t2 };
83269 // modules/index.js
83272 dispatch: dispatch_default,
83273 geoMercator: mercator_default,
83274 geoProjection: projection,
83275 polygonArea: area_default3,
83276 polygonCentroid: centroid_default2,
83277 select: select_default2,
83278 selectAll: selectAll_default2,
83283 window.requestIdleCallback = window.requestIdleCallback || function(cb) {
83284 var start2 = Date.now();
83285 return window.requestAnimationFrame(function() {
83288 timeRemaining: function() {
83289 return Math.max(0, 50 - (Date.now() - start2));
83294 window.cancelIdleCallback = window.cancelIdleCallback || function(id2) {
83295 window.cancelAnimationFrame(id2);
83297 window.iD = modules_exports;
83299 //# sourceMappingURL=iD.js.map