@mamrp/components 1.7.52 → 1.7.55

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.
package/dist/index.mjs CHANGED
@@ -6163,6 +6163,470 @@ var UploadImage2 = ({
6163
6163
  );
6164
6164
  };
6165
6165
  var upload_image_default = UploadImage2;
6166
+
6167
+ // src/map-location-picker/index.tsx
6168
+ import {
6169
+ Box as Box27,
6170
+ IconButton as IconButton14,
6171
+ Paper as Paper2,
6172
+ Typography as Typography19,
6173
+ CircularProgress as CircularProgress11,
6174
+ useTheme as useTheme9,
6175
+ Button as Button15,
6176
+ Dialog as Dialog10,
6177
+ DialogTitle as DialogTitle8,
6178
+ DialogContent as DialogContent8,
6179
+ DialogActions as DialogActions5
6180
+ } from "@mui/material";
6181
+ import { MdMyLocation, MdOutlineClear as MdOutlineClear2 } from "react-icons/md";
6182
+ import { useEffect as useEffect12, useRef as useRef8, useState as useState17 } from "react";
6183
+ import toast2, { Toaster } from "react-hot-toast";
6184
+ import { useController } from "react-hook-form";
6185
+ function MapLocationPicker({
6186
+ control,
6187
+ nameLat,
6188
+ nameLong,
6189
+ nameAddress,
6190
+ isLoading = false,
6191
+ defaultLat = 36.557153,
6192
+ defaultLng = 52.679547,
6193
+ defaultZoom = 16,
6194
+ minZoom = 10,
6195
+ maxZoom = 19
6196
+ }) {
6197
+ const theme3 = useTheme9();
6198
+ const isDarkMode = theme3.palette.mode === "dark";
6199
+ const { field: latField, fieldState: latState } = useController({
6200
+ name: nameLat,
6201
+ control
6202
+ });
6203
+ const { field: longField, fieldState: longState } = useController({
6204
+ name: nameLong,
6205
+ control
6206
+ });
6207
+ const addressController = nameAddress ? useController({ name: nameAddress, control }) : null;
6208
+ const error = !!latState.error || !!longState.error;
6209
+ const helperText = latState.error?.message || longState.error?.message || "";
6210
+ const latitude = latField.value;
6211
+ const longitude = longField.value;
6212
+ const handleLocationChange = (lat, lng) => {
6213
+ latField.onChange(lat);
6214
+ longField.onChange(lng);
6215
+ };
6216
+ const handleAddressChange = nameAddress ? (address) => addressController?.field.onChange(address) : void 0;
6217
+ const mapRef = useRef8(null);
6218
+ const mapInstanceRef = useRef8(null);
6219
+ const markerRef = useRef8(null);
6220
+ const [isMapLoading, setIsMapLoading] = useState17(true);
6221
+ const [isGeocoding, setIsGeocoding] = useState17(false);
6222
+ const [isGeolocating, setIsGeolocating] = useState17(false);
6223
+ const [showGpsDialog, setShowGpsDialog] = useState17(false);
6224
+ const [gpsErrorType, setGpsErrorType] = useState17("other");
6225
+ const [zoom, setZoom] = useState17(defaultZoom);
6226
+ useEffect12(() => {
6227
+ if (!document.getElementById("leaflet-css")) {
6228
+ const link = document.createElement("link");
6229
+ link.id = "leaflet-css";
6230
+ link.rel = "stylesheet";
6231
+ link.href = "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.css";
6232
+ document.head.appendChild(link);
6233
+ }
6234
+ const script = document.createElement("script");
6235
+ script.src = "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js";
6236
+ script.async = true;
6237
+ script.onload = () => {
6238
+ setIsMapLoading(false);
6239
+ initializeMap();
6240
+ };
6241
+ document.body.appendChild(script);
6242
+ return () => {
6243
+ if (mapInstanceRef.current) {
6244
+ mapInstanceRef.current.remove();
6245
+ }
6246
+ };
6247
+ }, []);
6248
+ useEffect12(() => {
6249
+ if (!mapInstanceRef.current) return;
6250
+ if (latitude === null || longitude === null) {
6251
+ if (markerRef.current) {
6252
+ markerRef.current.remove();
6253
+ markerRef.current = null;
6254
+ }
6255
+ return;
6256
+ }
6257
+ const currentLat = latitude ?? defaultLat;
6258
+ const currentLng = longitude ?? defaultLng;
6259
+ const L = window.L;
6260
+ if (!markerRef.current) {
6261
+ markerRef.current = L.marker([currentLat, currentLng], {
6262
+ draggable: true
6263
+ }).addTo(mapInstanceRef.current);
6264
+ markerRef.current.on("dragend", async (e) => {
6265
+ const { lat, lng } = e.target.getLatLng();
6266
+ handleLocationChange(lat, lng);
6267
+ if (handleAddressChange) {
6268
+ setIsGeocoding(true);
6269
+ const address = await reverseGeocode(lat, lng);
6270
+ handleAddressChange(address);
6271
+ setIsGeocoding(false);
6272
+ }
6273
+ });
6274
+ } else {
6275
+ markerRef.current.setLatLng([currentLat, currentLng]);
6276
+ }
6277
+ }, [latitude, longitude, handleAddressChange, defaultLat, defaultLng]);
6278
+ const reverseGeocode = async (lat, lng) => {
6279
+ try {
6280
+ const response = await fetch(
6281
+ `https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${lat}&lon=${lng}&accept-language=fa`
6282
+ );
6283
+ if (!response.ok) throw new Error("Failed to fetch address");
6284
+ const data = await response.json();
6285
+ const fullAddress = data.display_name || "";
6286
+ const parts = fullAddress.split(",");
6287
+ return parts.slice(0, 4).map((p) => p.trim()).join("\u060C ");
6288
+ } catch {
6289
+ return "";
6290
+ }
6291
+ };
6292
+ const initializeMap = () => {
6293
+ if (!window.L || !mapRef.current || mapInstanceRef.current) return;
6294
+ const L = window.L;
6295
+ const initialLat = latitude ?? defaultLat;
6296
+ const initialLng = longitude ?? defaultLng;
6297
+ const map = L.map(mapRef.current, {
6298
+ attributionControl: false,
6299
+ minZoom
6300
+ }).setView([initialLat, initialLng], zoom);
6301
+ L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
6302
+ attribution: "\xA9 OpenStreetMap contributors",
6303
+ maxZoom
6304
+ }).addTo(map);
6305
+ map.on("zoomend", () => {
6306
+ setZoom(map.getZoom());
6307
+ });
6308
+ if (latitude !== null && longitude !== null) {
6309
+ const marker = L.marker([initialLat, initialLng], {
6310
+ draggable: true
6311
+ }).addTo(map);
6312
+ marker.on("dragend", async (e) => {
6313
+ const { lat, lng } = e.target.getLatLng();
6314
+ handleLocationChange(lat, lng);
6315
+ if (handleAddressChange) {
6316
+ setIsGeocoding(true);
6317
+ const address = await reverseGeocode(lat, lng);
6318
+ handleAddressChange(address);
6319
+ setIsGeocoding(false);
6320
+ }
6321
+ });
6322
+ markerRef.current = marker;
6323
+ }
6324
+ map.on("click", async (e) => {
6325
+ const { lat, lng } = e.latlng;
6326
+ if (!markerRef.current) {
6327
+ const L2 = window.L;
6328
+ markerRef.current = L2.marker([lat, lng], {
6329
+ draggable: true
6330
+ }).addTo(map);
6331
+ markerRef.current.on("dragend", async (dragEvent) => {
6332
+ const { lat: dragLat, lng: dragLng } = dragEvent.target.getLatLng();
6333
+ handleLocationChange(dragLat, dragLng);
6334
+ if (handleAddressChange) {
6335
+ setIsGeocoding(true);
6336
+ const address = await reverseGeocode(dragLat, dragLng);
6337
+ handleAddressChange(address);
6338
+ setIsGeocoding(false);
6339
+ }
6340
+ });
6341
+ } else {
6342
+ markerRef.current.setLatLng([lat, lng]);
6343
+ }
6344
+ handleLocationChange(lat, lng);
6345
+ if (handleAddressChange) {
6346
+ setIsGeocoding(true);
6347
+ const address = await reverseGeocode(lat, lng);
6348
+ handleAddressChange(address);
6349
+ setIsGeocoding(false);
6350
+ }
6351
+ });
6352
+ mapInstanceRef.current = map;
6353
+ };
6354
+ const checkGeolocationSupport = () => {
6355
+ if (!navigator.geolocation) {
6356
+ toast2.error("\u0645\u0631\u0648\u0631\u06AF\u0631 \u0634\u0645\u0627 \u0627\u0632 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC\u200C\u06A9\u0646\u062F.");
6357
+ return false;
6358
+ }
6359
+ return true;
6360
+ };
6361
+ const handleCurrentLocation = async () => {
6362
+ if (!checkGeolocationSupport() || !mapInstanceRef.current) {
6363
+ return;
6364
+ }
6365
+ if (navigator.permissions) {
6366
+ try {
6367
+ const permissionStatus = await navigator.permissions.query({
6368
+ name: "geolocation"
6369
+ });
6370
+ if (permissionStatus.state === "denied") {
6371
+ setGpsErrorType("permission");
6372
+ setShowGpsDialog(true);
6373
+ return;
6374
+ }
6375
+ } catch (error2) {
6376
+ console.log("Permissions API not available");
6377
+ }
6378
+ }
6379
+ setIsGeolocating(true);
6380
+ const timeoutId = setTimeout(() => {
6381
+ if (isGeolocating) {
6382
+ setIsGeolocating(false);
6383
+ setGpsErrorType("gps_off");
6384
+ setShowGpsDialog(true);
6385
+ }
6386
+ }, 5e3);
6387
+ navigator.geolocation.getCurrentPosition(
6388
+ async (pos) => {
6389
+ clearTimeout(timeoutId);
6390
+ setIsGeolocating(false);
6391
+ const { latitude: lat, longitude: lng } = pos.coords;
6392
+ const map = mapInstanceRef.current;
6393
+ const L = window.L;
6394
+ handleLocationChange(lat, lng);
6395
+ if (!markerRef.current) {
6396
+ markerRef.current = L.marker([lat, lng], {
6397
+ draggable: true
6398
+ }).addTo(map);
6399
+ markerRef.current.on("dragend", async (e) => {
6400
+ const { lat: dragLat, lng: dragLng } = e.target.getLatLng();
6401
+ handleLocationChange(dragLat, dragLng);
6402
+ if (handleAddressChange) {
6403
+ setIsGeocoding(true);
6404
+ const address = await reverseGeocode(dragLat, dragLng);
6405
+ handleAddressChange(address);
6406
+ setIsGeocoding(false);
6407
+ }
6408
+ });
6409
+ } else {
6410
+ markerRef.current.setLatLng([lat, lng]);
6411
+ }
6412
+ map.setView([lat, lng], map.getZoom(), { animate: true });
6413
+ if (handleAddressChange) {
6414
+ setIsGeocoding(true);
6415
+ const address = await reverseGeocode(lat, lng);
6416
+ handleAddressChange(address);
6417
+ setIsGeocoding(false);
6418
+ }
6419
+ toast2.success("\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F");
6420
+ },
6421
+ (error2) => {
6422
+ clearTimeout(timeoutId);
6423
+ setIsGeolocating(false);
6424
+ let errorMessage = "\u062E\u0637\u0627 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC";
6425
+ switch (error2.code) {
6426
+ case error2.PERMISSION_DENIED:
6427
+ setGpsErrorType("permission");
6428
+ setShowGpsDialog(true);
6429
+ return;
6430
+ case error2.POSITION_UNAVAILABLE:
6431
+ setGpsErrorType("gps_off");
6432
+ setShowGpsDialog(true);
6433
+ return;
6434
+ case error2.TIMEOUT:
6435
+ setGpsErrorType("gps_off");
6436
+ setShowGpsDialog(true);
6437
+ return;
6438
+ default:
6439
+ errorMessage = "\u062E\u0637\u0627\u06CC \u0646\u0627\u0645\u0634\u062E\u0635 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0631\u062E \u062F\u0627\u062F.";
6440
+ break;
6441
+ }
6442
+ toast2.error(errorMessage);
6443
+ },
6444
+ {
6445
+ enableHighAccuracy: true,
6446
+ timeout: 8e3,
6447
+ maximumAge: 0
6448
+ }
6449
+ );
6450
+ };
6451
+ const handleGpsDialogClose = () => {
6452
+ setShowGpsDialog(false);
6453
+ };
6454
+ const handleOpenSettings = () => {
6455
+ setShowGpsDialog(false);
6456
+ const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
6457
+ if (isMobile) {
6458
+ toast2.loading(
6459
+ /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography19, { variant: "body2", sx: { mb: 1 } }, "\u0644\u0637\u0641\u0627\u064B \u0645\u0631\u0627\u062D\u0644 \u0632\u06CC\u0631 \u0631\u0627 \u0627\u0646\u062C\u0627\u0645 \u062F\u0647\u06CC\u062F:"), /* @__PURE__ */ React.createElement(Typography19, { variant: "caption", component: "div" }, "\u06F1. \u0648\u0627\u0631\u062F \u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0648\u06CC\u062F"), /* @__PURE__ */ React.createElement(Typography19, { variant: "caption", component: "div" }, '\u06F2. \u0628\u0647 \u0628\u062E\u0634 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u0628\u0631\u0648\u06CC\u062F'), /* @__PURE__ */ React.createElement(Typography19, { variant: "caption", component: "div" }, "\u06F3. GPS \u0631\u0627 \u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F"), /* @__PURE__ */ React.createElement(Typography19, { variant: "caption", component: "div" }, "\u06F4. \u062F\u0648\u0628\u0627\u0631\u0647 \u0627\u0645\u062A\u062D\u0627\u0646 \u06A9\u0646\u06CC\u062F")),
6460
+ {
6461
+ duration: 8e3,
6462
+ position: "top-center"
6463
+ }
6464
+ );
6465
+ } else {
6466
+ toast2.error("\u0644\u0637\u0641\u0627\u064B GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u062E\u0648\u062F \u0631\u0627 \u0631\u0648\u0634\u0646 \u06A9\u0646\u06CC\u062F");
6467
+ }
6468
+ };
6469
+ const handleRetryLocation = () => {
6470
+ setShowGpsDialog(false);
6471
+ setTimeout(() => {
6472
+ handleCurrentLocation();
6473
+ }, 1e3);
6474
+ };
6475
+ const handleClearLocation = () => {
6476
+ if (markerRef.current) {
6477
+ markerRef.current.remove();
6478
+ markerRef.current = null;
6479
+ }
6480
+ handleLocationChange(null, null);
6481
+ if (handleAddressChange) {
6482
+ handleAddressChange("");
6483
+ }
6484
+ };
6485
+ return /* @__PURE__ */ React.createElement(Box27, { sx: { width: "100%" } }, /* @__PURE__ */ React.createElement(
6486
+ Toaster,
6487
+ {
6488
+ position: "top-center",
6489
+ toastOptions: {
6490
+ duration: 4e3,
6491
+ style: {
6492
+ background: isDarkMode ? "#333" : "#fff",
6493
+ color: isDarkMode ? "#fff" : "#333"
6494
+ }
6495
+ }
6496
+ }
6497
+ ), /* @__PURE__ */ React.createElement(
6498
+ Dialog10,
6499
+ {
6500
+ open: showGpsDialog,
6501
+ onClose: handleGpsDialogClose,
6502
+ "aria-labelledby": "gps-dialog-title"
6503
+ },
6504
+ /* @__PURE__ */ React.createElement(DialogTitle8, { id: "gps-dialog-title" }, "\u0645\u0634\u06A9\u0644 \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC"),
6505
+ /* @__PURE__ */ React.createElement(DialogContent8, null, gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(Typography19, null, "\u062F\u0633\u062A\u0631\u0633\u06CC \u0628\u0647 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u062A\u0648\u0633\u0637 \u0634\u0645\u0627 \u0631\u062F \u0634\u062F\u0647 \u0627\u0633\u062A. \u0628\u0631\u0627\u06CC \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 \u0627\u06CC\u0646 \u0642\u0627\u0628\u0644\u06CC\u062A:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. \u0631\u0648\u06CC \u0622\u06CC\u06A9\u0648\u0646 \u0642\u0641\u0644 \u062F\u0631 \u0646\u0648\u0627\u0631 \u0622\u062F\u0631\u0633 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), '\u06F2. \u06AF\u0632\u06CC\u0646\u0647 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u0631\u0627 \u067E\u06CC\u062F\u0627 \u06A9\u0646\u06CC\u062F', /* @__PURE__ */ React.createElement("br", null), '\u06F3. \u062F\u0633\u062A\u0631\u0633\u06CC \u0631\u0627 "\u0627\u062C\u0627\u0632\u0647" \u06A9\u0646\u06CC\u062F') : gpsErrorType === "gps_off" ? /* @__PURE__ */ React.createElement(Typography19, null, "GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0645\u0627 \u062E\u0627\u0645\u0648\u0634 \u0627\u0633\u062A. \u0644\u0637\u0641\u0627\u064B:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. \u0648\u0627\u0631\u062F \u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u062F\u0633\u062A\u06AF\u0627\u0647 \u0634\u0648\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), '\u06F2. \u0628\u062E\u0634 "\u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC" \u06CC\u0627 "Location" \u0631\u0627 \u067E\u06CC\u062F\u0627 \u06A9\u0646\u06CC\u062F', /* @__PURE__ */ React.createElement("br", null), "\u06F3. GPS \u0631\u0627 \u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F") : /* @__PURE__ */ React.createElement(Typography19, null, "\u062E\u0637\u0627\u06CC\u06CC \u062F\u0631 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u06A9\u0627\u0646\u06CC \u0631\u062E \u062F\u0627\u062F\u0647 \u0627\u0633\u062A. \u0644\u0637\u0641\u0627\u064B \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06CC\u062F:", /* @__PURE__ */ React.createElement("br", null), "\u06F1. GPS \u062F\u0633\u062A\u06AF\u0627\u0647 \u0631\u0648\u0634\u0646 \u0627\u0633\u062A", /* @__PURE__ */ React.createElement("br", null), "\u06F2. \u0628\u0647 \u0627\u06CC\u0646\u062A\u0631\u0646\u062A \u0645\u062A\u0635\u0644 \u0647\u0633\u062A\u06CC\u062F", /* @__PURE__ */ React.createElement("br", null), "\u06F3. \u0645\u0631\u0648\u0631\u06AF\u0631 \u0627\u062C\u0627\u0632\u0647 \u062F\u0633\u062A\u0631\u0633\u06CC \u062F\u0627\u0631\u062F")),
6506
+ /* @__PURE__ */ React.createElement(DialogActions5, { sx: { pb: 2, pr: 2 } }, /* @__PURE__ */ React.createElement(Button15, { onClick: handleGpsDialogClose }, "\u0627\u0646\u0635\u0631\u0627\u0641"), gpsErrorType === "permission" ? /* @__PURE__ */ React.createElement(
6507
+ Button15,
6508
+ {
6509
+ onClick: handleRetryLocation,
6510
+ variant: "contained",
6511
+ color: "primary"
6512
+ },
6513
+ "\u062A\u0644\u0627\u0634 \u0645\u062C\u062F\u062F"
6514
+ ) : /* @__PURE__ */ React.createElement(
6515
+ Button15,
6516
+ {
6517
+ onClick: handleOpenSettings,
6518
+ variant: "contained",
6519
+ color: "primary"
6520
+ },
6521
+ "\u0631\u0627\u0647\u0646\u0645\u0627\u06CC \u0641\u0639\u0627\u0644\u200C\u0633\u0627\u0632\u06CC"
6522
+ ))
6523
+ ), /* @__PURE__ */ React.createElement(Box27, { sx: { position: "relative", height: "370px", width: "100%" } }, /* @__PURE__ */ React.createElement(
6524
+ Paper2,
6525
+ {
6526
+ sx: {
6527
+ height: "100%",
6528
+ position: "relative",
6529
+ overflow: "hidden",
6530
+ borderRadius: 2,
6531
+ border: error ? 2 : 0,
6532
+ borderColor: error ? "error.main" : "transparent"
6533
+ }
6534
+ },
6535
+ (isMapLoading || isGeocoding || isGeolocating || isLoading) && /* @__PURE__ */ React.createElement(
6536
+ Box27,
6537
+ {
6538
+ sx: {
6539
+ position: "absolute",
6540
+ inset: 0,
6541
+ display: "flex",
6542
+ alignItems: "center",
6543
+ justifyContent: "center",
6544
+ backgroundColor: isDarkMode ? "rgba(18, 18, 18, 0.9)" : "rgba(255, 255, 255, 0.8)",
6545
+ zIndex: 1e3,
6546
+ flexDirection: "column",
6547
+ gap: 1
6548
+ }
6549
+ },
6550
+ /* @__PURE__ */ React.createElement(CircularProgress11, null),
6551
+ /* @__PURE__ */ React.createElement(Typography19, null, isMapLoading ? "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0646\u0642\u0634\u0647..." : isLoading ? "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0645\u0648\u0642\u0639\u06CC\u062A..." : isGeocoding ? "\u062F\u0631 \u062D\u0627\u0644 \u062F\u0631\u06CC\u0627\u0641\u062A \u0622\u062F\u0631\u0633..." : "\u062F\u0631 \u062D\u0627\u0644 \u062F\u0631\u06CC\u0627\u0641\u062A \u0645\u0648\u0642\u0639\u06CC\u062A \u0641\u0639\u0644\u06CC...")
6552
+ ),
6553
+ /* @__PURE__ */ React.createElement("div", { ref: mapRef, style: { height: "100%", width: "100%" } }),
6554
+ /* @__PURE__ */ React.createElement(
6555
+ Box27,
6556
+ {
6557
+ sx: {
6558
+ position: "absolute",
6559
+ bottom: 16,
6560
+ right: 16,
6561
+ display: "flex",
6562
+ flexDirection: "column",
6563
+ gap: 1,
6564
+ zIndex: 1e3
6565
+ }
6566
+ },
6567
+ /* @__PURE__ */ React.createElement(
6568
+ IconButton14,
6569
+ {
6570
+ onClick: handleCurrentLocation,
6571
+ disabled: isGeolocating,
6572
+ sx: {
6573
+ backgroundColor: isDarkMode ? "#1e1e1e" : "white",
6574
+ color: isDarkMode ? "white" : "inherit",
6575
+ boxShadow: 2,
6576
+ "&:hover": {
6577
+ backgroundColor: isDarkMode ? "#2a2a2a" : "#f5f5f5"
6578
+ }
6579
+ },
6580
+ title: "\u0645\u0648\u0642\u0639\u06CC\u062A \u0641\u0639\u0644\u06CC"
6581
+ },
6582
+ /* @__PURE__ */ React.createElement(MdMyLocation, null)
6583
+ ),
6584
+ (latitude !== null || longitude !== null) && /* @__PURE__ */ React.createElement(
6585
+ IconButton14,
6586
+ {
6587
+ onClick: handleClearLocation,
6588
+ sx: {
6589
+ backgroundColor: isDarkMode ? "#1e1e1e" : "white",
6590
+ color: theme3.palette.error.main,
6591
+ boxShadow: 2,
6592
+ "&:hover": {
6593
+ backgroundColor: isDarkMode ? "#2a2a2a" : "#f5f5f5"
6594
+ }
6595
+ },
6596
+ title: "\u067E\u0627\u06A9 \u06A9\u0631\u062F\u0646 \u0645\u0648\u0642\u0639\u06CC\u062A"
6597
+ },
6598
+ /* @__PURE__ */ React.createElement(MdOutlineClear2, null)
6599
+ )
6600
+ )
6601
+ )), /* @__PURE__ */ React.createElement(
6602
+ Box27,
6603
+ {
6604
+ sx: {
6605
+ mt: 1,
6606
+ p: 1.5,
6607
+ backgroundColor: isDarkMode ? "#1e1e1e" : "#f5f5f5",
6608
+ borderRadius: 1,
6609
+ display: "flex",
6610
+ justifyContent: "space-between",
6611
+ alignItems: "center"
6612
+ }
6613
+ },
6614
+ /* @__PURE__ */ React.createElement(Typography19, { variant: "body2", sx: { fontFamily: "monospace" } }, /* @__PURE__ */ React.createElement("strong", null, "\u0639\u0631\u0636 \u062C\u063A\u0631\u0627\u0641\u06CC\u0627\u06CC\u06CC:"), " ", typeof latitude === "number" ? latitude.toFixed(6) : "\u2014"),
6615
+ /* @__PURE__ */ React.createElement(Typography19, { variant: "body2", sx: { fontFamily: "monospace" } }, /* @__PURE__ */ React.createElement("strong", null, "\u0637\u0648\u0644 \u062C\u063A\u0631\u0627\u0641\u06CC\u0627\u06CC\u06CC:"), " ", typeof longitude === "number" ? longitude.toFixed(6) : "\u2014")
6616
+ ), error && helperText && /* @__PURE__ */ React.createElement(
6617
+ Typography19,
6618
+ {
6619
+ variant: "caption",
6620
+ sx: {
6621
+ color: "error.main",
6622
+ mt: 0.5,
6623
+ display: "block",
6624
+ px: 1.5
6625
+ }
6626
+ },
6627
+ helperText
6628
+ ));
6629
+ }
6166
6630
  export {
6167
6631
  Page as Accordion,
6168
6632
  AdvancedSearchButton,
@@ -6186,6 +6650,7 @@ export {
6186
6650
  HorizontalStepper,
6187
6651
  imgViewer as ImgViewer,
6188
6652
  LicensePlate,
6653
+ MapLocationPicker,
6189
6654
  mobile_date_time_picker_default as MobileDateTimePicker,
6190
6655
  ConfirmationDialog2 as Modal,
6191
6656
  selector_default as NestedSelectort,