@conduction/nextcloud-vue 2.140.0 → 2.141.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +1 -1
  2. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +10 -2
  3. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -1
  5. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  6. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +11 -3
  7. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  8. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  9. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  10. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +12 -0
  11. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  12. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js +57 -40
  13. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  14. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  15. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +1 -0
  16. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  17. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +5 -3
  19. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  20. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
  21. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  22. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +65 -1
  23. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
  24. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js +120 -69
  25. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
  26. package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
  27. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +47 -9
  28. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
  29. package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
  30. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
  31. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +3 -3
  32. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  34. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  35. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +2 -0
  36. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  37. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +1 -1
  38. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  39. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue.js +1 -1
  40. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js +10 -0
  41. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js.map +1 -1
  42. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js +34 -26
  43. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js.map +1 -1
  44. package/dist/esm/l10n/en.json.js +2 -1
  45. package/dist/esm/l10n/en.json.js.map +1 -1
  46. package/dist/esm/l10n/nl.json.js +2 -1
  47. package/dist/esm/l10n/nl.json.js.map +1 -1
  48. package/dist/esm/library-style.js +1 -1
  49. package/dist/esm/nextcloud-vue.css +652 -391
  50. package/dist/esm/utils/groupSublines.js +120 -0
  51. package/dist/esm/utils/groupSublines.js.map +1 -0
  52. package/dist/nextcloud-vue.cjs.js +974 -638
  53. package/dist/nextcloud-vue.cjs.js.map +2 -2
  54. package/dist/nextcloud-vue.css +652 -391
  55. package/l10n/en.json +2 -1
  56. package/l10n/nl.json +2 -1
  57. package/package.json +1 -1
  58. package/src/components/CnAssignDialog/CnAssignDialog.vue +10 -2
  59. package/src/components/CnCellRenderer/CnCellRenderer.vue +11 -3
  60. package/src/components/CnChartWidget/CnChartWidget.md +1 -0
  61. package/src/components/CnChartWidget/CnChartWidget.vue +49 -4
  62. package/src/components/CnDashboardPage/CnDashboardPage.vue +1 -0
  63. package/src/components/CnDataTable/CnDataTable.vue +6 -3
  64. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +101 -3
  65. package/src/components/CnMapWidget/CnMapWidget.vue +47 -9
  66. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +3 -3
  67. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +20 -1
  68. package/src/components/CnRecordListWidget/CnRecordNoteRows.vue +33 -9
  69. package/src/css/dialog.css +13 -1
  70. package/src/css/look-board-detail.css +12 -9
  71. package/src/css/look-board-index.css +90 -7
  72. package/src/css/look-board.css +92 -0
  73. package/src/css/table.css +12 -0
  74. package/src/utils/groupSublines.js +125 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CnMapWidget.vue2.js","sources":["../../../../src/components/CnMapWidget/CnMapWidget.vue"],"sourcesContent":["<!--\n CnMapWidget — Renders a Leaflet map with declarative layers + markers.\n\n A library-first wrapper around Leaflet that consumes the manifest's\n page-shape directly: `{ center, zoom, layers, markers, clustering,\n height, autoFit }`. Layer dispatch picks `L.tileLayer |\n L.tileLayer.wms | L.geoJSON` per `layer.type`; unknown types log a\n console.warn and are skipped (matches CnChartWidget's\n unknown-`chartKind` posture).\n\n Marker support is opt-in:\n - `markers.features[]` — inline GeoJSON FeatureCollection.\n - `markers.dataSource.url` — fetched on mount; the response may\n be either a GeoJSON FeatureCollection OR a flat array of rows\n (in which case `latField`, `lngField`, `popupField` drive the\n conversion).\n - `markers.dataSource.{register, schema}` — plots the objects of an\n OpenRegister register/schema, reading each one's `@self.geo`\n (falling back to `latField` / `lngField` on the object itself).\n Objects with no usable location are skipped, not plotted at (0, 0).\n\n `leaflet.markercluster`'s JS lazy-loads only when `clustering: true`\n (or `markers.clustering: true`), so a consumer without clustering does\n not pay the cluster bundle cost. Its two stylesheets are imported\n eagerly with Leaflet's own, because a cluster with no CSS paints as a\n bare number in the corner of the map.\n\n This component is the page's primitive — `CnMapPage` wraps it for\n manifest-driven `type: \"map\"` routes. Apps that want to embed a map\n inside a custom dashboard slot can `<CnMapWidget v-bind=\"props\" />`\n directly.\n\n Spec: REQ-MMW-* (manifest-map-widget).\n-->\n<template>\n\t<div\n\t\tclass=\"cn-map-widget\"\n\t\t:class=\"{ 'cn-map-widget--fullscreen': isFullscreen }\"\n\t\t:style=\"{ height: isFullscreen ? null : resolvedHeight }\">\n\t\t<div\n\t\t\tv-if=\"leafletAvailable\"\n\t\t\tref=\"mapEl\"\n\t\t\tclass=\"cn-map-widget__leaflet\"\n\t\t\trole=\"application\"\n\t\t\t:aria-label=\"resolvedAriaLabel\"\n\t\t\ttabindex=\"0\" />\n\t\t<div v-else class=\"cn-map-widget__fallback\">\n\t\t\t<!--\n\t\t\t\t@slot fallback\n\t\t\t\t@description Shown when Leaflet is not available (e.g. test environments where\n\t\t\t\tthe global `L` cannot be loaded).\n\t\t\t-->\n\t\t\t<slot name=\"fallback\">\n\t\t\t\t<p class=\"cn-map-widget__error\">\n\t\t\t\t\t{{ unavailableLabel }}\n\t\t\t\t</p>\n\t\t\t</slot>\n\t\t</div>\n\t\t<p\n\t\t\tv-if=\"markerStatusText\"\n\t\t\tclass=\"cn-map-widget__note cn-map-widget__note--status\"\n\t\t\t:class=\"{ 'cn-map-widget__note--error': markersFailed }\"\n\t\t\t:role=\"markersFailed ? 'alert' : null\"\n\t\t\t:data-testid=\"markersFailed ? 'cn-map-markers-failed' : 'cn-map-markers-empty'\">\n\t\t\t{{ markerStatusText }}\n\t\t</p>\n\t\t<p v-if=\"unplottedCount > 0\" class=\"cn-map-widget__note\" data-testid=\"cn-map-unplotted\">\n\t\t\t{{ unplottedLabel }}\n\t\t</p>\n\t\t<div v-if=\"$slots.legend || $slots.legend\" class=\"cn-map-widget__legend\">\n\t\t\t<!--\n\t\t\t\t@slot legend\n\t\t\t\t@description Custom legend overlay. Receives `{ layers, markers }` as scoped props.\n\t\t\t\tPositioned absolute (top-right) by default; consumers MAY override with their own\n\t\t\t\tcontainer.\n\t\t\t-->\n\t\t\t<slot name=\"legend\" :layers=\"cfg.layers\" :markers=\"cfg.markers\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport DOMPurify from 'dompurify'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { objectToGeoFeature } from '../../utils/geo.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { objectDisplayName } from '../../utils/objectName.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { safeHref } from '../../utils/safeHref.js'\nimport { SAFE_MARKDOWN_DOMPURIFY_CONFIG } from '../../utils/safeMarkdownDompurifyConfig.js'\nimport { fromImagePoint, hasImagePosition, imageBounds, paddedImageBounds, toImagePoint } from './imageCoordinates.js'\n\n// Leaflet's own stylesheet positions the map panes, tiles the tile\n// images, and places the zoom/attribution controls. The JS is lazy-loaded\n// in mounted(), but the CSS must be present whenever this widget renders —\n// otherwise the map paints unstyled (no basemap, mispositioned controls).\n// Import it here so the widget is self-styling for every consumer rather\n// than relying on another component (e.g. a location picker) to pull it in.\nimport 'leaflet/dist/leaflet.css'\n// The cluster plugin's JS stays lazy, but its CSS cannot be: a cluster is a\n// `<div class=\"marker-cluster\">` with a count in it, and with no stylesheet it\n// paints as a bare number in the top-left corner of the map instead of a\n// bubble on the cluster's position. Two small files, ~2 KB together, and\n// `leaflet.markercluster` is a declared dependency either way.\nimport 'leaflet.markercluster/dist/MarkerCluster.css'\nimport 'leaflet.markercluster/dist/MarkerCluster.Default.css'\n\nconst ALLOWED_LAYER_TYPES = ['tile', 'wms', 'wfs', 'geojson', 'image']\n\n// Raw input on the map container, which is what tells a user's pan or zoom from\n// ours. Leaflet's own `movestart` / `zoomstart` fire for `fitBounds` too, so\n// they cannot separate the two; these events Leaflet never synthesises. A\n// gesture only ARMS the flag — `moveend` / `zoomend` commits it — because half\n// of these change nothing on their own: a page scroll over a map with\n// `scrollWheelZoom` off is a wheel event, and tabbing through is a keydown.\nconst VIEW_GESTURE_EVENTS = ['mousedown', 'touchstart', 'wheel', 'keydown']\n\n// Nextcloud sends `Referrer-Policy: no-referrer` on every page, and OpenStreetMap's\n// tile CDN answers a refererless request with a \"not following the tile usage policy\"\n// tile instead of the map. An `<img>`-level policy overrides the document's, and\n// `origin` sends only the scheme+host, never the path a case id could sit in.\nconst TILE_REFERRER_POLICY = 'strict-origin-when-cross-origin'\n\n/**\n * Apply the tile defaults a consumer did not set.\n *\n * @param {object} opts Leaflet layer options, already shallow-copied.\n * @return {object} The same object, with `referrerPolicy` defaulted.\n */\nfunction withTileDefaults(opts) {\n\tif (opts.referrerPolicy === undefined) {\n\t\topts.referrerPolicy = TILE_REFERRER_POLICY\n\t}\n\treturn opts\n}\n\n/**\n * A comparable snapshot of one config value, for the render watchers.\n *\n * @param {*} value The config value.\n * @return {string|object} A stable string; a fresh object when it will not\n * serialise, which always compares unequal and so keeps rendering.\n */\nfunction configKey(value) {\n\ttry {\n\t\treturn JSON.stringify(value ?? null)\n\t} catch {\n\t\treturn {}\n\t}\n}\n\n// Fallback background used when the consumer configures no `basemaps` and no\n// `tile`/`wms` entry in `layers` — otherwise the map paints white. Consuming\n// apps MUST allow this host in their Content-Security-Policy `img-src`\n// (Nextcloud blocks external images by default) or the tiles are CSP-blocked\n// and the map stays blank.\nconst DEFAULT_BASEMAP = {\n\turl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n\toptions: {\n\t\tattribution: '© OpenStreetMap contributors',\n\t\tmaxZoom: 19,\n\t},\n}\n\n// MDI paths for the custom control buttons, inlined so the widget carries no\n// icon-font dependency and renders identically inside a Leaflet control bar.\nconst ICON_FIT = 'M9.5,13.09L10.91,14.5L6.41,19H10V21H3V14H5V17.59L9.5,13.09M10.91,9.5L9.5,10.91L5,6.41V10H3V3H10V5H6.41L10.91,9.5M14.5,13.09L19,17.59V14H21V21H14V19H17.59L13.09,14.5L14.5,13.09M13.09,9.5L17.59,5H14V3H21V10H19V6.41L14.5,10.91L13.09,9.5Z'\nconst ICON_LOCATE = 'M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z'\nconst ICON_FULLSCREEN = 'M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z'\nconst ICON_FULLSCREEN_EXIT = 'M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z'\nconst ICON_ZOOM_IN = 'M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z'\nconst ICON_ZOOM_OUT = 'M19,13H5V11H19V13Z'\nconst ICON_CROSSHAIRS = 'M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z'\n\n/**\n * Wrap an MDI path in a 24x24 SVG sized for a Leaflet control button.\n *\n * @param {string} path The MDI `d` attribute.\n * @return {string} SVG markup.\n */\nfunction controlIcon(path) {\n\treturn `<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"${path}\" /></svg>`\n}\n\n/**\n * CnMapWidget — Leaflet wrapper for declarative manifest-driven maps.\n *\n * Manifest usage — when CnPageRenderer dispatches a `type: \"map\"` page\n * it mounts CnMapPage, which forwards `pages[].config.{center, zoom,\n * layers, markers, height, clustering}` to this component. Manifest\n * authors do NOT mount this component themselves — declare a\n * `type: \"map\"` page instead. See CnMapPage's leading docblock for\n * the manifest example.\n *\n * Direct (non-manifest) usage:\n *\n * ```vue\n * <CnMapWidget\n * :center=\"[52.13, 5.29]\"\n * :zoom=\"7\"\n * :layers=\"[\n * { type: 'tile', url: 'https://service.pdok.nl/.../EPSG:3857/{z}/{x}/{y}.png',\n * options: { attribution: '© Kadaster', maxZoom: 19 } },\n * { type: 'wms', url: 'https://service.pdok.nl/lv/bag/wms/v2_0',\n * options: { layers: 'pand', transparent: true, opacity: 0.6 } },\n * ]\"\n * :markers=\"{\n * dataSource: { url: '/api/cases/geo' },\n * latField: 'lat',\n * lngField: 'lng',\n * popupField: 'title',\n * }\"\n * clustering\n * height=\"500px\"\n * @marker-click=\"onMarkerClick\" />\n * ```\n *\n * @event map-ready Fired once after Leaflet has loaded and the map is mounted. Payload: `{ map }` — the underlying Leaflet `L.Map` instance.\n * @event marker-click Fired when a marker is clicked. Payload: `{ feature, latlng, originalEvent }`.\n * @event bounds-change Fired after the map's visible bounds change (pan / zoom settle). Payload: `{ bounds, zoom }` where `bounds = { north, south, east, west }`.\n * @event click Fired when the user clicks the map background (no marker hit). Payload: `{ latlng, originalEvent }`.\n *\n * @slot legend Custom legend overlay positioned over the map. Scoped props: `{ layers, markers }`.\n * @slot popup Per-marker popup body override. Scoped props: `{ feature, properties }`. When omitted, the widget renders the value of `markers.popupField` (or no popup at all when unset).\n * @slot fallback Replaces the default \"map unavailable\" message when Leaflet fails to load (test environments, CSP-blocked builds, offline dev). No scoped props.\n */\nexport default {\n\tname: 'CnMapWidget',\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Initial map center as `[latitude, longitude]`. Optional: on a dashboard\n\t\t * the centre arrives via `content.center` (see the `cfg` computed), and when\n\t\t * neither source supplies a valid pair it defaults to `[52.13, 5.29]` (the\n\t\t * Netherlands).\n\t\t *\n\t\t * @type {[number, number]}\n\t\t */\n\t\tcenter: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [52.13, 5.29],\n\t\t\tvalidator: (v) => Array.isArray(v) && v.length === 2 && v.every((n) => typeof n === 'number' && Number.isFinite(n)),\n\t\t},\n\n\t\t/**\n\t\t * Initial zoom level.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tzoom: {\n\t\t\ttype: Number,\n\t\t\tdefault: 7,\n\t\t},\n\n\t\t/**\n\t\t * Layer definitions. Each entry: `{ type: 'tile'|'wms'|'wfs'|'geojson'|'image', url, options }`.\n\t\t * `geojson` MAY supply inline `data` (FeatureCollection) instead of `url`.\n\t\t * `image` is `{ type: 'image', url, width, height }`: the map becomes a picture in flat\n\t\t * pixel coordinates ((0, 0) top left); other layers beside it are skipped.\n\t\t * Unknown types log a console.warn and are skipped.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tlayers: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Marker config. `{ features?, dataSource?, latField?, lngField?, xField?, yField?,\n\t\t * popupField?, clustering?, iconColor?, iconUrl?, centerMarker? }`. On an image map\n\t\t * (a layer of type `image`) markers read `xField` / `yField` (default `x` / `y`,\n\t\t * pixels from the picture's top left) instead of `latField` / `lngField`. `features[]` is inline;\n\t\t * `dataSource.url` is HTTP-fetched on mount; `dataSource.{register, schema}`\n\t\t * plots the objects of an OpenRegister register/schema via their `@self.geo`.\n\t\t * `centerMarker: true` adds an extra pin at the map's `center`, alongside any\n\t\t * source markers.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tmarkers: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Enable marker clustering. When true, lazy-loads `leaflet.markercluster`\n\t\t * on first mount. `markers.clustering` overrides this prop when set.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tclustering: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Container height. Forwarded to the wrapper div's `style.height`.\n\t\t *\n\t\t * @type {string|number}\n\t\t */\n\t\theight: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '500px',\n\t\t},\n\n\t\t/**\n\t\t * Frame the map on every loaded feature. Applies on load and on each\n\t\t * marker update until the user pans or zooms themselves, after which\n\t\t * their view is kept and only the `Fit all markers` control re-frames.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tautoFit: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the \"fit all markers\" control — re-centres and re-zooms the map so\n\t\t * every marker is back in view (the position the map opens at).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tfitControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show Leaflet's zoom in and zoom out buttons. Off for a small preview\n\t\t * map that only shows where something is.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tzoomControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the fullscreen toggle. Expands the widget to fill the viewport via a\n\t\t * CSS overlay, so it needs no Fullscreen-API permission prompt.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tfullscreenControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the \"locate me\" control, which centres the map on the visitor's own\n\t\t * position via the browser geolocation API. Warns (does not throw) if denied.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tlocateControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Switchable base maps: `[{ name, url, attribution, options }]`. The first\n\t\t * entry is active on load and a layer switcher appears when more than one is\n\t\t * given. Supply these INSTEAD of a `tile` entry in `layers` for the background\n\t\t * map. Empty by default, so consumers that declare their background through\n\t\t * `layers` are unaffected.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tbasemaps: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Aria-label for the map application region.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tariaLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Map'),\n\t\t},\n\n\t\t/**\n\t\t * Label shown when Leaflet is not available.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tunavailableLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Map library not available'),\n\t\t},\n\n\t\t/**\n\t\t * Dashboard `content` blob. When this widget is placed on a dashboard, the\n\t\t * grid stores its config here and each key (`center`, `zoom`, `markers`,\n\t\t * `clustering`, `height`, `autoFit`, `layers`, `basemaps`) overrides the\n\t\t * matching flat prop. Direct (non-dashboard) consumers omit this and pass\n\t\t * the flat props instead. See the `cfg` computed for the merge rules.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Dashboard placement record. Declared so the grid's `:placement` binding is\n\t\t * consumed as a prop instead of leaking onto the root element; unused here.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The record of the page the map sits on: `@objectId` and\n\t\t * `@object.<field>` in `markers.dataSource.filter` resolve against it, so\n\t\t * a record's page can plot only the objects that point at it.\n\t\t *\n\t\t * @type {string|number}\n\t\t */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The loaded record, for `@object.<field>` filter tokens.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\t/**\n\t * Events:\n\t *\n\t * @event map-ready\n\t * @description Fired once after Leaflet has loaded and the map is mounted. Payload: `{ map }` — the underlying Leaflet `L.Map` instance. Consumers MAY use the instance to register custom controls or layers beyond the manifest shape.\n\t *\n\t * @event marker-click\n\t * @description Fired when a marker is clicked. Payload: `{ feature, latlng, originalEvent }`.\n\t *\n\t * @event bounds-change\n\t * @description Fired after the map's visible bounds change (pan / zoom settle). Payload: `{ bounds, zoom }` where `bounds = { north, south, east, west }`. Useful for triggering a re-fetch of viewport-scoped data.\n\t *\n\t * @event click\n\t * @description Fired when the user clicks the map background (no marker hit). Payload: `{ latlng, originalEvent }`.\n\t */\n\temits: ['map-ready', 'marker-click', 'bounds-change', 'click', 'header'],\n\n\tdata() {\n\t\treturn {\n\t\t\tL: null,\n\t\t\tmap: null,\n\t\t\tlayerInstances: [],\n\t\t\tmarkerLayer: null,\n\t\t\tclusterGroup: null,\n\t\t\tleafletAvailable: true,\n\t\t\tboundsTimer: null,\n\t\t\t// Rows of an image map with no usable x and y, counted in a note.\n\t\t\tunplottedCount: 0,\n\t\t\t// Whether the marker source has answered, and with how many markers.\n\t\t\tmarkersLoaded: false,\n\t\t\tmarkerCount: 0,\n\t\t\t// Whether the marker source could not be read (not: read and empty).\n\t\t\tmarkersFailed: false,\n\t\t\t// Set once the user has framed the view themselves; stops autoFit.\n\t\t\tuserFramedView: false,\n\t\t\t// A raw gesture has been seen; the next real view change is theirs.\n\t\t\tpendingViewGesture: false,\n\t\t\t// Controls / sizing\n\t\t\tisFullscreen: false,\n\t\t\tcontrolBar: null,\n\t\t\tlayersControl: null,\n\t\t\tfullscreenButton: null,\n\t\t\tresizeObserver: null,\n\t\t\tresizeTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the widget is drawn in the board look, which puts the zoom\n\t\t * buttons in the control bar and the bar in the top right.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * Effective configuration. On a dashboard the placement `content` blob\n\t\t * carries the widget's config, so each key falls back to `content.<key>`\n\t\t * when present and otherwise uses the matching flat prop. This lets\n\t\t * CnMapWidget work both directly (flat props) and as a dashboard renderer\n\t\t * (a grid that binds only `:content` never spreads the keys as props).\n\t\t *\n\t\t * @return {object} the resolved `{ center, zoom, layers, markers,\n\t\t * clustering, height, autoFit, basemaps }`.\n\t\t */\n\t\tcfg() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst p = this.$props\n\t\t\tconst validCentre = Array.isArray(c.center) && c.center.length === 2\n\t\t\t\t&& c.center.every((n) => Number.isFinite(n))\n\t\t\treturn {\n\t\t\t\tcenter: validCentre ? c.center : p.center,\n\t\t\t\tzoom: Number.isFinite(c.zoom) ? c.zoom : p.zoom,\n\t\t\t\tlayers: Array.isArray(c.layers) ? c.layers : p.layers,\n\t\t\t\tmarkers: (c.markers !== undefined && c.markers !== null) ? c.markers : p.markers,\n\t\t\t\tclustering: typeof c.clustering === 'boolean' ? c.clustering : p.clustering,\n\t\t\t\theight: (c.height !== undefined && c.height !== null && c.height !== '') ? c.height : p.height,\n\t\t\t\tautoFit: typeof c.autoFit === 'boolean' ? c.autoFit : p.autoFit,\n\t\t\t\tbasemaps: Array.isArray(c.basemaps) ? c.basemaps : p.basemaps,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The image layer, when the map is a picture: the first `image` layer with\n\t\t * a safe URL and a positive width and height. Null for a geographic map.\n\t\t *\n\t\t * @return {{url: string, width: number, height: number}|null}\n\t\t */\n\t\timageLayer() {\n\t\t\tconst def = (this.cfg.layers || []).find((l) => l && l.type === 'image')\n\t\t\tif (!def || safeHref(def.url) === '#' || !(def.width > 0) || !(def.height > 0)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { url: safeHref(def.url), width: Number(def.width), height: Number(def.height) }\n\t\t},\n\n\t\t/**\n\t\t * The map's accessible name: `content.ariaLabel` through the app's\n\t\t * translate, else the prop.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedAriaLabel() {\n\t\t\tconst own = this.content && typeof this.content.ariaLabel === 'string' ? this.content.ariaLabel : ''\n\t\t\treturn own !== '' ? this.cnTranslate(own) : this.ariaLabel\n\t\t},\n\n\t\t/**\n\t\t * The line under the map that says why it shows no markers: the source\n\t\t * failed (`content.errorText`, else a default) or answered nothing\n\t\t * (`content.emptyText`; without one an empty map says nothing). Only\n\t\t * for a map that reads its markers from a source.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\t/**\n\t\t * The line under the card title that says how many places the map\n\t\t * shows (`content.headerSubtitle`: `{ one, other }` or one string, with\n\t\t * `{total}`), once the marker source answered with markers (\"1 locatie\").\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/map-widget-header-count/specs/map-widget-header-count/spec.md#requirement-a-map-card-can-say-how-many-places-it-shows\n\t\t */\n\t\theaderSubtitleText() {\n\t\t\tconst spec = this.content?.headerSubtitle\n\t\t\tif (!spec || !this.markersLoaded || this.markersFailed || this.markerCount === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst text = typeof spec === 'string' ? spec : (this.markerCount === 1 ? spec.one : spec.other)\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.cnTranslate(text).replace(/\\{total\\}/g, String(this.markerCount))\n\t\t},\n\n\t\tmarkerStatusText() {\n\t\t\tconst markers = this.cfg.markers\n\t\t\tif (!markers || !markers.dataSource || !this.markersLoaded) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst own = (key) => (this.content && typeof this.content[key] === 'string' && this.content[key] !== '' ? this.cnTranslate(this.content[key]) : '')\n\t\t\tif (this.markersFailed) {\n\t\t\t\treturn own('errorText') || t('nextcloud-vue', 'The places could not be loaded.')\n\t\t\t}\n\t\t\treturn this.markerCount === 0 ? own('emptyText') : ''\n\t\t},\n\n\t\t/**\n\t\t * The token context a `markers.dataSource.filter` resolves against.\n\t\t *\n\t\t * @return {{objectId: string, object: object}}\n\t\t */\n\t\tfilterContext() {\n\t\t\treturn { objectId: this.objectId ? String(this.objectId) : '', object: this.objectData || {} }\n\t\t},\n\n\t\t/**\n\t\t * The data-source filter with its tokens resolved, serialised so a new\n\t\t * record re-reads the markers.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tfilterKey() {\n\t\t\tconst ds = this.cfg.markers && this.cfg.markers.dataSource\n\t\t\treturn ds && ds.filter ? JSON.stringify(this.sourceFilter(ds)) : ''\n\t\t},\n\n\t\tunplottedLabel() {\n\t\t\treturn t('nextcloud-vue', '{count} places have no position', { count: this.unplottedCount })\n\t\t},\n\n\t\tresolvedHeight() {\n\t\t\tif (typeof this.cfg.height === 'number') {\n\t\t\t\treturn `${this.cfg.height}px`\n\t\t\t}\n\t\t\treturn this.cfg.height\n\t\t},\n\n\t\tclusteringEnabled() {\n\t\t\tif (this.cfg.markers && typeof this.cfg.markers.clustering === 'boolean') {\n\t\t\t\treturn this.cfg.markers.clustering\n\t\t\t}\n\t\t\treturn this.cfg.clustering\n\t\t},\n\n\t\t/**\n\t\t * Comparable snapshot of the layer config.\n\t\t *\n\t\t * The render watchers read `cfg`, which reads every prop, and a `deep`\n\t\t * watcher fires whenever its effect re-runs rather than when its value\n\t\t * changes — so a new marker set rebuilt the base tile layer and the map\n\t\t * went white until the tiles came back. A key the watcher can actually\n\t\t * compare renders only on a real change.\n\t\t */\n\t\tlayersKey() {\n\t\t\treturn configKey(this.cfg.layers)\n\t\t},\n\n\t\tmarkersKey() {\n\t\t\treturn configKey(this.cfg.markers)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Report the count line to the card around the map.\n\t\t *\n\t\t * @param {string} subtitle The line, or ''.\n\t\t */\n\t\theaderSubtitleText(subtitle) {\n\t\t\tif (this.content?.headerSubtitle) {\n\t\t\t\t/**\n\t\t\t\t * @event header The card header's line under the title.\n\t\t\t\t * @type {{subtitle: string}}\n\t\t\t\t */\n\t\t\t\tthis.$emit('header', { subtitle })\n\t\t\t}\n\t\t},\n\n\t\t// Keyed, never `deep: true` — see `layersKey`.\n\t\tlayersKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderLayers()\n\t\t\t}\n\t\t},\n\n\t\tmarkersKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t// A filter on the record's id or fields: another record, other markers.\n\t\tfilterKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t// Re-plot when the centre moves, but only while the centre pin is on —\n\t\t// otherwise the centre is an initial-view concern, not a marker one.\n\t\t'cfg.center': {\n\t\t\thandler() {\n\t\t\t\tif (this.map && this.cfg.markers && this.cfg.markers.centerMarker) {\n\t\t\t\t\tthis.renderMarkers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tthis.refreshEvent = typeof this.content?.refreshOn === 'string' ? this.content.refreshOn : ''\n\t\tif (this.refreshEvent !== '') {\n\t\t\tsubscribe(this.refreshEvent, this.onRefreshEvent)\n\t\t}\n\t\ttry {\n\t\t\t// Leaflet is loaded as a runtime dep. Default-export the namespace.\n\t\t\tconst mod = await import('leaflet')\n\t\t\tthis.L = mod.default || mod\n\t\t} catch (err) {\n\t\t\t// Fallback when Leaflet can't load (test envs, CSP-blocked CDNs).\n\t\t\t// Surface the fallback slot rather than blanking the page.\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('[CnMapWidget] Leaflet unavailable', err)\n\t\t\tthis.leafletAvailable = false\n\t\t\treturn\n\t\t}\n\t\tthis.initMap()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.refreshEvent) {\n\t\t\tunsubscribe(this.refreshEvent, this.onRefreshEvent)\n\t\t}\n\t\tclearTimeout(this.boundsTimer)\n\t\tclearTimeout(this.resizeTimer)\n\t\tif (this.$refs.mapEl) {\n\t\t\tfor (const type of VIEW_GESTURE_EVENTS) {\n\t\t\t\tthis.$refs.mapEl.removeEventListener(type, this.onViewGesture, { capture: true })\n\t\t\t}\n\t\t}\n\t\tif (this.resizeObserver) {\n\t\t\tthis.resizeObserver.disconnect()\n\t\t\tthis.resizeObserver = null\n\t\t}\n\t\tif (this.map) {\n\t\t\tthis.map.remove()\n\t\t\tthis.map = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Mount the Leaflet map instance, attach event handlers, and\n\t\t * render the initial layer + marker set.\n\t\t */\n\t\tinitMap() {\n\t\t\tconst L = this.L\n\t\t\tconst image = this.imageLayer\n\t\t\t// A picture is not the earth: flat pixel coordinates, (0, 0) at the\n\t\t\t// top left, and a view that cannot be dragged far off the picture.\n\t\t\tconst mapOptions = image\n\t\t\t\t? {\n\t\t\t\t\t\tcrs: L.CRS && L.CRS.Simple,\n\t\t\t\t\t\tcenter: [-image.height / 2, image.width / 2],\n\t\t\t\t\t\tzoom: 0,\n\t\t\t\t\t\tminZoom: -5,\n\t\t\t\t\t\tmaxZoom: 2,\n\t\t\t\t\t\tzoomSnap: 0.25,\n\t\t\t\t\t\tmaxBounds: paddedImageBounds(image.width, image.height),\n\t\t\t\t\t\tmaxBoundsViscosity: 1,\n\t\t\t\t\t\tzoomControl: !this.isBoardLook,\n\t\t\t\t\t\tattributionControl: true,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tcenter: this.cfg.center,\n\t\t\t\t\t\tzoom: this.cfg.zoom,\n\t\t\t\t\t\tzoomControl: this.zoomControl && !this.isBoardLook,\n\t\t\t\t\t\tattributionControl: true,\n\t\t\t\t\t}\n\t\t\tthis.map = L.map(this.$refs.mapEl, mapOptions)\n\n\t\t\t// Capture, because Leaflet stops propagation on its own handles.\n\t\t\tif (this.$refs.mapEl) {\n\t\t\t\tfor (const type of VIEW_GESTURE_EVENTS) {\n\t\t\t\t\tthis.$refs.mapEl.addEventListener(type, this.onViewGesture, { capture: true, passive: true })\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.map.on('moveend', this.onViewSettled)\n\t\t\tthis.map.on('zoomend', this.onViewSettled)\n\n\t\t\tthis.map.on('click', (e) => {\n\t\t\t\t/**\n\t\t\t\t * Map background click event. Fired when the user clicks the map outside any marker.\n\t\t\t\t *\n\t\t\t\t * @event click\n\t\t\t\t * @type {{lat: number, lng: number}|{x: number, y: number}} `{ lat, lng }` on a geographic map, `{ x, y }` in the picture's whole pixels on an image map.\n\t\t\t\t */\n\t\t\t\tthis.$emit('click', this.imageLayer ? fromImagePoint(e.latlng, this.imageLayer) : { lat: e.latlng.lat, lng: e.latlng.lng })\n\t\t\t})\n\n\t\t\tthis.map.on('moveend', () => {\n\t\t\t\tclearTimeout(this.boundsTimer)\n\t\t\t\tthis.boundsTimer = setTimeout(() => {\n\t\t\t\t\tif (!this.map) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst b = this.map.getBounds()\n\t\t\t\t\t/**\n\t\t\t\t\t * Viewport bounds change event. Fired (debounced) after pan / zoom settles.\n\t\t\t\t\t *\n\t\t\t\t\t * @event bounds-change\n\t\t\t\t\t * @type {{north: number, south: number, east: number, west: number, zoom: number}}\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('bounds-change', {\n\t\t\t\t\t\tnorth: b.getNorth(),\n\t\t\t\t\t\tsouth: b.getSouth(),\n\t\t\t\t\t\teast: b.getEast(),\n\t\t\t\t\t\twest: b.getWest(),\n\t\t\t\t\t\tzoom: this.map.getZoom(),\n\t\t\t\t\t})\n\t\t\t\t}, 100)\n\t\t\t})\n\n\t\t\t// Geolocation is best-effort — a denied permission or an insecure origin\n\t\t\t// must not break the map, so just warn.\n\t\t\tthis.map.on('locationerror', (e) => {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Geolocation unavailable', e && e.message)\n\t\t\t})\n\n\t\t\tthis.renderLayers()\n\t\t\tthis.renderMarkers()\n\t\t\tthis.addControls()\n\n\t\t\t// The container may grow (fill-height layouts) or start hidden behind a\n\t\t\t// view toggle. Re-flow whenever its box actually changes — otherwise\n\t\t\t// Leaflet keeps the stale size it measured at mount and the tiles and\n\t\t\t// markers land in the wrong place.\n\t\t\tif (typeof ResizeObserver !== 'undefined' && this.$refs.mapEl) {\n\t\t\t\tthis.resizeObserver = new ResizeObserver(() => {\n\t\t\t\t\tclearTimeout(this.resizeTimer)\n\t\t\t\t\tthis.resizeTimer = setTimeout(() => {\n\t\t\t\t\t\tthis.refreshMapSize()\n\t\t\t\t\t}, 100)\n\t\t\t\t})\n\t\t\t\tthis.resizeObserver.observe(this.$refs.mapEl)\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Map ready event. Fired once after Leaflet has loaded and the map is mounted.\n\t\t\t *\n\t\t\t * @event map-ready\n\t\t\t * @type {{map: object}}\n\t\t\t */\n\t\t\tthis.$emit('map-ready', { map: this.map })\n\n\t\t\t// Re-flow size if the container was hidden when first mounted.\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.refreshMapSize()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Mount the configured `layers[]` onto the Leaflet map. Each entry\n\t\t * dispatches by `type` to a Leaflet factory; unknown types warn and\n\t\t * skip. `geojson` may supply inline `data` to skip the fetch.\n\t\t */\n\t\trenderLayers() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Tear down old layers\n\t\t\tfor (const layer of this.layerInstances) {\n\t\t\t\tthis.map.removeLayer(layer)\n\t\t\t}\n\t\t\tthis.layerInstances = []\n\t\t\tif (this.layersControl) {\n\t\t\t\tthis.map.removeControl(this.layersControl)\n\t\t\t\tthis.layersControl = null\n\t\t\t}\n\n\t\t\tconst image = this.imageLayer\n\t\t\tif (image) {\n\t\t\t\tthis.renderImageLayer(image)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.renderBasemaps()\n\n\t\t\tfor (const def of this.cfg.layers) {\n\t\t\t\tif (!def || typeof def !== 'object') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (def.type === 'image') {\n\t\t\t\t\t// Unusable image layer (no safe url, or no width/height).\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Image layer needs a url, width and height; skipping.')\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!ALLOWED_LAYER_TYPES.includes(def.type)) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(`[CnMapWidget] Unknown layer type \"${def.type}\", skipping.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tconst opts = { ...(def.options || {}) }\n\t\t\t\tif (def.attribution && !opts.attribution) {\n\t\t\t\t\topts.attribution = def.attribution\n\t\t\t\t}\n\n\t\t\t\tlet instance = null\n\t\t\t\tif (def.type === 'tile') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tinstance = L.tileLayer(def.url, withTileDefaults(opts))\n\t\t\t\t} else if (def.type === 'wms') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tinstance = L.tileLayer.wms(def.url, withTileDefaults(opts))\n\t\t\t\t} else if (def.type === 'wfs') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthis.fetchAndAddGeoJson(def.url, opts)\n\t\t\t\t\tcontinue\n\t\t\t\t} else if (def.type === 'geojson') {\n\t\t\t\t\tif (def.data && typeof def.data === 'object') {\n\t\t\t\t\t\tinstance = L.geoJSON(def.data, opts)\n\t\t\t\t\t} else if (typeof def.url === 'string' && def.url.length > 0) {\n\t\t\t\t\t\tthis.fetchAndAddGeoJson(def.url, opts)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (instance) {\n\t\t\t\t\tinstance.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(instance)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show the picture: an image overlay on the flat bounds, fitted on open.\n\t\t * Any other layer beside it is skipped with a warning (one picture per map).\n\t\t *\n\t\t * @param {{url: string, width: number, height: number}} image The image layer.\n\t\t */\n\t\trenderImageLayer(image) {\n\t\t\tconst L = this.L\n\t\t\tfor (const def of this.cfg.layers) {\n\t\t\t\tif (def && typeof def === 'object' && def.type !== 'image') {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(`[CnMapWidget] Layer type \"${def.type}\" is skipped on an image map.`)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst bounds = imageBounds(image.width, image.height)\n\t\t\tconst overlay = L.imageOverlay(image.url, bounds)\n\t\t\toverlay.addTo(this.map)\n\t\t\tthis.layerInstances.push(overlay)\n\t\t\tthis.map.fitBounds(bounds)\n\t\t\t// The whole picture is the furthest out; four times native size the furthest in.\n\t\t\tif (typeof this.map.getBoundsZoom === 'function') {\n\t\t\t\tconst fit = this.map.getBoundsZoom(bounds)\n\t\t\t\tif (Number.isFinite(fit)) {\n\t\t\t\t\tif (typeof this.map.setMinZoom === 'function') {\n\t\t\t\t\t\tthis.map.setMinZoom(fit)\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof this.map.setMaxZoom === 'function') {\n\t\t\t\t\t\tthis.map.setMaxZoom(Math.max(2, fit))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fetch a GeoJSON-shaped resource and add it to the map. Used by\n\t\t * the WFS branch and the geojson-from-url branch.\n\t\t *\n\t\t * @param {string} url Endpoint that returns GeoJSON.\n\t\t * @param {object} opts Leaflet `geoJSON` options.\n\t\t */\n\t\tfetchAndAddGeoJson(url, opts) {\n\t\t\tconst L = this.L\n\t\t\tfetch(prefixUrl(url))\n\t\t\t\t.then((r) => r.json())\n\t\t\t\t.then((json) => {\n\t\t\t\t\tif (!this.map) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst layer = L.geoJSON(json, opts)\n\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(layer)\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Failed to load layer', url, err)\n\t\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Mount the configured `markers` onto the Leaflet map. Reads from\n\t\t * `features[]` (inline) OR `dataSource.url` (HTTP fetch). When\n\t\t * `clusteringEnabled`, lazy-loads `leaflet.markercluster` and\n\t\t * groups markers under a single cluster layer.\n\t\t */\n\t\tasync renderMarkers() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L || !this.cfg.markers) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Tear down previous marker layer\n\t\t\tif (this.markerLayer) {\n\t\t\t\tthis.map.removeLayer(this.markerLayer)\n\t\t\t\tthis.markerLayer = null\n\t\t\t}\n\t\t\tif (this.clusterGroup) {\n\t\t\t\tthis.map.removeLayer(this.clusterGroup)\n\t\t\t\tthis.clusterGroup = null\n\t\t\t}\n\n\t\t\tif (!this.imageLayer) {\n\t\t\t\tthis.unplottedCount = 0\n\t\t\t}\n\t\t\tthis.markersFailed = false\n\t\t\tconst features = await this.collectFeatures()\n\t\t\tthis.markerCount = Array.isArray(features) ? features.length : 0\n\t\t\tthis.markersLoaded = true\n\t\t\tif (!features || features.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst layer = L.geoJSON({ type: 'FeatureCollection', features }, {\n\t\t\t\tpointToLayer: (feature, latlng) => {\n\t\t\t\t\tconst color = (feature.properties && feature.properties.markerColor)\n\t\t\t\t\t\t|| (this.cfg.markers && this.cfg.markers.iconColor)\n\t\t\t\t\t\t|| 'var(--color-primary-element, #2196F3)'\n\t\t\t\t\t// A numbered pin, the number the list beside the map shows for the\n\t\t\t\t\t// same row (an index map with `mapConfig.list`); the active row's\n\t\t\t\t\t// pin draws darker.\n\t\t\t\t\tconst number = feature.properties && Number(feature.properties.markerNumber)\n\t\t\t\t\tif (Number.isInteger(number) && number > 0) {\n\t\t\t\t\t\tconst active = feature.properties.markerActive === true\n\t\t\t\t\t\t// A colour of the row's own (`markerColor`) fills the pin, except\n\t\t\t\t\t\t// the active one, which keeps the active colour.\n\t\t\t\t\t\tconst fill = feature.properties.markerColor\n\t\t\t\t\t\tconst style = !active && typeof fill === 'string' && /^[#a-zA-Z0-9(),.%\\s_-]+$/.test(fill)\n\t\t\t\t\t\t\t? ` class=\"cn-map-widget__pin-fill\" style=\"background:${fill}\"`\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\treturn L.marker(latlng, {\n\t\t\t\t\t\t\ticon: L.divIcon({\n\t\t\t\t\t\t\t\tclassName: active ? 'cn-map-widget__pin cn-map-widget__pin--active' : 'cn-map-widget__pin',\n\t\t\t\t\t\t\t\thtml: `<span${style}>${number}</span>`,\n\t\t\t\t\t\t\t\ticonSize: [26, 26],\n\t\t\t\t\t\t\t\ticonAnchor: [13, 13],\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tif (this.cfg.markers && this.cfg.markers.iconUrl) {\n\t\t\t\t\t\treturn L.marker(latlng, {\n\t\t\t\t\t\t\ticon: L.icon({ iconUrl: this.cfg.markers.iconUrl, iconSize: [25, 41], iconAnchor: [12, 41] }),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn L.circleMarker(latlng, {\n\t\t\t\t\t\tradius: 8,\n\t\t\t\t\t\tfillColor: color,\n\t\t\t\t\t\tcolor: '#fff',\n\t\t\t\t\t\tweight: 2,\n\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\tfillOpacity: 0.85,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tonEachFeature: (feature, lyr) => {\n\t\t\t\t\tconst popupField = this.cfg.markers && this.cfg.markers.popupField\n\t\t\t\t\tconst popupHtml = popupField && feature.properties ? feature.properties[popupField] : null\n\t\t\t\t\tif (popupHtml) {\n\t\t\t\t\t\t// Security: marker data may come from an external URL\n\t\t\t\t\t\t// (markers.dataSource.url) or arbitrary GeoJSON feature\n\t\t\t\t\t\t// properties (often an OR-backed data source). Leaflet's\n\t\t\t\t\t\t// bindPopup renders its string argument as HTML (innerHTML),\n\t\t\t\t\t\t// so sanitize with the shared strict config (C1) before\n\t\t\t\t\t\t// injecting — a `<script>` / `onerror=` payload cannot\n\t\t\t\t\t\t// execute in the Nextcloud origin.\n\t\t\t\t\t\tconst safeHtml = DOMPurify.sanitize(String(popupHtml), SAFE_MARKDOWN_DOMPURIFY_CONFIG)\n\t\t\t\t\t\tlyr.bindPopup(safeHtml)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Hover tooltip: a marker with no label is a mystery dot. Name it\n\t\t\t\t\t// with the object's own display name — the backend already derives\n\t\t\t\t\t// one and publishes it as `@self.name`, so a Cow (`name`), a Barn\n\t\t\t\t\t// (`title`), and a Case (`reference`) all read correctly without the\n\t\t\t\t\t// widget knowing the schema. bindTooltip also renders HTML, so\n\t\t\t\t\t// sanitize the same way bindPopup does.\n\t\t\t\t\tconst label = objectDisplayName(feature.properties || {})\n\t\t\t\t\tif (label !== '') {\n\t\t\t\t\t\tconst safeLabel = DOMPurify.sanitize(label, SAFE_MARKDOWN_DOMPURIFY_CONFIG)\n\t\t\t\t\t\tlyr.bindTooltip(safeLabel, { direction: 'top' })\n\t\t\t\t\t}\n\t\t\t\t\tlyr.on('click', (e) => {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Marker click event. Fired when a marker is clicked.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @event marker-click\n\t\t\t\t\t\t * @type {{feature: object, latlng: object}}\n\t\t\t\t\t\t */\n\t\t\t\t\t\tthis.$emit('marker-click', { feature, latlng: e.latlng })\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tif (this.clusteringEnabled) {\n\t\t\t\ttry {\n\t\t\t\t\t// TWO THINGS HAVE TO BE TRUE BEFORE THIS PLUGIN CAN RUN, AND\n\t\t\t\t\t// NEITHER OF THEM WAS.\n\t\t\t\t\t//\n\t\t\t\t\t// 1. The import has to reach a file. This line used to carry a\n\t\t\t\t\t// `webpackIgnore: true` magic comment, on the stated\n\t\t\t\t\t// reasoning that it stopped a downstream bundler resolving\n\t\t\t\t\t// the specifier against\n\t\t\t\t\t// `node_modules/@conduction/nextcloud-vue/dist/` and failing\n\t\t\t\t\t// with \"Module not found\". That reasoning does not hold, and\n\t\t\t\t\t// the marker is what broke it. `webpackIgnore` does not mean\n\t\t\t\t\t// \"skip the resolution\"; it means \"leave this import for the\n\t\t\t\t\t// BROWSER\", and a browser on a Nextcloud page cannot resolve\n\t\t\t\t\t// a module specifier. Rollup had already rewritten the\n\t\t\t\t\t// specifier in the published ESM build to\n\t\t\t\t\t// `../../node_modules/leaflet.markercluster/dist/\n\t\t\t\t\t// leaflet.markercluster-src.js` and emitted that file inside\n\t\t\t\t\t// the package, so every consumer requested\n\t\t\t\t\t// `node_modules/leaflet.markercluster/...` off the page URL\n\t\t\t\t\t// and got a 404. Clustering has never run in any app.\n\t\t\t\t\t// Without the marker, webpack resolves the relative path\n\t\t\t\t\t// against the file the package actually ships and emits it\n\t\t\t\t\t// as a lazy chunk, so the import stays lazy and clustering\n\t\t\t\t\t// costs nothing to a consumer that does not ask for it.\n\t\t\t\t\t//\n\t\t\t\t\t// 2. The plugin has to find Leaflet. leaflet.markercluster is a\n\t\t\t\t\t// CLASSIC Leaflet plugin: it exports nothing and instead\n\t\t\t\t\t// writes `L.MarkerClusterGroup` onto the GLOBAL `L`. This\n\t\t\t\t\t// widget imports Leaflet as an ES module and keeps it on\n\t\t\t\t\t// `this.L`, so there was no global for the plugin to attach\n\t\t\t\t\t// to, and even a plugin that loaded would have left\n\t\t\t\t\t// `L.markerClusterGroup` undefined. Publishing our own\n\t\t\t\t\t// instance on `window.L` first is what makes the plugin\n\t\t\t\t\t// augment the same object this component then reads.\n\t\t\t\t\t//\n\t\t\t\t\t// An existing `window.L` is left alone: if the page already has\n\t\t\t\t\t// Leaflet, the plugin must extend THAT one, and overwriting it\n\t\t\t\t\t// would break whatever put it there.\n\t\t\t\t\tif (typeof window !== 'undefined' && !window.L) {\n\t\t\t\t\t\twindow.L = L\n\t\t\t\t\t}\n\t\t\t\t\tawait import('leaflet.markercluster')\n\t\t\t\t\tif (typeof L.markerClusterGroup === 'function') {\n\t\t\t\t\t\tthis.clusterGroup = L.markerClusterGroup()\n\t\t\t\t\t\tthis.clusterGroup.addLayer(layer)\n\t\t\t\t\t\tthis.clusterGroup.addTo(this.map)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\t\tthis.markerLayer = layer\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Cluster plugin unavailable', err)\n\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\tthis.markerLayer = layer\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlayer.addTo(this.map)\n\t\t\t\tthis.markerLayer = layer\n\t\t\t}\n\n\t\t\t// Not once per render: a consumer that reloads its markers (a filter,\n\t\t\t// a poll, a save) re-renders them, and fitting again threw away\n\t\t\t// whatever the user had panned or zoomed to. Their framing wins from\n\t\t\t// the moment they touch the map; the Fit all markers control brings\n\t\t\t// this one back on request.\n\t\t\tif (this.cfg.autoFit && !this.userFramedView && !this.imageLayer) {\n\t\t\t\t// Wait a tick so the container has its final box — fill-height layouts\n\t\t\t\t// and the hidden→visible view toggle both settle after render.\n\t\t\t\t// fitToMarkers() then measures before it fits.\n\t\t\t\tthis.$nextTick(() => this.fitToMarkers())\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mount the switchable base maps and, when more than one is configured, a\n\t\t * Leaflet layer switcher. Falls back to a single OpenStreetMap base map when\n\t\t * the consumer supplied neither `basemaps` nor a `tile` entry in `layers`, so\n\t\t * a map is never left with a blank background.\n\t\t */\n\t\trenderBasemaps() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L || typeof L.tileLayer !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst basemaps = (this.cfg.basemaps || []).filter((b) => b && typeof b.url === 'string' && b.url.length > 0)\n\t\t\tif (basemaps.length === 0) {\n\t\t\t\t// No explicit basemaps. Unless the consumer draws its own background\n\t\t\t\t// via a `tile`/`wms` entry in `layers`, add a single OpenStreetMap\n\t\t\t\t// base map so the map is never left blank (see DEFAULT_BASEMAP).\n\t\t\t\tconst hasTileLayer = (this.cfg.layers || []).some((l) => l\n\t\t\t\t\t&& (l.type === 'tile' || l.type === 'wms')\n\t\t\t\t\t&& typeof l.url === 'string' && l.url.length > 0)\n\t\t\t\tif (!hasTileLayer) {\n\t\t\t\t\tconst fallback = L.tileLayer(DEFAULT_BASEMAP.url, withTileDefaults({ ...DEFAULT_BASEMAP.options }))\n\t\t\t\t\tfallback.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(fallback)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst baseLayers = {}\n\t\t\tbasemaps.forEach((bm, index) => {\n\t\t\t\tconst opts = { ...(bm.options || {}) }\n\t\t\t\tif (bm.attribution && !opts.attribution) {\n\t\t\t\t\topts.attribution = bm.attribution\n\t\t\t\t}\n\t\t\t\tconst instance = L.tileLayer(bm.url, withTileDefaults(opts))\n\t\t\t\tbaseLayers[bm.name || `${index + 1}`] = instance\n\t\t\t\t// Only the first base map is live on load; the switcher swaps in the rest.\n\t\t\t\tif (index === 0) {\n\t\t\t\t\tinstance.addTo(this.map)\n\t\t\t\t}\n\t\t\t\tthis.layerInstances.push(instance)\n\t\t\t})\n\n\t\t\tif (Object.keys(baseLayers).length > 1 && L.control && typeof L.control.layers === 'function') {\n\t\t\t\t// The board look keeps the top right for its control column.\n\t\t\t\tthis.layersControl = L.control.layers(baseLayers, {}, { position: this.isBoardLook ? 'topleft' : 'topright' })\n\t\t\t\tthis.layersControl.addTo(this.map)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mount the custom control bar (fit-all / locate / fullscreen). Leaflet's own\n\t\t * zoom + attribution controls are enabled separately in `initMap`; in the\n\t\t * board look the zoom buttons lead this bar instead, in the top right.\n\t\t */\n\t\taddControls() {\n\t\t\tconst L = this.L\n\t\t\t// L.Control is absent from lightweight Leaflet stubs (tests); the map is\n\t\t\t// still perfectly usable without the extra bar, so degrade quietly.\n\t\t\tif (!this.map || !L || !L.Control || typeof L.Control.extend !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst buttons = []\n\t\t\tconst board = this.isBoardLook\n\t\t\tif (board && (this.imageLayer || this.zoomControl)) {\n\t\t\t\tbuttons.push({ key: 'zoom-in', title: t('nextcloud-vue', 'Zoom in'), icon: ICON_ZOOM_IN, onClick: () => this.map.zoomIn() })\n\t\t\t\tbuttons.push({ key: 'zoom-out', title: t('nextcloud-vue', 'Zoom out'), icon: ICON_ZOOM_OUT, onClick: () => this.map.zoomOut() })\n\t\t\t}\n\t\t\tif (this.fitControl) {\n\t\t\t\tbuttons.push({ key: 'fit', title: t('nextcloud-vue', 'Fit all markers'), icon: board ? ICON_CROSSHAIRS : ICON_FIT, onClick: () => this.fitToMarkers() })\n\t\t\t}\n\t\t\tif (this.locateControl) {\n\t\t\t\tbuttons.push({ key: 'locate', title: t('nextcloud-vue', 'Show my location'), icon: ICON_LOCATE, onClick: () => this.locateMe() })\n\t\t\t}\n\t\t\tif (this.fullscreenControl) {\n\t\t\t\tbuttons.push({ key: 'fullscreen', title: t('nextcloud-vue', 'Toggle fullscreen'), icon: ICON_FULLSCREEN, onClick: () => this.toggleFullscreen() })\n\t\t\t}\n\t\t\tif (buttons.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// `onAdd()` below is invoked by Leaflet with `this` bound to the\n\t\t\t// L.Control instance, so the component has to be captured here to\n\t\t\t// stash the fullscreen button ref on it.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\t\tconst self = this\n\t\t\tconst ControlBar = L.Control.extend({\n\t\t\t\tonAdd() {\n\t\t\t\t\tconst bar = L.DomUtil.create('div', 'leaflet-bar cn-map-widget__controls')\n\t\t\t\t\tfor (const button of buttons) {\n\t\t\t\t\t\tconst anchor = L.DomUtil.create('a', `cn-map-widget__control cn-map-widget__control--${button.key}`, bar)\n\t\t\t\t\t\tanchor.href = '#'\n\t\t\t\t\t\tanchor.title = button.title\n\t\t\t\t\t\tanchor.setAttribute('role', 'button')\n\t\t\t\t\t\tanchor.setAttribute('aria-label', button.title)\n\t\t\t\t\t\tanchor.innerHTML = controlIcon(button.icon)\n\t\t\t\t\t\tif (button.key === 'fullscreen') {\n\t\t\t\t\t\t\tself.fullscreenButton = anchor\n\t\t\t\t\t\t}\n\t\t\t\t\t\tL.DomEvent.on(anchor, 'click', L.DomEvent.stop).on(anchor, 'click', button.onClick)\n\t\t\t\t\t}\n\t\t\t\t\t// Keep clicks / wheel on the bar from panning or zooming the map.\n\t\t\t\t\tL.DomEvent.disableClickPropagation(bar)\n\t\t\t\t\tL.DomEvent.disableScrollPropagation(bar)\n\t\t\t\t\treturn bar\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tthis.controlBar = new ControlBar({ position: board ? 'topright' : 'topleft' })\n\t\t\tthis.controlBar.addTo(this.map)\n\t\t},\n\n\t\t/**\n\t\t * Arm the hand-over: the next view change the map reports is the user's.\n\t\t */\n\t\tonViewGesture() {\n\t\t\tthis.pendingViewGesture = true\n\t\t},\n\n\t\t/**\n\t\t * Commit an armed gesture once the view has actually moved — and only\n\t\t * then, so a gesture that framed nothing cannot disable `autoFit`.\n\t\t */\n\t\tonViewSettled() {\n\t\t\tif (this.pendingViewGesture) {\n\t\t\t\tthis.pendingViewGesture = false\n\t\t\t\tthis.userFramedView = true\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Re-measure the container. Also drops an armed gesture: a size change is\n\t\t * ours, so the `moveend` it may fire is not the user framing the view.\n\t\t */\n\t\trefreshMapSize() {\n\t\t\tif (!this.map || typeof this.map.invalidateSize !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.pendingViewGesture = false\n\t\t\tthis.map.invalidateSize()\n\t\t},\n\n\t\t/**\n\t\t * Re-centre and re-zoom so every marker is back in view — the same frame\n\t\t * `autoFit` lands on at load. Public: consumers MAY call it through `$refs`.\n\t\t */\n\t\tfitToMarkers() {\n\t\t\tif (!this.map) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.imageLayer) {\n\t\t\t\t// On a picture, \"fit\" is the whole picture.\n\t\t\t\tthis.refreshMapSize()\n\t\t\t\tthis.map.fitBounds(imageBounds(this.imageLayer.width, this.imageLayer.height))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = this.clusterGroup || this.markerLayer\n\t\t\tif (!target) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst bounds = target.getBounds()\n\t\t\t\tif (!bounds || !bounds.isValid()) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// Measure first — a stale container size yields a wrong fit.\n\t\t\t\tthis.refreshMapSize()\n\t\t\t\tthis.map.fitBounds(bounds, { padding: [50, 50] })\n\t\t\t} catch {\n\t\t\t\t// ignore — empty layer set means no bounds to fit\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Centre the map on the visitor's own position. Failures (denied permission,\n\t\t * insecure origin) surface via the `locationerror` handler in `initMap`.\n\t\t */\n\t\tlocateMe() {\n\t\t\tif (!this.map || typeof this.map.locate !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.map.locate({ setView: true, maxZoom: 16 })\n\t\t},\n\n\t\t/**\n\t\t * Toggle the CSS fullscreen overlay and re-flow Leaflet into the new box.\n\t\t */\n\t\ttoggleFullscreen() {\n\t\t\tthis.isFullscreen = !this.isFullscreen\n\t\t\tif (this.fullscreenButton) {\n\t\t\t\tthis.fullscreenButton.innerHTML = controlIcon(this.isFullscreen ? ICON_FULLSCREEN_EXIT : ICON_FULLSCREEN)\n\t\t\t}\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.refreshMapSize()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * A data source's `filter` with its `@objectId` / `@object.<field>`\n\t\t * tokens resolved against the page's record.\n\t\t *\n\t\t * @param {{filter?: object}} ds The data source.\n\t\t * @return {object} The query parameters.\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\tsourceFilter(ds) {\n\t\t\tif (!ds || !ds.filter || typeof ds.filter !== 'object') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn resolveFilterTokens(ds.filter, this.filterContext)\n\t\t},\n\n\t\t/**\n\t\t * The `content.refreshOn` event fired: read the markers again. With\n\t\t * `content.refreshMatch` only when the payload's field names this record.\n\t\t *\n\t\t * @param {object} payload The event payload.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\tonRefreshEvent(payload) {\n\t\t\tconst match = this.content && typeof this.content.refreshMatch === 'string' ? this.content.refreshMatch : ''\n\t\t\tif (match !== '' && String(payload?.[match] ?? '') !== String(this.objectId ?? '')) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Resolve the features set for the current `markers` config.\n\t\t *\n\t\t * Returns the inline `features[]` when set; otherwise fetches\n\t\t * `dataSource.url` and converts the response into GeoJSON\n\t\t * features. The response MAY be either a GeoJSON\n\t\t * FeatureCollection OR an array of flat rows (in which case\n\t\t * `latField`, `lngField`, `popupField` drive the conversion).\n\t\t *\n\t\t * `dataSource.{register, schema}` plots the objects of an OpenRegister\n\t\t * register/schema (see fetchRegisterFeatures).\n\t\t *\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync collectFeatures() {\n\t\t\tif (!this.cfg.markers) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.imageLayer) {\n\t\t\t\treturn this.imageFeatures(await this.collectSourceRows())\n\t\t\t}\n\t\t\tlet features = await this.collectSourceFeatures()\n\t\t\t// Optional pin at the configured centre, plotted alongside the object\n\t\t\t// markers (`markers.centerMarker`). Spread into a new array so an inline\n\t\t\t// `features[]` prop is never mutated.\n\t\t\tif (this.cfg.markers.centerMarker) {\n\t\t\t\tconst centre = this.centreMarkerFeature()\n\t\t\t\tif (centre) {\n\t\t\t\t\tfeatures = [...features, centre]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn features\n\t\t},\n\n\t\t/**\n\t\t * The rows behind an image map's markers: inline features' properties, a\n\t\t * fetched `dataSource.url` (rows, or a FeatureCollection's properties) or an\n\t\t * OpenRegister `dataSource.{register, schema}`.\n\t\t *\n\t\t * @return {Promise<Array<object>>} The rows.\n\t\t */\n\t\tasync collectSourceRows() {\n\t\t\tconst m = this.cfg.markers\n\t\t\tconst fromFeatures = (list) => (Array.isArray(list) ? list.map((f) => (f && f.properties ? f.properties : f)) : [])\n\t\t\tif (Array.isArray(m.features)) {\n\t\t\t\treturn fromFeatures(m.features)\n\t\t\t}\n\t\t\tconst ds = m.dataSource\n\t\t\tif (!ds) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (typeof ds.url === 'string' && ds.url.length > 0) {\n\t\t\t\t\tconst json = await (await fetch(prefixUrl(ds.url))).json()\n\t\t\t\t\treturn Array.isArray(json) ? json : fromFeatures(json && json.features)\n\t\t\t\t}\n\t\t\t\tif (ds.register && ds.schema) {\n\t\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([import('@nextcloud/axios'), import('@nextcloud/router')])\n\t\t\t\t\tconst url = generateUrl('/apps/openregister/api/objects/{register}/{schema}', { register: ds.register, schema: ds.schema })\n\t\t\t\t\tconst res = await axios.get(url, { params: { ...this.sourceFilter(ds), _limit: ds.limit || 500 } })\n\t\t\t\t\treturn (res && res.data && res.data.results) || []\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tthis.markersFailed = true\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Failed to load markers', ds, err)\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\n\t\t/**\n\t\t * Place rows on the picture by `xField` / `yField` (default `x` / `y`).\n\t\t * A row without both numbers is not plotted and is counted in the note.\n\t\t *\n\t\t * @param {Array<object>} rows The rows.\n\t\t * @return {Array<object>} GeoJSON Point features in the flat coordinates.\n\t\t */\n\t\timageFeatures(rows) {\n\t\t\tconst xField = (this.cfg.markers && this.cfg.markers.xField) || 'x'\n\t\t\tconst yField = (this.cfg.markers && this.cfg.markers.yField) || 'y'\n\t\t\tconst features = []\n\t\t\tlet skipped = 0\n\t\t\tfor (const row of rows) {\n\t\t\t\tif (!hasImagePosition(row, xField, yField)) {\n\t\t\t\t\tskipped += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst point = toImagePoint(row[xField], row[yField])\n\t\t\t\tfeatures.push({\n\t\t\t\t\ttype: 'Feature',\n\t\t\t\t\tgeometry: { type: 'Point', coordinates: [point.lng, point.lat] },\n\t\t\t\t\tproperties: { ...row },\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.unplottedCount = skipped\n\t\t\treturn features\n\t\t},\n\n\t\t/**\n\t\t * Resolve the marker features from the configured source only —\n\t\t * inline `features[]`, a fetched `dataSource.url`, or an OpenRegister\n\t\t * `dataSource.{register, schema}`. The optional centre pin is layered on\n\t\t * by collectFeatures().\n\t\t *\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync collectSourceFeatures() {\n\t\t\tif (Array.isArray(this.cfg.markers.features)) {\n\t\t\t\treturn this.cfg.markers.features\n\t\t\t}\n\t\t\tconst ds = this.cfg.markers.dataSource\n\t\t\tif (!ds) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (typeof ds.url === 'string' && ds.url.length > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await fetch(prefixUrl(ds.url))\n\t\t\t\t\tconst json = await response.json()\n\t\t\t\t\treturn this.normaliseFeatures(json)\n\t\t\t\t} catch (err) {\n\t\t\t\t\tthis.markersFailed = true\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Failed to fetch markers', ds.url, err)\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ds.register && ds.schema) {\n\t\t\t\treturn await this.fetchRegisterFeatures(ds)\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\n\t\t/**\n\t\t * Build a GeoJSON point Feature at the resolved centre, or null when the\n\t\t * centre is not a valid `[lat, lng]` pair. GeoJSON coordinates are\n\t\t * `[lng, lat]`, the reverse of the `center` prop's order.\n\t\t *\n\t\t * @return {object|null} the centre Feature, or null.\n\t\t */\n\t\tcentreMarkerFeature() {\n\t\t\tconst c = this.cfg.center\n\t\t\tif (!Array.isArray(c) || c.length !== 2 || !c.every((n) => Number.isFinite(n))) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: 'Feature',\n\t\t\t\tgeometry: { type: 'Point', coordinates: [c[1], c[0]] },\n\t\t\t\tproperties: {},\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Plot the objects of an OpenRegister register/schema.\n\t\t *\n\t\t * Each object's location comes from `@self.geo` (where CnObjectGeoWidget writes\n\t\t * it), falling back to plain `latField` / `lngField` properties so a schema that\n\t\t * models coordinates itself still plots. Objects with no usable location are\n\t\t * skipped rather than dropped at (0, 0) — an invisible wrong marker is worse\n\t\t * than an absent one.\n\t\t *\n\t\t * @param {{register: string, schema: string, limit?: number}} ds The data source.\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync fetchRegisterFeatures(ds) {\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t'/apps/openregister/api/objects/{register}/{schema}',\n\t\t\t\t\t{ register: ds.register, schema: ds.schema },\n\t\t\t\t)\n\t\t\t\tconst res = await axios.get(url, { params: { ...this.sourceFilter(ds), _limit: ds.limit || 500 } })\n\t\t\t\tconst rows = (res && res.data && res.data.results) || []\n\n\t\t\t\tconst latField = this.cfg.markers && this.cfg.markers.latField\n\t\t\t\tconst lngField = this.cfg.markers && this.cfg.markers.lngField\n\n\t\t\t\t// (0, 0) is where an unset pair of numbers lands, not a place.\n\t\t\t\treturn rows\n\t\t\t\t\t.map((row) => objectToGeoFeature(row, { latField, lngField }))\n\t\t\t\t\t.filter((feature) => feature && !(feature.geometry.coordinates[0] === 0 && feature.geometry.coordinates[1] === 0))\n\t\t\t} catch (err) {\n\t\t\t\tthis.markersFailed = true\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Failed to load objects for the map', ds, err)\n\t\t\t\treturn []\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Normalise a fetched payload into a GeoJSON Feature array.\n\t\t * Accepts FeatureCollection, raw Feature[], or flat rows that\n\t\t * declare `latField` / `lngField` (plus optional `popupField`\n\t\t * for popup HTML).\n\t\t *\n\t\t * @param {object|Array} json The fetched payload.\n\t\t * @return {Array<object>} GeoJSON Feature array.\n\t\t */\n\t\tnormaliseFeatures(json) {\n\t\t\tif (!json) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (Array.isArray(json.features)) {\n\t\t\t\treturn json.features\n\t\t\t}\n\t\t\tif (Array.isArray(json)) {\n\t\t\t\tconst latField = (this.cfg.markers && this.cfg.markers.latField) || 'lat'\n\t\t\t\tconst lngField = (this.cfg.markers && this.cfg.markers.lngField) || 'lng'\n\t\t\t\treturn json\n\t\t\t\t\t.filter((row) => row !== null && row !== undefined && Number.isFinite(row[latField]) && Number.isFinite(row[lngField]))\n\t\t\t\t\t.map((row) => ({\n\t\t\t\t\t\ttype: 'Feature',\n\t\t\t\t\t\tgeometry: { type: 'Point', coordinates: [row[lngField], row[latField]] },\n\t\t\t\t\t\tproperties: { ...row },\n\t\t\t\t\t}))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget {\n\tposition: relative;\n\twidth: 100%;\n\tmin-height: 200px;\n}\n\n.cn-map-widget__leaflet {\n\twidth: 100%;\n\theight: 100%;\n\t/* Leaflet paints its container #ddd, which reads as a white flash before the\n\t tiles arrive — and a bright one in a dark theme. */\n\tbackground: var(--color-background-dark);\n}\n\n.cn-map-widget__note {\n\tmargin: 4px 0 0;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Why the map shows no markers: the card's own text size, on its inset. */\n.cn-map-widget__note--status {\n\tfont-size: 14px;\n}\n\n.cn-map-widget__note--error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-map-widget__fallback {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\theight: 100%;\n\tmin-height: 150px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-map-widget__error {\n\tfont-size: 14px;\n\tmargin: 0;\n}\n\n.cn-map-widget__legend {\n\tposition: absolute;\n\ttop: 12px;\n\tright: 12px;\n\tz-index: 1000;\n\tbackground: var(--color-main-background);\n\tpadding: 8px 12px;\n\tborder-radius: var(--border-radius-large, 8px);\n\tbox-shadow: 0 2px 8px rgba(0, 0, 0, .15);\n}\n\n/* Fullscreen overlay. A CSS-fixed box rather than the Fullscreen API, so it needs\n no permission prompt; the z-index clears the Nextcloud header. */\n.cn-map-widget--fullscreen {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100vw;\n\theight: 100vh;\n\tz-index: 3000;\n}\n\n/* Custom control bar (fit / locate / fullscreen), themed to Nextcloud rather than\n Leaflet's default white-on-grey buttons.\n ::v-deep is required — Leaflet builds the control DOM via L.DomUtil.create, so\n those nodes never receive this SFC's scoped data-v attribute. */\n.cn-map-widget ::v-deep .cn-map-widget__control {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 30px;\n\theight: 30px;\n\tcolor: var(--color-main-text);\n\tbackground: var(--color-main-background);\n}\n\n.cn-map-widget ::v-deep .cn-map-widget__control:hover,\n.cn-map-widget ::v-deep .cn-map-widget__control:focus-visible {\n\tbackground: var(--color-background-hover);\n}\n</style>\n\n<style>\n/* A numbered pin (`properties.markerNumber`): a 26px primary circle with its\n number in white, the active one darker. Unscoped, because Leaflet creates\n the marker element outside the template. */\n.cn-map-widget__pin {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: 2px solid var(--color-main-background);\n\tborder-radius: 50%;\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tfont-size: 13px;\n\tfont-weight: 700;\n\tbox-sizing: border-box;\n}\n\n.cn-map-widget__pin-fill {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n\tborder-radius: 50%;\n}\n\n.cn-map-widget__pin--active {\n\tbackground: var(--color-primary-element-light-text);\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;;;;;;AA6GA,MAAM,mBAAoB,GAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAA;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAoB,GAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAA;;AAE1E;AACA;AACA;AACA;AACA,MAAM,oBAAmB,GAAI,kCAAgC;;AAE7D;AACC;AACA;;;;AAID,SAAS,gBAAgB,CAAC,IAAI,EAAE;AAC/B,CAAA,IAAI,IAAI,CAAC,cAAe,KAAI,SAAS,EAAE;AACtC,EAAA,IAAI,CAAC,cAAa,GAAI,qBAAmB;AAC1C,EAAA;AACA,CAAA,OAAO,IAAG;AACX,CAAA;;AAEA;;AAEC;;;;;AAKD,SAAS,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CAAC,GAAG,KAAK,GAAI,KAAI,IAAK,IAAG,QAAQ,SAAQ,IAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;MACrH,GAAG,CAAC,CAAC,GAAG,MAAM;AACd,MAAA,IAAI,EAAE,SAAS;AACf,MAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG;AACxE,MAAA,UAAU,EAAE,EAAE,GAAG,KAAK;AACvB,MAAC,CAAC,CAAA;AACJ,IAAA;AACA,GAAA,OAAO,EAAC;GACR;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnMapWidget.vue2.js","sources":["../../../../src/components/CnMapWidget/CnMapWidget.vue"],"sourcesContent":["<!--\n CnMapWidget — Renders a Leaflet map with declarative layers + markers.\n\n A library-first wrapper around Leaflet that consumes the manifest's\n page-shape directly: `{ center, zoom, layers, markers, clustering,\n height, autoFit }`. Layer dispatch picks `L.tileLayer |\n L.tileLayer.wms | L.geoJSON` per `layer.type`; unknown types log a\n console.warn and are skipped (matches CnChartWidget's\n unknown-`chartKind` posture).\n\n Marker support is opt-in:\n - `markers.features[]` — inline GeoJSON FeatureCollection.\n - `markers.dataSource.url` — fetched on mount; the response may\n be either a GeoJSON FeatureCollection OR a flat array of rows\n (in which case `latField`, `lngField`, `popupField` drive the\n conversion).\n - `markers.dataSource.{register, schema}` — plots the objects of an\n OpenRegister register/schema, reading each one's `@self.geo`\n (falling back to `latField` / `lngField` on the object itself).\n Objects with no usable location are skipped, not plotted at (0, 0).\n\n `leaflet.markercluster`'s JS lazy-loads only when `clustering: true`\n (or `markers.clustering: true`), so a consumer without clustering does\n not pay the cluster bundle cost. Its two stylesheets are imported\n eagerly with Leaflet's own, because a cluster with no CSS paints as a\n bare number in the corner of the map.\n\n This component is the page's primitive — `CnMapPage` wraps it for\n manifest-driven `type: \"map\"` routes. Apps that want to embed a map\n inside a custom dashboard slot can `<CnMapWidget v-bind=\"props\" />`\n directly.\n\n Spec: REQ-MMW-* (manifest-map-widget).\n-->\n<template>\n\t<div\n\t\tclass=\"cn-map-widget\"\n\t\t:class=\"{ 'cn-map-widget--fullscreen': isFullscreen }\"\n\t\t:style=\"{ height: isFullscreen ? null : resolvedHeight }\">\n\t\t<div\n\t\t\tv-if=\"leafletAvailable\"\n\t\t\tref=\"mapEl\"\n\t\t\tclass=\"cn-map-widget__leaflet\"\n\t\t\trole=\"application\"\n\t\t\t:aria-label=\"resolvedAriaLabel\"\n\t\t\ttabindex=\"0\" />\n\t\t<div v-else class=\"cn-map-widget__fallback\">\n\t\t\t<!--\n\t\t\t\t@slot fallback\n\t\t\t\t@description Shown when Leaflet is not available (e.g. test environments where\n\t\t\t\tthe global `L` cannot be loaded).\n\t\t\t-->\n\t\t\t<slot name=\"fallback\">\n\t\t\t\t<p class=\"cn-map-widget__error\">\n\t\t\t\t\t{{ unavailableLabel }}\n\t\t\t\t</p>\n\t\t\t</slot>\n\t\t</div>\n\t\t<p\n\t\t\tv-if=\"markerStatusText\"\n\t\t\tclass=\"cn-map-widget__note cn-map-widget__note--status\"\n\t\t\t:class=\"{ 'cn-map-widget__note--error': markersFailed }\"\n\t\t\t:role=\"markersFailed ? 'alert' : null\"\n\t\t\t:data-testid=\"markersFailed ? 'cn-map-markers-failed' : 'cn-map-markers-empty'\">\n\t\t\t{{ markerStatusText }}\n\t\t</p>\n\t\t<p v-if=\"unplottedCount > 0\" class=\"cn-map-widget__note\" data-testid=\"cn-map-unplotted\">\n\t\t\t{{ unplottedLabel }}\n\t\t</p>\n\t\t<div v-if=\"$slots.legend || $slots.legend\" class=\"cn-map-widget__legend\">\n\t\t\t<!--\n\t\t\t\t@slot legend\n\t\t\t\t@description Custom legend overlay. Receives `{ layers, markers }` as scoped props.\n\t\t\t\tPositioned absolute (top-right) by default; consumers MAY override with their own\n\t\t\t\tcontainer.\n\t\t\t-->\n\t\t\t<slot name=\"legend\" :layers=\"cfg.layers\" :markers=\"cfg.markers\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport DOMPurify from 'dompurify'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { objectToGeoFeature } from '../../utils/geo.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { objectDisplayName } from '../../utils/objectName.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { safeHref } from '../../utils/safeHref.js'\nimport { SAFE_MARKDOWN_DOMPURIFY_CONFIG } from '../../utils/safeMarkdownDompurifyConfig.js'\nimport { fromImagePoint, hasImagePosition, imageBounds, paddedImageBounds, toImagePoint } from './imageCoordinates.js'\n\n// Leaflet's own stylesheet positions the map panes, tiles the tile\n// images, and places the zoom/attribution controls. The JS is lazy-loaded\n// in mounted(), but the CSS must be present whenever this widget renders —\n// otherwise the map paints unstyled (no basemap, mispositioned controls).\n// Import it here so the widget is self-styling for every consumer rather\n// than relying on another component (e.g. a location picker) to pull it in.\nimport 'leaflet/dist/leaflet.css'\n// The cluster plugin's JS stays lazy, but its CSS cannot be: a cluster is a\n// `<div class=\"marker-cluster\">` with a count in it, and with no stylesheet it\n// paints as a bare number in the top-left corner of the map instead of a\n// bubble on the cluster's position. Two small files, ~2 KB together, and\n// `leaflet.markercluster` is a declared dependency either way.\nimport 'leaflet.markercluster/dist/MarkerCluster.css'\nimport 'leaflet.markercluster/dist/MarkerCluster.Default.css'\n\nconst ALLOWED_LAYER_TYPES = ['tile', 'wms', 'wfs', 'geojson', 'image']\n\n// Raw input on the map container, which is what tells a user's pan or zoom from\n// ours. Leaflet's own `movestart` / `zoomstart` fire for `fitBounds` too, so\n// they cannot separate the two; these events Leaflet never synthesises. A\n// gesture only ARMS the flag — `moveend` / `zoomend` commits it — because half\n// of these change nothing on their own: a page scroll over a map with\n// `scrollWheelZoom` off is a wheel event, and tabbing through is a keydown.\nconst VIEW_GESTURE_EVENTS = ['mousedown', 'touchstart', 'wheel', 'keydown']\n\n// Nextcloud sends `Referrer-Policy: no-referrer` on every page, and OpenStreetMap's\n// tile CDN answers a refererless request with a \"not following the tile usage policy\"\n// tile instead of the map. An `<img>`-level policy overrides the document's, and\n// `origin` sends only the scheme+host, never the path a case id could sit in.\nconst TILE_REFERRER_POLICY = 'strict-origin-when-cross-origin'\n\n/**\n * Apply the tile defaults a consumer did not set.\n *\n * @param {object} opts Leaflet layer options, already shallow-copied.\n * @return {object} The same object, with `referrerPolicy` defaulted.\n */\nfunction withTileDefaults(opts) {\n\tif (opts.referrerPolicy === undefined) {\n\t\topts.referrerPolicy = TILE_REFERRER_POLICY\n\t}\n\treturn opts\n}\n\n/**\n * A comparable snapshot of one config value, for the render watchers.\n *\n * @param {*} value The config value.\n * @return {string|object} A stable string; a fresh object when it will not\n * serialise, which always compares unequal and so keeps rendering.\n */\nfunction configKey(value) {\n\ttry {\n\t\treturn JSON.stringify(value ?? null)\n\t} catch {\n\t\treturn {}\n\t}\n}\n\n// Fallback background used when the consumer configures no `basemaps` and no\n// `tile`/`wms` entry in `layers` — otherwise the map paints white. Consuming\n// apps MUST allow this host in their Content-Security-Policy `img-src`\n// (Nextcloud blocks external images by default) or the tiles are CSP-blocked\n// and the map stays blank.\nconst DEFAULT_BASEMAP = {\n\turl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n\toptions: {\n\t\tattribution: '© OpenStreetMap contributors',\n\t\tmaxZoom: 19,\n\t},\n}\n\n// MDI paths for the custom control buttons, inlined so the widget carries no\n// icon-font dependency and renders identically inside a Leaflet control bar.\nconst ICON_FIT = 'M9.5,13.09L10.91,14.5L6.41,19H10V21H3V14H5V17.59L9.5,13.09M10.91,9.5L9.5,10.91L5,6.41V10H3V3H10V5H6.41L10.91,9.5M14.5,13.09L19,17.59V14H21V21H14V19H17.59L13.09,14.5L14.5,13.09M13.09,9.5L17.59,5H14V3H21V10H19V6.41L14.5,10.91L13.09,9.5Z'\nconst ICON_LOCATE = 'M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z'\nconst ICON_FULLSCREEN = 'M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z'\nconst ICON_FULLSCREEN_EXIT = 'M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z'\nconst ICON_ZOOM_IN = 'M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z'\nconst ICON_ZOOM_OUT = 'M19,13H5V11H19V13Z'\nconst ICON_CROSSHAIRS = 'M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z'\n\n/**\n * Wrap an MDI path in a 24x24 SVG sized for a Leaflet control button.\n *\n * @param {string} path The MDI `d` attribute.\n * @return {string} SVG markup.\n */\nfunction controlIcon(path) {\n\treturn `<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"${path}\" /></svg>`\n}\n\n/**\n * CnMapWidget — Leaflet wrapper for declarative manifest-driven maps.\n *\n * Manifest usage — when CnPageRenderer dispatches a `type: \"map\"` page\n * it mounts CnMapPage, which forwards `pages[].config.{center, zoom,\n * layers, markers, height, clustering}` to this component. Manifest\n * authors do NOT mount this component themselves — declare a\n * `type: \"map\"` page instead. See CnMapPage's leading docblock for\n * the manifest example.\n *\n * Direct (non-manifest) usage:\n *\n * ```vue\n * <CnMapWidget\n * :center=\"[52.13, 5.29]\"\n * :zoom=\"7\"\n * :layers=\"[\n * { type: 'tile', url: 'https://service.pdok.nl/.../EPSG:3857/{z}/{x}/{y}.png',\n * options: { attribution: '© Kadaster', maxZoom: 19 } },\n * { type: 'wms', url: 'https://service.pdok.nl/lv/bag/wms/v2_0',\n * options: { layers: 'pand', transparent: true, opacity: 0.6 } },\n * ]\"\n * :markers=\"{\n * dataSource: { url: '/api/cases/geo' },\n * latField: 'lat',\n * lngField: 'lng',\n * popupField: 'title',\n * }\"\n * clustering\n * height=\"500px\"\n * @marker-click=\"onMarkerClick\" />\n * ```\n *\n * @event map-ready Fired once after Leaflet has loaded and the map is mounted. Payload: `{ map }` — the underlying Leaflet `L.Map` instance.\n * @event marker-click Fired when a marker is clicked. Payload: `{ feature, latlng, originalEvent }`.\n * @event bounds-change Fired after the map's visible bounds change (pan / zoom settle). Payload: `{ bounds, zoom }` where `bounds = { north, south, east, west }`.\n * @event click Fired when the user clicks the map background (no marker hit). Payload: `{ latlng, originalEvent }`.\n *\n * @slot legend Custom legend overlay positioned over the map. Scoped props: `{ layers, markers }`.\n * @slot popup Per-marker popup body override. Scoped props: `{ feature, properties }`. When omitted, the widget renders the value of `markers.popupField` (or no popup at all when unset).\n * @slot fallback Replaces the default \"map unavailable\" message when Leaflet fails to load (test environments, CSP-blocked builds, offline dev). No scoped props.\n */\n/**\n * The count line a header spec gives (`{ one, other }` or one string, with\n * `{total}`), once the marker source answered with markers.\n *\n * @param {object|string|undefined} spec The declared line.\n * @param {object} vm The map: `markersLoaded`, `markersFailed`, `markerCount`, `cnTranslate`.\n * @return {string} The line, or ''.\n */\nfunction countLine(spec, vm) {\n\tif (!spec || !vm.markersLoaded || vm.markersFailed || vm.markerCount === 0) {\n\t\treturn ''\n\t}\n\tconst text = typeof spec === 'string' ? spec : (vm.markerCount === 1 ? spec.one : spec.other)\n\tif (typeof text !== 'string' || text === '') {\n\t\treturn ''\n\t}\n\treturn vm.cnTranslate(text).replace(/\\{total\\}/g, String(vm.markerCount))\n}\n\nexport default {\n\tname: 'CnMapWidget',\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Initial map center as `[latitude, longitude]`. Optional: on a dashboard\n\t\t * the centre arrives via `content.center` (see the `cfg` computed), and when\n\t\t * neither source supplies a valid pair it defaults to `[52.13, 5.29]` (the\n\t\t * Netherlands).\n\t\t *\n\t\t * @type {[number, number]}\n\t\t */\n\t\tcenter: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [52.13, 5.29],\n\t\t\tvalidator: (v) => Array.isArray(v) && v.length === 2 && v.every((n) => typeof n === 'number' && Number.isFinite(n)),\n\t\t},\n\n\t\t/**\n\t\t * Initial zoom level.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tzoom: {\n\t\t\ttype: Number,\n\t\t\tdefault: 7,\n\t\t},\n\n\t\t/**\n\t\t * Layer definitions. Each entry: `{ type: 'tile'|'wms'|'wfs'|'geojson'|'image', url, options }`.\n\t\t * `geojson` MAY supply inline `data` (FeatureCollection) instead of `url`.\n\t\t * `image` is `{ type: 'image', url, width, height }`: the map becomes a picture in flat\n\t\t * pixel coordinates ((0, 0) top left); other layers beside it are skipped.\n\t\t * Unknown types log a console.warn and are skipped.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tlayers: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Marker config. `{ features?, dataSource?, latField?, lngField?, xField?, yField?,\n\t\t * popupField?, clustering?, iconColor?, iconUrl?, centerMarker? }`. On an image map\n\t\t * (a layer of type `image`) markers read `xField` / `yField` (default `x` / `y`,\n\t\t * pixels from the picture's top left) instead of `latField` / `lngField`. `features[]` is inline;\n\t\t * `dataSource.url` is HTTP-fetched on mount; `dataSource.{register, schema}`\n\t\t * plots the objects of an OpenRegister register/schema via their `@self.geo`.\n\t\t * `centerMarker: true` adds an extra pin at the map's `center`, alongside any\n\t\t * source markers.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tmarkers: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Enable marker clustering. When true, lazy-loads `leaflet.markercluster`\n\t\t * on first mount. `markers.clustering` overrides this prop when set.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tclustering: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Container height. Forwarded to the wrapper div's `style.height`.\n\t\t *\n\t\t * @type {string|number}\n\t\t */\n\t\theight: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '500px',\n\t\t},\n\n\t\t/**\n\t\t * Frame the map on every loaded feature. Applies on load and on each\n\t\t * marker update until the user pans or zooms themselves, after which\n\t\t * their view is kept and only the `Fit all markers` control re-frames.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tautoFit: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the \"fit all markers\" control — re-centres and re-zooms the map so\n\t\t * every marker is back in view (the position the map opens at).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tfitControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show Leaflet's zoom in and zoom out buttons. Off for a small preview\n\t\t * map that only shows where something is.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tzoomControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the fullscreen toggle. Expands the widget to fill the viewport via a\n\t\t * CSS overlay, so it needs no Fullscreen-API permission prompt.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tfullscreenControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Show the \"locate me\" control, which centres the map on the visitor's own\n\t\t * position via the browser geolocation API. Warns (does not throw) if denied.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tlocateControl: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Switchable base maps: `[{ name, url, attribution, options }]`. The first\n\t\t * entry is active on load and a layer switcher appears when more than one is\n\t\t * given. Supply these INSTEAD of a `tile` entry in `layers` for the background\n\t\t * map. Empty by default, so consumers that declare their background through\n\t\t * `layers` are unaffected.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tbasemaps: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Aria-label for the map application region.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tariaLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Map'),\n\t\t},\n\n\t\t/**\n\t\t * Label shown when Leaflet is not available.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tunavailableLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Map library not available'),\n\t\t},\n\n\t\t/**\n\t\t * Dashboard `content` blob. When this widget is placed on a dashboard, the\n\t\t * grid stores its config here and each key (`center`, `zoom`, `markers`,\n\t\t * `clustering`, `height`, `autoFit`, `layers`, `basemaps`) overrides the\n\t\t * matching flat prop. Direct (non-dashboard) consumers omit this and pass\n\t\t * the flat props instead. See the `cfg` computed for the merge rules.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Dashboard placement record. Declared so the grid's `:placement` binding is\n\t\t * consumed as a prop instead of leaking onto the root element; unused here.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The record of the page the map sits on: `@objectId` and\n\t\t * `@object.<field>` in `markers.dataSource.filter` resolve against it, so\n\t\t * a record's page can plot only the objects that point at it.\n\t\t *\n\t\t * @type {string|number}\n\t\t */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The loaded record, for `@object.<field>` filter tokens.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\t/**\n\t * Events:\n\t *\n\t * @event map-ready\n\t * @description Fired once after Leaflet has loaded and the map is mounted. Payload: `{ map }` — the underlying Leaflet `L.Map` instance. Consumers MAY use the instance to register custom controls or layers beyond the manifest shape.\n\t *\n\t * @event marker-click\n\t * @description Fired when a marker is clicked. Payload: `{ feature, latlng, originalEvent }`.\n\t *\n\t * @event bounds-change\n\t * @description Fired after the map's visible bounds change (pan / zoom settle). Payload: `{ bounds, zoom }` where `bounds = { north, south, east, west }`. Useful for triggering a re-fetch of viewport-scoped data.\n\t *\n\t * @event click\n\t * @description Fired when the user clicks the map background (no marker hit). Payload: `{ latlng, originalEvent }`.\n\t */\n\temits: ['map-ready', 'marker-click', 'bounds-change', 'click', 'header'],\n\n\tdata() {\n\t\treturn {\n\t\t\tL: null,\n\t\t\tmap: null,\n\t\t\tlayerInstances: [],\n\t\t\tmarkerLayer: null,\n\t\t\tclusterGroup: null,\n\t\t\tleafletAvailable: true,\n\t\t\tboundsTimer: null,\n\t\t\t// Rows of an image map with no usable x and y, counted in a note.\n\t\t\tunplottedCount: 0,\n\t\t\t// Whether the marker source has answered, and with how many markers.\n\t\t\tmarkersLoaded: false,\n\t\t\tmarkerCount: 0,\n\t\t\t// Whether the marker source could not be read (not: read and empty).\n\t\t\tmarkersFailed: false,\n\t\t\t// Set once the user has framed the view themselves; stops autoFit.\n\t\t\tuserFramedView: false,\n\t\t\t// A raw gesture has been seen; the next real view change is theirs.\n\t\t\tpendingViewGesture: false,\n\t\t\t// Controls / sizing\n\t\t\tisFullscreen: false,\n\t\t\tcontrolBar: null,\n\t\t\tlayersControl: null,\n\t\t\tfullscreenButton: null,\n\t\t\tresizeObserver: null,\n\t\t\tresizeTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the widget is drawn in the board look, which puts the zoom\n\t\t * buttons in the control bar and the bar in the top right.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * Effective configuration. On a dashboard the placement `content` blob\n\t\t * carries the widget's config, so each key falls back to `content.<key>`\n\t\t * when present and otherwise uses the matching flat prop. This lets\n\t\t * CnMapWidget work both directly (flat props) and as a dashboard renderer\n\t\t * (a grid that binds only `:content` never spreads the keys as props).\n\t\t *\n\t\t * @return {object} the resolved `{ center, zoom, layers, markers,\n\t\t * clustering, height, autoFit, basemaps }`.\n\t\t */\n\t\tcfg() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst p = this.$props\n\t\t\tconst validCentre = Array.isArray(c.center) && c.center.length === 2\n\t\t\t\t&& c.center.every((n) => Number.isFinite(n))\n\t\t\treturn {\n\t\t\t\tcenter: validCentre ? c.center : p.center,\n\t\t\t\tzoom: Number.isFinite(c.zoom) ? c.zoom : p.zoom,\n\t\t\t\tlayers: Array.isArray(c.layers) ? c.layers : p.layers,\n\t\t\t\tmarkers: (c.markers !== undefined && c.markers !== null) ? c.markers : p.markers,\n\t\t\t\tclustering: typeof c.clustering === 'boolean' ? c.clustering : p.clustering,\n\t\t\t\theight: (c.height !== undefined && c.height !== null && c.height !== '') ? c.height : p.height,\n\t\t\t\tautoFit: typeof c.autoFit === 'boolean' ? c.autoFit : p.autoFit,\n\t\t\t\tbasemaps: Array.isArray(c.basemaps) ? c.basemaps : p.basemaps,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The image layer, when the map is a picture: the first `image` layer with\n\t\t * a safe URL and a positive width and height. Null for a geographic map.\n\t\t *\n\t\t * @return {{url: string, width: number, height: number}|null}\n\t\t */\n\t\timageLayer() {\n\t\t\tconst def = (this.cfg.layers || []).find((l) => l && l.type === 'image')\n\t\t\tif (!def || safeHref(def.url) === '#' || !(def.width > 0) || !(def.height > 0)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { url: safeHref(def.url), width: Number(def.width), height: Number(def.height) }\n\t\t},\n\n\t\t/**\n\t\t * The map's accessible name: `content.ariaLabel` through the app's\n\t\t * translate, else the prop.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedAriaLabel() {\n\t\t\tconst own = this.content && typeof this.content.ariaLabel === 'string' ? this.content.ariaLabel : ''\n\t\t\treturn own !== '' ? this.cnTranslate(own) : this.ariaLabel\n\t\t},\n\n\t\t/**\n\t\t * The line under the map that says why it shows no markers: the source\n\t\t * failed (`content.errorText`, else a default) or answered nothing\n\t\t * (`content.emptyText`; without one an empty map says nothing). Only\n\t\t * for a map that reads its markers from a source.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\t/**\n\t\t * The line under the card title that says how many places the map\n\t\t * shows (`content.headerSubtitle`: `{ one, other }` or one string, with\n\t\t * `{total}`), once the marker source answered with markers (\"1 locatie\").\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/map-widget-header-count/specs/map-widget-header-count/spec.md#requirement-a-map-card-can-say-how-many-places-it-shows\n\t\t */\n\t\theaderSubtitleText() {\n\t\t\treturn countLine(this.content?.headerSubtitle, this)\n\t\t},\n\n\t\t/**\n\t\t * The same count as a note at the right of the card's title row\n\t\t * (`content.headerNote`, the same shape as `headerSubtitle`), as the\n\t\t * case boards draw \"Locaties ... 1 locatie\".\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/map-count-note/specs/map-widget/spec.md\n\t\t */\n\t\theaderNoteText() {\n\t\t\treturn countLine(this.content?.headerNote, this)\n\t\t},\n\n\t\tmarkerStatusText() {\n\t\t\tconst markers = this.cfg.markers\n\t\t\tif (!markers || !markers.dataSource || !this.markersLoaded) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst own = (key) => (this.content && typeof this.content[key] === 'string' && this.content[key] !== '' ? this.cnTranslate(this.content[key]) : '')\n\t\t\tif (this.markersFailed) {\n\t\t\t\treturn own('errorText') || t('nextcloud-vue', 'The places could not be loaded.')\n\t\t\t}\n\t\t\treturn this.markerCount === 0 ? own('emptyText') : ''\n\t\t},\n\n\t\t/**\n\t\t * The token context a `markers.dataSource.filter` resolves against.\n\t\t *\n\t\t * @return {{objectId: string, object: object}}\n\t\t */\n\t\tfilterContext() {\n\t\t\treturn { objectId: this.objectId ? String(this.objectId) : '', object: this.objectData || {} }\n\t\t},\n\n\t\t/**\n\t\t * The data-source filter with its tokens resolved, serialised so a new\n\t\t * record re-reads the markers.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tfilterKey() {\n\t\t\tconst ds = this.cfg.markers && this.cfg.markers.dataSource\n\t\t\treturn ds && ds.filter ? JSON.stringify(this.sourceFilter(ds)) : ''\n\t\t},\n\n\t\tunplottedLabel() {\n\t\t\treturn t('nextcloud-vue', '{count} places have no position', { count: this.unplottedCount })\n\t\t},\n\n\t\tresolvedHeight() {\n\t\t\tif (typeof this.cfg.height === 'number') {\n\t\t\t\treturn `${this.cfg.height}px`\n\t\t\t}\n\t\t\treturn this.cfg.height\n\t\t},\n\n\t\tclusteringEnabled() {\n\t\t\tif (this.cfg.markers && typeof this.cfg.markers.clustering === 'boolean') {\n\t\t\t\treturn this.cfg.markers.clustering\n\t\t\t}\n\t\t\treturn this.cfg.clustering\n\t\t},\n\n\t\t/**\n\t\t * Comparable snapshot of the layer config.\n\t\t *\n\t\t * The render watchers read `cfg`, which reads every prop, and a `deep`\n\t\t * watcher fires whenever its effect re-runs rather than when its value\n\t\t * changes — so a new marker set rebuilt the base tile layer and the map\n\t\t * went white until the tiles came back. A key the watcher can actually\n\t\t * compare renders only on a real change.\n\t\t */\n\t\tlayersKey() {\n\t\t\treturn configKey(this.cfg.layers)\n\t\t},\n\n\t\tmarkersKey() {\n\t\t\treturn configKey(this.cfg.markers)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Report the count line to the card around the map.\n\t\t *\n\t\t * @param {string} subtitle The line, or ''.\n\t\t */\n\t\theaderSubtitleText(subtitle) {\n\t\t\tif (this.content?.headerSubtitle) {\n\t\t\t\t/**\n\t\t\t\t * @event header The card header's line under the title.\n\t\t\t\t * @type {{subtitle: string}}\n\t\t\t\t */\n\t\t\t\tthis.$emit('header', { subtitle })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Report the count note to the card around the map.\n\t\t *\n\t\t * @param {string} note The note, or ''.\n\t\t */\n\t\theaderNoteText(note) {\n\t\t\tif (this.content?.headerNote) {\n\t\t\t\t/**\n\t\t\t\t * @event header The card header's note at the right of the title.\n\t\t\t\t * @type {{note: string}}\n\t\t\t\t */\n\t\t\t\tthis.$emit('header', { note })\n\t\t\t}\n\t\t},\n\n\t\t// Keyed, never `deep: true` — see `layersKey`.\n\t\tlayersKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderLayers()\n\t\t\t}\n\t\t},\n\n\t\tmarkersKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t// A filter on the record's id or fields: another record, other markers.\n\t\tfilterKey() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t// Re-plot when the centre moves, but only while the centre pin is on —\n\t\t// otherwise the centre is an initial-view concern, not a marker one.\n\t\t'cfg.center': {\n\t\t\thandler() {\n\t\t\t\tif (this.map && this.cfg.markers && this.cfg.markers.centerMarker) {\n\t\t\t\t\tthis.renderMarkers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tthis.refreshEvent = typeof this.content?.refreshOn === 'string' ? this.content.refreshOn : ''\n\t\tif (this.refreshEvent !== '') {\n\t\t\tsubscribe(this.refreshEvent, this.onRefreshEvent)\n\t\t}\n\t\ttry {\n\t\t\t// Leaflet is loaded as a runtime dep. Default-export the namespace.\n\t\t\tconst mod = await import('leaflet')\n\t\t\tthis.L = mod.default || mod\n\t\t} catch (err) {\n\t\t\t// Fallback when Leaflet can't load (test envs, CSP-blocked CDNs).\n\t\t\t// Surface the fallback slot rather than blanking the page.\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('[CnMapWidget] Leaflet unavailable', err)\n\t\t\tthis.leafletAvailable = false\n\t\t\treturn\n\t\t}\n\t\tthis.initMap()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.refreshEvent) {\n\t\t\tunsubscribe(this.refreshEvent, this.onRefreshEvent)\n\t\t}\n\t\tclearTimeout(this.boundsTimer)\n\t\tclearTimeout(this.resizeTimer)\n\t\tif (this.$refs.mapEl) {\n\t\t\tfor (const type of VIEW_GESTURE_EVENTS) {\n\t\t\t\tthis.$refs.mapEl.removeEventListener(type, this.onViewGesture, { capture: true })\n\t\t\t}\n\t\t}\n\t\tif (this.resizeObserver) {\n\t\t\tthis.resizeObserver.disconnect()\n\t\t\tthis.resizeObserver = null\n\t\t}\n\t\tif (this.map) {\n\t\t\tthis.map.remove()\n\t\t\tthis.map = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Mount the Leaflet map instance, attach event handlers, and\n\t\t * render the initial layer + marker set.\n\t\t */\n\t\tinitMap() {\n\t\t\tconst L = this.L\n\t\t\tconst image = this.imageLayer\n\t\t\t// A picture is not the earth: flat pixel coordinates, (0, 0) at the\n\t\t\t// top left, and a view that cannot be dragged far off the picture.\n\t\t\tconst mapOptions = image\n\t\t\t\t? {\n\t\t\t\t\t\tcrs: L.CRS && L.CRS.Simple,\n\t\t\t\t\t\tcenter: [-image.height / 2, image.width / 2],\n\t\t\t\t\t\tzoom: 0,\n\t\t\t\t\t\tminZoom: -5,\n\t\t\t\t\t\tmaxZoom: 2,\n\t\t\t\t\t\tzoomSnap: 0.25,\n\t\t\t\t\t\tmaxBounds: paddedImageBounds(image.width, image.height),\n\t\t\t\t\t\tmaxBoundsViscosity: 1,\n\t\t\t\t\t\tzoomControl: !this.isBoardLook,\n\t\t\t\t\t\tattributionControl: true,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tcenter: this.cfg.center,\n\t\t\t\t\t\tzoom: this.cfg.zoom,\n\t\t\t\t\t\tzoomControl: this.zoomControl && !this.isBoardLook,\n\t\t\t\t\t\tattributionControl: true,\n\t\t\t\t\t}\n\t\t\tthis.map = L.map(this.$refs.mapEl, mapOptions)\n\n\t\t\t// Capture, because Leaflet stops propagation on its own handles.\n\t\t\tif (this.$refs.mapEl) {\n\t\t\t\tfor (const type of VIEW_GESTURE_EVENTS) {\n\t\t\t\t\tthis.$refs.mapEl.addEventListener(type, this.onViewGesture, { capture: true, passive: true })\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.map.on('moveend', this.onViewSettled)\n\t\t\tthis.map.on('zoomend', this.onViewSettled)\n\n\t\t\tthis.map.on('click', (e) => {\n\t\t\t\t/**\n\t\t\t\t * Map background click event. Fired when the user clicks the map outside any marker.\n\t\t\t\t *\n\t\t\t\t * @event click\n\t\t\t\t * @type {{lat: number, lng: number}|{x: number, y: number}} `{ lat, lng }` on a geographic map, `{ x, y }` in the picture's whole pixels on an image map.\n\t\t\t\t */\n\t\t\t\tthis.$emit('click', this.imageLayer ? fromImagePoint(e.latlng, this.imageLayer) : { lat: e.latlng.lat, lng: e.latlng.lng })\n\t\t\t})\n\n\t\t\tthis.map.on('moveend', () => {\n\t\t\t\tclearTimeout(this.boundsTimer)\n\t\t\t\tthis.boundsTimer = setTimeout(() => {\n\t\t\t\t\tif (!this.map) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst b = this.map.getBounds()\n\t\t\t\t\t/**\n\t\t\t\t\t * Viewport bounds change event. Fired (debounced) after pan / zoom settles.\n\t\t\t\t\t *\n\t\t\t\t\t * @event bounds-change\n\t\t\t\t\t * @type {{north: number, south: number, east: number, west: number, zoom: number}}\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('bounds-change', {\n\t\t\t\t\t\tnorth: b.getNorth(),\n\t\t\t\t\t\tsouth: b.getSouth(),\n\t\t\t\t\t\teast: b.getEast(),\n\t\t\t\t\t\twest: b.getWest(),\n\t\t\t\t\t\tzoom: this.map.getZoom(),\n\t\t\t\t\t})\n\t\t\t\t}, 100)\n\t\t\t})\n\n\t\t\t// Geolocation is best-effort — a denied permission or an insecure origin\n\t\t\t// must not break the map, so just warn.\n\t\t\tthis.map.on('locationerror', (e) => {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Geolocation unavailable', e && e.message)\n\t\t\t})\n\n\t\t\tthis.renderLayers()\n\t\t\tthis.renderMarkers()\n\t\t\tthis.addControls()\n\n\t\t\t// The container may grow (fill-height layouts) or start hidden behind a\n\t\t\t// view toggle. Re-flow whenever its box actually changes — otherwise\n\t\t\t// Leaflet keeps the stale size it measured at mount and the tiles and\n\t\t\t// markers land in the wrong place.\n\t\t\tif (typeof ResizeObserver !== 'undefined' && this.$refs.mapEl) {\n\t\t\t\tthis.resizeObserver = new ResizeObserver(() => {\n\t\t\t\t\tclearTimeout(this.resizeTimer)\n\t\t\t\t\tthis.resizeTimer = setTimeout(() => {\n\t\t\t\t\t\tthis.refreshMapSize()\n\t\t\t\t\t}, 100)\n\t\t\t\t})\n\t\t\t\tthis.resizeObserver.observe(this.$refs.mapEl)\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Map ready event. Fired once after Leaflet has loaded and the map is mounted.\n\t\t\t *\n\t\t\t * @event map-ready\n\t\t\t * @type {{map: object}}\n\t\t\t */\n\t\t\tthis.$emit('map-ready', { map: this.map })\n\n\t\t\t// Re-flow size if the container was hidden when first mounted.\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.refreshMapSize()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Mount the configured `layers[]` onto the Leaflet map. Each entry\n\t\t * dispatches by `type` to a Leaflet factory; unknown types warn and\n\t\t * skip. `geojson` may supply inline `data` to skip the fetch.\n\t\t */\n\t\trenderLayers() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Tear down old layers\n\t\t\tfor (const layer of this.layerInstances) {\n\t\t\t\tthis.map.removeLayer(layer)\n\t\t\t}\n\t\t\tthis.layerInstances = []\n\t\t\tif (this.layersControl) {\n\t\t\t\tthis.map.removeControl(this.layersControl)\n\t\t\t\tthis.layersControl = null\n\t\t\t}\n\n\t\t\tconst image = this.imageLayer\n\t\t\tif (image) {\n\t\t\t\tthis.renderImageLayer(image)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.renderBasemaps()\n\n\t\t\tfor (const def of this.cfg.layers) {\n\t\t\t\tif (!def || typeof def !== 'object') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (def.type === 'image') {\n\t\t\t\t\t// Unusable image layer (no safe url, or no width/height).\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Image layer needs a url, width and height; skipping.')\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (!ALLOWED_LAYER_TYPES.includes(def.type)) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(`[CnMapWidget] Unknown layer type \"${def.type}\", skipping.`)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tconst opts = { ...(def.options || {}) }\n\t\t\t\tif (def.attribution && !opts.attribution) {\n\t\t\t\t\topts.attribution = def.attribution\n\t\t\t\t}\n\n\t\t\t\tlet instance = null\n\t\t\t\tif (def.type === 'tile') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tinstance = L.tileLayer(def.url, withTileDefaults(opts))\n\t\t\t\t} else if (def.type === 'wms') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tinstance = L.tileLayer.wms(def.url, withTileDefaults(opts))\n\t\t\t\t} else if (def.type === 'wfs') {\n\t\t\t\t\tif (typeof def.url !== 'string' || def.url.length === 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthis.fetchAndAddGeoJson(def.url, opts)\n\t\t\t\t\tcontinue\n\t\t\t\t} else if (def.type === 'geojson') {\n\t\t\t\t\tif (def.data && typeof def.data === 'object') {\n\t\t\t\t\t\tinstance = L.geoJSON(def.data, opts)\n\t\t\t\t\t} else if (typeof def.url === 'string' && def.url.length > 0) {\n\t\t\t\t\t\tthis.fetchAndAddGeoJson(def.url, opts)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (instance) {\n\t\t\t\t\tinstance.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(instance)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show the picture: an image overlay on the flat bounds, fitted on open.\n\t\t * Any other layer beside it is skipped with a warning (one picture per map).\n\t\t *\n\t\t * @param {{url: string, width: number, height: number}} image The image layer.\n\t\t */\n\t\trenderImageLayer(image) {\n\t\t\tconst L = this.L\n\t\t\tfor (const def of this.cfg.layers) {\n\t\t\t\tif (def && typeof def === 'object' && def.type !== 'image') {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(`[CnMapWidget] Layer type \"${def.type}\" is skipped on an image map.`)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst bounds = imageBounds(image.width, image.height)\n\t\t\tconst overlay = L.imageOverlay(image.url, bounds)\n\t\t\toverlay.addTo(this.map)\n\t\t\tthis.layerInstances.push(overlay)\n\t\t\tthis.map.fitBounds(bounds)\n\t\t\t// The whole picture is the furthest out; four times native size the furthest in.\n\t\t\tif (typeof this.map.getBoundsZoom === 'function') {\n\t\t\t\tconst fit = this.map.getBoundsZoom(bounds)\n\t\t\t\tif (Number.isFinite(fit)) {\n\t\t\t\t\tif (typeof this.map.setMinZoom === 'function') {\n\t\t\t\t\t\tthis.map.setMinZoom(fit)\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof this.map.setMaxZoom === 'function') {\n\t\t\t\t\t\tthis.map.setMaxZoom(Math.max(2, fit))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fetch a GeoJSON-shaped resource and add it to the map. Used by\n\t\t * the WFS branch and the geojson-from-url branch.\n\t\t *\n\t\t * @param {string} url Endpoint that returns GeoJSON.\n\t\t * @param {object} opts Leaflet `geoJSON` options.\n\t\t */\n\t\tfetchAndAddGeoJson(url, opts) {\n\t\t\tconst L = this.L\n\t\t\tfetch(prefixUrl(url))\n\t\t\t\t.then((r) => r.json())\n\t\t\t\t.then((json) => {\n\t\t\t\t\tif (!this.map) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst layer = L.geoJSON(json, opts)\n\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(layer)\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Failed to load layer', url, err)\n\t\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Mount the configured `markers` onto the Leaflet map. Reads from\n\t\t * `features[]` (inline) OR `dataSource.url` (HTTP fetch). When\n\t\t * `clusteringEnabled`, lazy-loads `leaflet.markercluster` and\n\t\t * groups markers under a single cluster layer.\n\t\t */\n\t\tasync renderMarkers() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L || !this.cfg.markers) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Tear down previous marker layer\n\t\t\tif (this.markerLayer) {\n\t\t\t\tthis.map.removeLayer(this.markerLayer)\n\t\t\t\tthis.markerLayer = null\n\t\t\t}\n\t\t\tif (this.clusterGroup) {\n\t\t\t\tthis.map.removeLayer(this.clusterGroup)\n\t\t\t\tthis.clusterGroup = null\n\t\t\t}\n\n\t\t\tif (!this.imageLayer) {\n\t\t\t\tthis.unplottedCount = 0\n\t\t\t}\n\t\t\tthis.markersFailed = false\n\t\t\tconst features = await this.collectFeatures()\n\t\t\tthis.markerCount = Array.isArray(features) ? features.length : 0\n\t\t\tthis.markersLoaded = true\n\t\t\tif (!features || features.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst layer = L.geoJSON({ type: 'FeatureCollection', features }, {\n\t\t\t\tpointToLayer: (feature, latlng) => {\n\t\t\t\t\tconst color = (feature.properties && feature.properties.markerColor)\n\t\t\t\t\t\t|| (this.cfg.markers && this.cfg.markers.iconColor)\n\t\t\t\t\t\t|| 'var(--color-primary-element, #2196F3)'\n\t\t\t\t\t// A numbered pin, the number the list beside the map shows for the\n\t\t\t\t\t// same row (an index map with `mapConfig.list`); the active row's\n\t\t\t\t\t// pin draws darker.\n\t\t\t\t\tconst number = feature.properties && Number(feature.properties.markerNumber)\n\t\t\t\t\tif (Number.isInteger(number) && number > 0) {\n\t\t\t\t\t\tconst active = feature.properties.markerActive === true\n\t\t\t\t\t\t// A colour of the row's own (`markerColor`) fills the pin, except\n\t\t\t\t\t\t// the active one, which keeps the active colour.\n\t\t\t\t\t\tconst fill = feature.properties.markerColor\n\t\t\t\t\t\tconst style = !active && typeof fill === 'string' && /^[#a-zA-Z0-9(),.%\\s_-]+$/.test(fill)\n\t\t\t\t\t\t\t? ` class=\"cn-map-widget__pin-fill\" style=\"background:${fill}\"`\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\treturn L.marker(latlng, {\n\t\t\t\t\t\t\ticon: L.divIcon({\n\t\t\t\t\t\t\t\tclassName: active ? 'cn-map-widget__pin cn-map-widget__pin--active' : 'cn-map-widget__pin',\n\t\t\t\t\t\t\t\thtml: `<span${style}>${number}</span>`,\n\t\t\t\t\t\t\t\ticonSize: [26, 26],\n\t\t\t\t\t\t\t\ticonAnchor: [13, 13],\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tif (this.cfg.markers && this.cfg.markers.iconUrl) {\n\t\t\t\t\t\treturn L.marker(latlng, {\n\t\t\t\t\t\t\ticon: L.icon({ iconUrl: this.cfg.markers.iconUrl, iconSize: [25, 41], iconAnchor: [12, 41] }),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn L.circleMarker(latlng, {\n\t\t\t\t\t\tradius: 8,\n\t\t\t\t\t\tfillColor: color,\n\t\t\t\t\t\tcolor: '#fff',\n\t\t\t\t\t\tweight: 2,\n\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\tfillOpacity: 0.85,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tonEachFeature: (feature, lyr) => {\n\t\t\t\t\tconst popupField = this.cfg.markers && this.cfg.markers.popupField\n\t\t\t\t\tconst popupHtml = popupField && feature.properties ? feature.properties[popupField] : null\n\t\t\t\t\tif (popupHtml) {\n\t\t\t\t\t\t// Security: marker data may come from an external URL\n\t\t\t\t\t\t// (markers.dataSource.url) or arbitrary GeoJSON feature\n\t\t\t\t\t\t// properties (often an OR-backed data source). Leaflet's\n\t\t\t\t\t\t// bindPopup renders its string argument as HTML (innerHTML),\n\t\t\t\t\t\t// so sanitize with the shared strict config (C1) before\n\t\t\t\t\t\t// injecting — a `<script>` / `onerror=` payload cannot\n\t\t\t\t\t\t// execute in the Nextcloud origin.\n\t\t\t\t\t\tconst safeHtml = DOMPurify.sanitize(String(popupHtml), SAFE_MARKDOWN_DOMPURIFY_CONFIG)\n\t\t\t\t\t\tlyr.bindPopup(safeHtml)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Hover tooltip: a marker with no label is a mystery dot. Name it\n\t\t\t\t\t// with the object's own display name — the backend already derives\n\t\t\t\t\t// one and publishes it as `@self.name`, so a Cow (`name`), a Barn\n\t\t\t\t\t// (`title`), and a Case (`reference`) all read correctly without the\n\t\t\t\t\t// widget knowing the schema. bindTooltip also renders HTML, so\n\t\t\t\t\t// sanitize the same way bindPopup does.\n\t\t\t\t\tconst label = objectDisplayName(feature.properties || {})\n\t\t\t\t\tif (label !== '') {\n\t\t\t\t\t\tconst safeLabel = DOMPurify.sanitize(label, SAFE_MARKDOWN_DOMPURIFY_CONFIG)\n\t\t\t\t\t\tlyr.bindTooltip(safeLabel, { direction: 'top' })\n\t\t\t\t\t}\n\t\t\t\t\tlyr.on('click', (e) => {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Marker click event. Fired when a marker is clicked.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @event marker-click\n\t\t\t\t\t\t * @type {{feature: object, latlng: object}}\n\t\t\t\t\t\t */\n\t\t\t\t\t\tthis.$emit('marker-click', { feature, latlng: e.latlng })\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tif (this.clusteringEnabled) {\n\t\t\t\ttry {\n\t\t\t\t\t// TWO THINGS HAVE TO BE TRUE BEFORE THIS PLUGIN CAN RUN, AND\n\t\t\t\t\t// NEITHER OF THEM WAS.\n\t\t\t\t\t//\n\t\t\t\t\t// 1. The import has to reach a file. This line used to carry a\n\t\t\t\t\t// `webpackIgnore: true` magic comment, on the stated\n\t\t\t\t\t// reasoning that it stopped a downstream bundler resolving\n\t\t\t\t\t// the specifier against\n\t\t\t\t\t// `node_modules/@conduction/nextcloud-vue/dist/` and failing\n\t\t\t\t\t// with \"Module not found\". That reasoning does not hold, and\n\t\t\t\t\t// the marker is what broke it. `webpackIgnore` does not mean\n\t\t\t\t\t// \"skip the resolution\"; it means \"leave this import for the\n\t\t\t\t\t// BROWSER\", and a browser on a Nextcloud page cannot resolve\n\t\t\t\t\t// a module specifier. Rollup had already rewritten the\n\t\t\t\t\t// specifier in the published ESM build to\n\t\t\t\t\t// `../../node_modules/leaflet.markercluster/dist/\n\t\t\t\t\t// leaflet.markercluster-src.js` and emitted that file inside\n\t\t\t\t\t// the package, so every consumer requested\n\t\t\t\t\t// `node_modules/leaflet.markercluster/...` off the page URL\n\t\t\t\t\t// and got a 404. Clustering has never run in any app.\n\t\t\t\t\t// Without the marker, webpack resolves the relative path\n\t\t\t\t\t// against the file the package actually ships and emits it\n\t\t\t\t\t// as a lazy chunk, so the import stays lazy and clustering\n\t\t\t\t\t// costs nothing to a consumer that does not ask for it.\n\t\t\t\t\t//\n\t\t\t\t\t// 2. The plugin has to find Leaflet. leaflet.markercluster is a\n\t\t\t\t\t// CLASSIC Leaflet plugin: it exports nothing and instead\n\t\t\t\t\t// writes `L.MarkerClusterGroup` onto the GLOBAL `L`. This\n\t\t\t\t\t// widget imports Leaflet as an ES module and keeps it on\n\t\t\t\t\t// `this.L`, so there was no global for the plugin to attach\n\t\t\t\t\t// to, and even a plugin that loaded would have left\n\t\t\t\t\t// `L.markerClusterGroup` undefined. Publishing our own\n\t\t\t\t\t// instance on `window.L` first is what makes the plugin\n\t\t\t\t\t// augment the same object this component then reads.\n\t\t\t\t\t//\n\t\t\t\t\t// An existing `window.L` is left alone: if the page already has\n\t\t\t\t\t// Leaflet, the plugin must extend THAT one, and overwriting it\n\t\t\t\t\t// would break whatever put it there.\n\t\t\t\t\tif (typeof window !== 'undefined' && !window.L) {\n\t\t\t\t\t\twindow.L = L\n\t\t\t\t\t}\n\t\t\t\t\tawait import('leaflet.markercluster')\n\t\t\t\t\tif (typeof L.markerClusterGroup === 'function') {\n\t\t\t\t\t\tthis.clusterGroup = L.markerClusterGroup()\n\t\t\t\t\t\tthis.clusterGroup.addLayer(layer)\n\t\t\t\t\t\tthis.clusterGroup.addTo(this.map)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\t\tthis.markerLayer = layer\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Cluster plugin unavailable', err)\n\t\t\t\t\tlayer.addTo(this.map)\n\t\t\t\t\tthis.markerLayer = layer\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlayer.addTo(this.map)\n\t\t\t\tthis.markerLayer = layer\n\t\t\t}\n\n\t\t\t// Not once per render: a consumer that reloads its markers (a filter,\n\t\t\t// a poll, a save) re-renders them, and fitting again threw away\n\t\t\t// whatever the user had panned or zoomed to. Their framing wins from\n\t\t\t// the moment they touch the map; the Fit all markers control brings\n\t\t\t// this one back on request.\n\t\t\tif (this.cfg.autoFit && !this.userFramedView && !this.imageLayer) {\n\t\t\t\t// Wait a tick so the container has its final box — fill-height layouts\n\t\t\t\t// and the hidden→visible view toggle both settle after render.\n\t\t\t\t// fitToMarkers() then measures before it fits.\n\t\t\t\tthis.$nextTick(() => this.fitToMarkers())\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mount the switchable base maps and, when more than one is configured, a\n\t\t * Leaflet layer switcher. Falls back to a single OpenStreetMap base map when\n\t\t * the consumer supplied neither `basemaps` nor a `tile` entry in `layers`, so\n\t\t * a map is never left with a blank background.\n\t\t */\n\t\trenderBasemaps() {\n\t\t\tconst L = this.L\n\t\t\tif (!this.map || !L || typeof L.tileLayer !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst basemaps = (this.cfg.basemaps || []).filter((b) => b && typeof b.url === 'string' && b.url.length > 0)\n\t\t\tif (basemaps.length === 0) {\n\t\t\t\t// No explicit basemaps. Unless the consumer draws its own background\n\t\t\t\t// via a `tile`/`wms` entry in `layers`, add a single OpenStreetMap\n\t\t\t\t// base map so the map is never left blank (see DEFAULT_BASEMAP).\n\t\t\t\tconst hasTileLayer = (this.cfg.layers || []).some((l) => l\n\t\t\t\t\t&& (l.type === 'tile' || l.type === 'wms')\n\t\t\t\t\t&& typeof l.url === 'string' && l.url.length > 0)\n\t\t\t\tif (!hasTileLayer) {\n\t\t\t\t\tconst fallback = L.tileLayer(DEFAULT_BASEMAP.url, withTileDefaults({ ...DEFAULT_BASEMAP.options }))\n\t\t\t\t\tfallback.addTo(this.map)\n\t\t\t\t\tthis.layerInstances.push(fallback)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst baseLayers = {}\n\t\t\tbasemaps.forEach((bm, index) => {\n\t\t\t\tconst opts = { ...(bm.options || {}) }\n\t\t\t\tif (bm.attribution && !opts.attribution) {\n\t\t\t\t\topts.attribution = bm.attribution\n\t\t\t\t}\n\t\t\t\tconst instance = L.tileLayer(bm.url, withTileDefaults(opts))\n\t\t\t\tbaseLayers[bm.name || `${index + 1}`] = instance\n\t\t\t\t// Only the first base map is live on load; the switcher swaps in the rest.\n\t\t\t\tif (index === 0) {\n\t\t\t\t\tinstance.addTo(this.map)\n\t\t\t\t}\n\t\t\t\tthis.layerInstances.push(instance)\n\t\t\t})\n\n\t\t\tif (Object.keys(baseLayers).length > 1 && L.control && typeof L.control.layers === 'function') {\n\t\t\t\t// The board look keeps the top right for its control column.\n\t\t\t\tthis.layersControl = L.control.layers(baseLayers, {}, { position: this.isBoardLook ? 'topleft' : 'topright' })\n\t\t\t\tthis.layersControl.addTo(this.map)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mount the custom control bar (fit-all / locate / fullscreen). Leaflet's own\n\t\t * zoom + attribution controls are enabled separately in `initMap`; in the\n\t\t * board look the zoom buttons lead this bar instead, in the top right.\n\t\t */\n\t\taddControls() {\n\t\t\tconst L = this.L\n\t\t\t// L.Control is absent from lightweight Leaflet stubs (tests); the map is\n\t\t\t// still perfectly usable without the extra bar, so degrade quietly.\n\t\t\tif (!this.map || !L || !L.Control || typeof L.Control.extend !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst buttons = []\n\t\t\tconst board = this.isBoardLook\n\t\t\tif (board && (this.imageLayer || this.zoomControl)) {\n\t\t\t\tbuttons.push({ key: 'zoom-in', title: t('nextcloud-vue', 'Zoom in'), icon: ICON_ZOOM_IN, onClick: () => this.map.zoomIn() })\n\t\t\t\tbuttons.push({ key: 'zoom-out', title: t('nextcloud-vue', 'Zoom out'), icon: ICON_ZOOM_OUT, onClick: () => this.map.zoomOut() })\n\t\t\t}\n\t\t\tif (this.fitControl) {\n\t\t\t\tbuttons.push({ key: 'fit', title: t('nextcloud-vue', 'Fit all markers'), icon: board ? ICON_CROSSHAIRS : ICON_FIT, onClick: () => this.fitToMarkers() })\n\t\t\t}\n\t\t\tif (this.locateControl) {\n\t\t\t\tbuttons.push({ key: 'locate', title: t('nextcloud-vue', 'Show my location'), icon: ICON_LOCATE, onClick: () => this.locateMe() })\n\t\t\t}\n\t\t\tif (this.fullscreenControl) {\n\t\t\t\tbuttons.push({ key: 'fullscreen', title: t('nextcloud-vue', 'Toggle fullscreen'), icon: ICON_FULLSCREEN, onClick: () => this.toggleFullscreen() })\n\t\t\t}\n\t\t\tif (buttons.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// `onAdd()` below is invoked by Leaflet with `this` bound to the\n\t\t\t// L.Control instance, so the component has to be captured here to\n\t\t\t// stash the fullscreen button ref on it.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\t\tconst self = this\n\t\t\tconst ControlBar = L.Control.extend({\n\t\t\t\tonAdd() {\n\t\t\t\t\tconst bar = L.DomUtil.create('div', 'leaflet-bar cn-map-widget__controls')\n\t\t\t\t\tfor (const button of buttons) {\n\t\t\t\t\t\tconst anchor = L.DomUtil.create('a', `cn-map-widget__control cn-map-widget__control--${button.key}`, bar)\n\t\t\t\t\t\tanchor.href = '#'\n\t\t\t\t\t\tanchor.title = button.title\n\t\t\t\t\t\tanchor.setAttribute('role', 'button')\n\t\t\t\t\t\tanchor.setAttribute('aria-label', button.title)\n\t\t\t\t\t\tanchor.innerHTML = controlIcon(button.icon)\n\t\t\t\t\t\tif (button.key === 'fullscreen') {\n\t\t\t\t\t\t\tself.fullscreenButton = anchor\n\t\t\t\t\t\t}\n\t\t\t\t\t\tL.DomEvent.on(anchor, 'click', L.DomEvent.stop).on(anchor, 'click', button.onClick)\n\t\t\t\t\t}\n\t\t\t\t\t// Keep clicks / wheel on the bar from panning or zooming the map.\n\t\t\t\t\tL.DomEvent.disableClickPropagation(bar)\n\t\t\t\t\tL.DomEvent.disableScrollPropagation(bar)\n\t\t\t\t\treturn bar\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tthis.controlBar = new ControlBar({ position: board ? 'topright' : 'topleft' })\n\t\t\tthis.controlBar.addTo(this.map)\n\t\t},\n\n\t\t/**\n\t\t * Arm the hand-over: the next view change the map reports is the user's.\n\t\t */\n\t\tonViewGesture() {\n\t\t\tthis.pendingViewGesture = true\n\t\t},\n\n\t\t/**\n\t\t * Commit an armed gesture once the view has actually moved — and only\n\t\t * then, so a gesture that framed nothing cannot disable `autoFit`.\n\t\t */\n\t\tonViewSettled() {\n\t\t\tif (this.pendingViewGesture) {\n\t\t\t\tthis.pendingViewGesture = false\n\t\t\t\tthis.userFramedView = true\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Re-measure the container. Also drops an armed gesture: a size change is\n\t\t * ours, so the `moveend` it may fire is not the user framing the view.\n\t\t */\n\t\trefreshMapSize() {\n\t\t\tif (!this.map || typeof this.map.invalidateSize !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.pendingViewGesture = false\n\t\t\tthis.map.invalidateSize()\n\t\t},\n\n\t\t/**\n\t\t * Re-centre and re-zoom so every marker is back in view — the same frame\n\t\t * `autoFit` lands on at load. Public: consumers MAY call it through `$refs`.\n\t\t */\n\t\tfitToMarkers() {\n\t\t\tif (!this.map) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.imageLayer) {\n\t\t\t\t// On a picture, \"fit\" is the whole picture.\n\t\t\t\tthis.refreshMapSize()\n\t\t\t\tthis.map.fitBounds(imageBounds(this.imageLayer.width, this.imageLayer.height))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst target = this.clusterGroup || this.markerLayer\n\t\t\tif (!target) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst bounds = target.getBounds()\n\t\t\t\tif (!bounds || !bounds.isValid()) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// Measure first — a stale container size yields a wrong fit.\n\t\t\t\tthis.refreshMapSize()\n\t\t\t\tthis.map.fitBounds(bounds, { padding: [50, 50] })\n\t\t\t} catch {\n\t\t\t\t// ignore — empty layer set means no bounds to fit\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Centre the map on the visitor's own position. Failures (denied permission,\n\t\t * insecure origin) surface via the `locationerror` handler in `initMap`.\n\t\t */\n\t\tlocateMe() {\n\t\t\tif (!this.map || typeof this.map.locate !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.map.locate({ setView: true, maxZoom: 16 })\n\t\t},\n\n\t\t/**\n\t\t * Toggle the CSS fullscreen overlay and re-flow Leaflet into the new box.\n\t\t */\n\t\ttoggleFullscreen() {\n\t\t\tthis.isFullscreen = !this.isFullscreen\n\t\t\tif (this.fullscreenButton) {\n\t\t\t\tthis.fullscreenButton.innerHTML = controlIcon(this.isFullscreen ? ICON_FULLSCREEN_EXIT : ICON_FULLSCREEN)\n\t\t\t}\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.refreshMapSize()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * A data source's `filter` with its `@objectId` / `@object.<field>`\n\t\t * tokens resolved against the page's record.\n\t\t *\n\t\t * @param {{filter?: object}} ds The data source.\n\t\t * @return {object} The query parameters.\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\tsourceFilter(ds) {\n\t\t\tif (!ds || !ds.filter || typeof ds.filter !== 'object') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn resolveFilterTokens(ds.filter, this.filterContext)\n\t\t},\n\n\t\t/**\n\t\t * The `content.refreshOn` event fired: read the markers again. With\n\t\t * `content.refreshMatch` only when the payload's field names this record.\n\t\t *\n\t\t * @param {object} payload The event payload.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-map-can-plot-the-objects-that-point-at-a-record\n\t\t */\n\t\tonRefreshEvent(payload) {\n\t\t\tconst match = this.content && typeof this.content.refreshMatch === 'string' ? this.content.refreshMatch : ''\n\t\t\tif (match !== '' && String(payload?.[match] ?? '') !== String(this.objectId ?? '')) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.map) {\n\t\t\t\tthis.renderMarkers()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Resolve the features set for the current `markers` config.\n\t\t *\n\t\t * Returns the inline `features[]` when set; otherwise fetches\n\t\t * `dataSource.url` and converts the response into GeoJSON\n\t\t * features. The response MAY be either a GeoJSON\n\t\t * FeatureCollection OR an array of flat rows (in which case\n\t\t * `latField`, `lngField`, `popupField` drive the conversion).\n\t\t *\n\t\t * `dataSource.{register, schema}` plots the objects of an OpenRegister\n\t\t * register/schema (see fetchRegisterFeatures).\n\t\t *\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync collectFeatures() {\n\t\t\tif (!this.cfg.markers) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.imageLayer) {\n\t\t\t\treturn this.imageFeatures(await this.collectSourceRows())\n\t\t\t}\n\t\t\tlet features = await this.collectSourceFeatures()\n\t\t\t// Optional pin at the configured centre, plotted alongside the object\n\t\t\t// markers (`markers.centerMarker`). Spread into a new array so an inline\n\t\t\t// `features[]` prop is never mutated.\n\t\t\tif (this.cfg.markers.centerMarker) {\n\t\t\t\tconst centre = this.centreMarkerFeature()\n\t\t\t\tif (centre) {\n\t\t\t\t\tfeatures = [...features, centre]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn features\n\t\t},\n\n\t\t/**\n\t\t * The rows behind an image map's markers: inline features' properties, a\n\t\t * fetched `dataSource.url` (rows, or a FeatureCollection's properties) or an\n\t\t * OpenRegister `dataSource.{register, schema}`.\n\t\t *\n\t\t * @return {Promise<Array<object>>} The rows.\n\t\t */\n\t\tasync collectSourceRows() {\n\t\t\tconst m = this.cfg.markers\n\t\t\tconst fromFeatures = (list) => (Array.isArray(list) ? list.map((f) => (f && f.properties ? f.properties : f)) : [])\n\t\t\tif (Array.isArray(m.features)) {\n\t\t\t\treturn fromFeatures(m.features)\n\t\t\t}\n\t\t\tconst ds = m.dataSource\n\t\t\tif (!ds) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (typeof ds.url === 'string' && ds.url.length > 0) {\n\t\t\t\t\tconst json = await (await fetch(prefixUrl(ds.url))).json()\n\t\t\t\t\treturn Array.isArray(json) ? json : fromFeatures(json && json.features)\n\t\t\t\t}\n\t\t\t\tif (ds.register && ds.schema) {\n\t\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([import('@nextcloud/axios'), import('@nextcloud/router')])\n\t\t\t\t\tconst url = generateUrl('/apps/openregister/api/objects/{register}/{schema}', { register: ds.register, schema: ds.schema })\n\t\t\t\t\tconst res = await axios.get(url, { params: { ...this.sourceFilter(ds), _limit: ds.limit || 500 } })\n\t\t\t\t\treturn (res && res.data && res.data.results) || []\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tthis.markersFailed = true\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Failed to load markers', ds, err)\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\n\t\t/**\n\t\t * Place rows on the picture by `xField` / `yField` (default `x` / `y`).\n\t\t * A row without both numbers is not plotted and is counted in the note.\n\t\t *\n\t\t * @param {Array<object>} rows The rows.\n\t\t * @return {Array<object>} GeoJSON Point features in the flat coordinates.\n\t\t */\n\t\timageFeatures(rows) {\n\t\t\tconst xField = (this.cfg.markers && this.cfg.markers.xField) || 'x'\n\t\t\tconst yField = (this.cfg.markers && this.cfg.markers.yField) || 'y'\n\t\t\tconst features = []\n\t\t\tlet skipped = 0\n\t\t\tfor (const row of rows) {\n\t\t\t\tif (!hasImagePosition(row, xField, yField)) {\n\t\t\t\t\tskipped += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst point = toImagePoint(row[xField], row[yField])\n\t\t\t\tfeatures.push({\n\t\t\t\t\ttype: 'Feature',\n\t\t\t\t\tgeometry: { type: 'Point', coordinates: [point.lng, point.lat] },\n\t\t\t\t\tproperties: { ...row },\n\t\t\t\t})\n\t\t\t}\n\t\t\tthis.unplottedCount = skipped\n\t\t\treturn features\n\t\t},\n\n\t\t/**\n\t\t * Resolve the marker features from the configured source only —\n\t\t * inline `features[]`, a fetched `dataSource.url`, or an OpenRegister\n\t\t * `dataSource.{register, schema}`. The optional centre pin is layered on\n\t\t * by collectFeatures().\n\t\t *\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync collectSourceFeatures() {\n\t\t\tif (Array.isArray(this.cfg.markers.features)) {\n\t\t\t\treturn this.cfg.markers.features\n\t\t\t}\n\t\t\tconst ds = this.cfg.markers.dataSource\n\t\t\tif (!ds) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (typeof ds.url === 'string' && ds.url.length > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await fetch(prefixUrl(ds.url))\n\t\t\t\t\tconst json = await response.json()\n\t\t\t\t\treturn this.normaliseFeatures(json)\n\t\t\t\t} catch (err) {\n\t\t\t\t\tthis.markersFailed = true\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn('[CnMapWidget] Failed to fetch markers', ds.url, err)\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ds.register && ds.schema) {\n\t\t\t\treturn await this.fetchRegisterFeatures(ds)\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\n\t\t/**\n\t\t * Build a GeoJSON point Feature at the resolved centre, or null when the\n\t\t * centre is not a valid `[lat, lng]` pair. GeoJSON coordinates are\n\t\t * `[lng, lat]`, the reverse of the `center` prop's order.\n\t\t *\n\t\t * @return {object|null} the centre Feature, or null.\n\t\t */\n\t\tcentreMarkerFeature() {\n\t\t\tconst c = this.cfg.center\n\t\t\tif (!Array.isArray(c) || c.length !== 2 || !c.every((n) => Number.isFinite(n))) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttype: 'Feature',\n\t\t\t\tgeometry: { type: 'Point', coordinates: [c[1], c[0]] },\n\t\t\t\tproperties: {},\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Plot the objects of an OpenRegister register/schema.\n\t\t *\n\t\t * Each object's location comes from `@self.geo` (where CnObjectGeoWidget writes\n\t\t * it), falling back to plain `latField` / `lngField` properties so a schema that\n\t\t * models coordinates itself still plots. Objects with no usable location are\n\t\t * skipped rather than dropped at (0, 0) — an invisible wrong marker is worse\n\t\t * than an absent one.\n\t\t *\n\t\t * @param {{register: string, schema: string, limit?: number}} ds The data source.\n\t\t * @return {Promise<Array<object>>} GeoJSON Feature array.\n\t\t */\n\t\tasync fetchRegisterFeatures(ds) {\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t'/apps/openregister/api/objects/{register}/{schema}',\n\t\t\t\t\t{ register: ds.register, schema: ds.schema },\n\t\t\t\t)\n\t\t\t\tconst res = await axios.get(url, { params: { ...this.sourceFilter(ds), _limit: ds.limit || 500 } })\n\t\t\t\tconst rows = (res && res.data && res.data.results) || []\n\n\t\t\t\tconst latField = this.cfg.markers && this.cfg.markers.latField\n\t\t\t\tconst lngField = this.cfg.markers && this.cfg.markers.lngField\n\n\t\t\t\t// (0, 0) is where an unset pair of numbers lands, not a place.\n\t\t\t\treturn rows\n\t\t\t\t\t.map((row) => objectToGeoFeature(row, { latField, lngField }))\n\t\t\t\t\t.filter((feature) => feature && !(feature.geometry.coordinates[0] === 0 && feature.geometry.coordinates[1] === 0))\n\t\t\t} catch (err) {\n\t\t\t\tthis.markersFailed = true\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMapWidget] Failed to load objects for the map', ds, err)\n\t\t\t\treturn []\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Normalise a fetched payload into a GeoJSON Feature array.\n\t\t * Accepts FeatureCollection, raw Feature[], or flat rows that\n\t\t * declare `latField` / `lngField` (plus optional `popupField`\n\t\t * for popup HTML).\n\t\t *\n\t\t * @param {object|Array} json The fetched payload.\n\t\t * @return {Array<object>} GeoJSON Feature array.\n\t\t */\n\t\tnormaliseFeatures(json) {\n\t\t\tif (!json) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (Array.isArray(json.features)) {\n\t\t\t\treturn json.features\n\t\t\t}\n\t\t\tif (Array.isArray(json)) {\n\t\t\t\tconst latField = (this.cfg.markers && this.cfg.markers.latField) || 'lat'\n\t\t\t\tconst lngField = (this.cfg.markers && this.cfg.markers.lngField) || 'lng'\n\t\t\t\treturn json\n\t\t\t\t\t.filter((row) => row !== null && row !== undefined && Number.isFinite(row[latField]) && Number.isFinite(row[lngField]))\n\t\t\t\t\t.map((row) => ({\n\t\t\t\t\t\ttype: 'Feature',\n\t\t\t\t\t\tgeometry: { type: 'Point', coordinates: [row[lngField], row[latField]] },\n\t\t\t\t\t\tproperties: { ...row },\n\t\t\t\t\t}))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget {\n\tposition: relative;\n\twidth: 100%;\n\tmin-height: 200px;\n}\n\n.cn-map-widget__leaflet {\n\twidth: 100%;\n\theight: 100%;\n\t/* Leaflet paints its container #ddd, which reads as a white flash before the\n\t tiles arrive — and a bright one in a dark theme. */\n\tbackground: var(--color-background-dark);\n}\n\n.cn-map-widget__note {\n\tmargin: 4px 0 0;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Why the map shows no markers: the card's own text size, on its inset. */\n.cn-map-widget__note--status {\n\tfont-size: 14px;\n}\n\n.cn-map-widget__note--error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-map-widget__fallback {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\theight: 100%;\n\tmin-height: 150px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-map-widget__error {\n\tfont-size: 14px;\n\tmargin: 0;\n}\n\n.cn-map-widget__legend {\n\tposition: absolute;\n\ttop: 12px;\n\tright: 12px;\n\tz-index: 1000;\n\tbackground: var(--color-main-background);\n\tpadding: 8px 12px;\n\tborder-radius: var(--border-radius-large, 8px);\n\tbox-shadow: 0 2px 8px rgba(0, 0, 0, .15);\n}\n\n/* Fullscreen overlay. A CSS-fixed box rather than the Fullscreen API, so it needs\n no permission prompt; the z-index clears the Nextcloud header. */\n.cn-map-widget--fullscreen {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100vw;\n\theight: 100vh;\n\tz-index: 3000;\n}\n\n/* Custom control bar (fit / locate / fullscreen), themed to Nextcloud rather than\n Leaflet's default white-on-grey buttons.\n ::v-deep is required — Leaflet builds the control DOM via L.DomUtil.create, so\n those nodes never receive this SFC's scoped data-v attribute. */\n.cn-map-widget ::v-deep .cn-map-widget__control {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 30px;\n\theight: 30px;\n\tcolor: var(--color-main-text);\n\tbackground: var(--color-main-background);\n}\n\n.cn-map-widget ::v-deep .cn-map-widget__control:hover,\n.cn-map-widget ::v-deep .cn-map-widget__control:focus-visible {\n\tbackground: var(--color-background-hover);\n}\n</style>\n\n<style>\n/* A numbered pin (`properties.markerNumber`): a 26px primary circle with its\n number in white, the active one darker. Unscoped, because Leaflet creates\n the marker element outside the template. */\n.cn-map-widget__pin {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: 2px solid var(--color-main-background);\n\tborder-radius: 50%;\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tfont-size: 13px;\n\tfont-weight: 700;\n\tbox-sizing: border-box;\n}\n\n.cn-map-widget__pin-fill {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n\tborder-radius: 50%;\n}\n\n.cn-map-widget__pin--active {\n\tbackground: var(--color-primary-element-light-text);\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;;;;;;AA6GA,MAAM,mBAAoB,GAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAA;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAoB,GAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAA;;AAE1E;AACA;AACA;AACA;AACA,MAAM,oBAAmB,GAAI,kCAAgC;;AAE7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