import { c } from "react-compiler-runtime";
import React from "react";
import { ImageOverlay, MapContainer, Marker } from "react-leaflet";
import L from "leaflet";
import ReactDOMServer from "react-dom/server";
//#region src/maps/leafletMaps/FluentImageMap.jsx
const FluentImageMap = (t0) => {
	const $ = c(19);
	const { onClick, coordinates, bounds, style, dragging: t1, doubleClickZoom: t2, scrollWheelZoom: t3, attributionControl: t4, zoomControl: t5, IconComponent, MapTile } = t0;
	const dragging = t1 === void 0 ? false : t1;
	const doubleClickZoom = t2 === void 0 ? false : t2;
	const scrollWheelZoom = t3 === void 0 ? false : t3;
	const attributionControl = t4 === void 0 ? false : t4;
	const zoomControl = t5 === void 0 ? false : t5;
	let t6;
	if ($[0] !== IconComponent) {
		t6 = (item) => new L.DivIcon({
			className: "custom-div-icon",
			html: ReactDOMServer.renderToString(/* @__PURE__ */ React.createElement(IconComponent, { available: item.status })),
			iconSize: [28, 28],
			iconAnchor: [14, 28]
		});
		$[0] = IconComponent;
		$[1] = t6;
	} else t6 = $[1];
	const createDivIcon = t6;
	let t7;
	if ($[2] !== MapTile || $[3] !== bounds) {
		t7 = /* @__PURE__ */ React.createElement(ImageOverlay, {
			bounds,
			url: MapTile
		});
		$[2] = MapTile;
		$[3] = bounds;
		$[4] = t7;
	} else t7 = $[4];
	let t8;
	if ($[5] !== coordinates || $[6] !== createDivIcon || $[7] !== onClick) {
		t8 = coordinates && coordinates.map((item_0, index) => /* @__PURE__ */ React.createElement(Marker, {
			key: item_0.title ?? index,
			icon: createDivIcon(item_0),
			position: [item_0.long, item_0.lat],
			eventHandlers: { click: () => onClick(item_0.title) }
		}));
		$[5] = coordinates;
		$[6] = createDivIcon;
		$[7] = onClick;
		$[8] = t8;
	} else t8 = $[8];
	let t9;
	if ($[9] !== attributionControl || $[10] !== bounds || $[11] !== doubleClickZoom || $[12] !== dragging || $[13] !== scrollWheelZoom || $[14] !== style || $[15] !== t7 || $[16] !== t8 || $[17] !== zoomControl) {
		t9 = /* @__PURE__ */ React.createElement(MapContainer, {
			crs: L.CRS.Simple,
			bounds,
			style,
			dragging,
			doubleClickZoom,
			scrollWheelZoom,
			attributionControl,
			zoomControl
		}, t7, t8);
		$[9] = attributionControl;
		$[10] = bounds;
		$[11] = doubleClickZoom;
		$[12] = dragging;
		$[13] = scrollWheelZoom;
		$[14] = style;
		$[15] = t7;
		$[16] = t8;
		$[17] = zoomControl;
		$[18] = t9;
	} else t9 = $[18];
	return t9;
};
//#endregion
export { FluentImageMap };

//# sourceMappingURL=FluentImageMap.mjs.map