{
  "id": "note",
  "name": {
    "en": "OpenStreetMap notes",
    "nl": "OpenStreetMap Notes",
    "de": "OpenStreetMap-Hinweise",
    "es": "Notas de OpenStreetMap",
    "ca": "Notes d'OpenStreetMap",
    "cs": "Poznámky OpenStreetMap",
    "fr": "Notes OpenStreetMap"
  },
  "description": "This layer shows notes on OpenStreetMap. Having this layer in your theme will trigger the 'add new note' functionality in the 'addNewPoint'-popup (or if your theme has no presets, it'll enable adding notes)",
  "source": {
    "osmTags": "date_created~*",
    "geoJson": "https://api.openstreetmap.org/api/0.6/notes.json?limit=10000&closed=7&bbox={x_min},{y_min},{x_max},{y_max}",
    "geoJsonZoomLevel": 10
  },
  "calculatedTags": [
    "_total_comments:=get(feat)('comments').length",
    "_first_comment:=get(feat)('comments')[0].text",
    "_all_comments:=get(feat)('comments').map(c => c.text ?? '').join('\\n')",
    "_all_usernames:=get(feat)('comments').map(c => c.user ?? 'Anonymous').join('\\n')",
    "_opened_by_anonymous_user:=get(feat)('comments')[0].user === undefined",
    "_first_user:=get(feat)('comments')[0].user",
    "_last_user:=(() => {const comms = get(feat)('comments'); return comms[comms.length - 1].user})()",
    "_last_change_date:=(() => {const comms = get(feat)('comments'); return comms[comms.length - 1].date})()",
    "_first_user_id:=get(feat)('comments')[0].uid",
    "_is_import_note:=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.\\(osm.be|org\\)/\\([a-zA-Z_-]+\\)\\(.html\\).*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()"
  ],
  "isShown": "_total_comments>0",
  "minzoom": 7,
  "title": {
    "render": {
      "en": "Note",
      "nl": "Note",
      "ca": "Nota",
      "de": "Notiz",
      "es": "Nota",
      "pa_PK": "نوٹ",
      "pl": "Notatka",
      "cs": "Poznámka",
      "fr": "Note"
    },
    "mappings": [
      {
        "if": "closed_at~*",
        "then": {
          "en": "Closed note",
          "nl": "Gesloten Note",
          "de": "Geschlossene Notiz",
          "es": "Nota cerrada",
          "pl": "Zamknięta notatka",
          "ca": "Nota tancada",
          "cs": "Uzavřená poznámka",
          "fr": "Note fermée"
        }
      }
    ]
  },
  "titleIcons": [
    {
      "ariaLabel": {
        "en": "See on OpenStreetMap.org",
        "nl": "Bekijk op OpenStreetMap.org",
        "de": "Auf OpenStreetMap.org ansehen",
        "da": "Se på OpenStreetMap.org",
        "fr": "Voir sur OpenStreetMap.org",
        "cs": "Zobrazit na OpenStreetMap.org",
        "es": "Ver en OpenStreetMap.org",
        "ca": "Vegeu a OpenStreetMap.org"
      },
      "render": ""
    }
  ],
  "pointRendering": [
    {
      "location": [
        "point",
        "centroid"
      ],
      "marker": [
        {
          "icon": {
            "render": "./assets/svg/note.svg",
            "mappings": [
              {
                "if": "closed_at~*",
                "then": "./assets/svg/resolved.svg"
              }
            ]
          }
        }
      ],
      "iconSize": "40,40",
      "iconBadges": [
        {
          "if": "_total_comments>1",
          "then": "circle:white;./assets/svg/speech_bubble.svg"
        },
        {
          "if": "_is_import_note~*",
          "then": "./assets/svg/addSmall.svg"
        }
      ],
      "anchor": "bottom"
    }
  ],
  "lineRendering": [],
  "tagRenderings": [
    {
      "id": "conversation",
      "classes": "p-0",
      "render": "{visualize_note_comments()}"
    },
    {
      "id": "add_image",
      "render": "{add_image_to_note()}"
    },
    {
      "id": "comment",
      "render": "{add_note_comment()}"
    },
    {
      "id": "nearby-images",
      "render": {
        "before": {
          "en": "