{"version":3,"file":"index-DFLABROd.mjs","sources":["../../admin/src/utils/input.ts","../../admin/src/components/Input/Search.tsx","../../admin/src/components/Input/MapView.tsx","../../admin/src/components/Input/CoordsInput.tsx","../../admin/src/components/Input/index.tsx"],"sourcesContent":["import { Coordinates } from '../../../types';\n\n/**\n * Get the default coordinates from the field's attributes\n * @param attributes The fields's attributes object containing the advanced setting values\n * @returns Default coordinates if they are valid, otherwise null\n */\nexport const getDefaultCordsFromAttribute = ({\n    optionsDefaultLat,\n    optionsDefaultLng,\n}: {\n    optionsDefaultLat: string;\n    optionsDefaultLng: string;\n}): Coordinates | null => {\n    const defaultLat = Number(optionsDefaultLat);\n    const defaultLng = Number(optionsDefaultLng);\n\n    if (defaultLat && defaultLng && !isNaN(defaultLat) && !isNaN(defaultLng)) {\n        return { lat: defaultLat, lng: defaultLng };\n    }\n\n    return null;\n};\n\nexport const noPoint: Coordinates = {\n    lat: NaN,\n    lng: NaN,\n};\n\nexport const isValidPoint = (point: Coordinates): boolean => {\n    return !isNaN(point.lat) && !isNaN(point.lng);\n};\n\nexport const isSamePoint = (\n    point1: Coordinates,\n    point2: Coordinates\n): boolean => {\n    return point1.lat === point2.lat && point1.lng === point2.lng;\n};","import { StandaloneSearchBox } from '@react-google-maps/api';\nimport React, { useState } from 'react';\nimport { Coordinates, Place } from '../../../../types';\nimport { useIntl } from 'react-intl';\n\nexport default function Search({\n    userCoords,\n    currentAddress,\n    onPlaceSelected,\n    onAddressEdited,\n}: {\n    userCoords?: GeolocationCoordinates;\n    currentAddress: string;\n    onPlaceSelected: (place: Place) => void;\n    onAddressEdited: (address: string) => void;\n}) {\n    const { formatMessage } = useIntl();\n\n    const bounds = !!userCoords\n        ? new google.maps.LatLngBounds({\n            lat: userCoords.latitude,\n            lng: userCoords.longitude,\n        })\n        : undefined;\n\n    const [searchBox, setSearchBox] = useState<\n        google.maps.places.SearchBox | undefined\n    >();\n\n    const onPlacesChanged = () => {\n        const results: google.maps.places.PlaceResult[] | undefined =\n            searchBox?.getPlaces();\n\n        if (results && results.length) {\n            const place = results[0];\n\n            onPlaceSelected({\n                address: place.formatted_address || '',\n                coordinates: place.geometry?.location?.toJSON() as Coordinates,\n            });\n        }\n    };\n\n    return (\n        <StandaloneSearchBox\n            bounds={bounds}\n            onLoad={(ref) => setSearchBox(ref)}\n            onPlacesChanged={onPlacesChanged}\n        >\n            <input\n                type='text'\n                placeholder={formatMessage({\n                    id: 'google-maps.input.search.placeholder',\n                    defaultMessage: 'Search for a place',\n                })}\n                value={currentAddress}\n                onChange={(e) => onAddressEdited(e.target.value)}\n                style={{\n                    boxSizing: `border-box`,\n                    border: `1px solid transparent`,\n                    width: `300px`,\n                    height: `40px`,\n                    padding: `0 12px`,\n                    borderRadius: `3px`,\n                    boxShadow: `0 2px 6px rgba(0, 0, 0, 0.3)`,\n                    fontSize: `14px`,\n                    outline: `none`,\n                    textOverflow: `ellipses`,\n                    position: 'absolute',\n                    left: '50%',\n                    marginLeft: '-140px',\n                    marginTop: '10px',\n                }}\n            />\n        </StandaloneSearchBox>\n    );\n}","import React, { useEffect, useReducer, useState } from 'react';\nimport { Config, Coordinates, Place, SetPointAction } from '../../../../types';\nimport { GoogleMap, LoadScript } from '@react-google-maps/api';\nimport { Loader } from '@strapi/design-system';\nimport { useGeolocated } from 'react-geolocated';\nimport Search from './Search';\n\nconst fallbackCenter: Coordinates = {\n    lat: 51.51652494189269,\n    lng: 7.45560626859687,\n};\n\nconst libraries: 'places'[] = ['places'];\n\nexport default function MapView({\n    children,\n    config,\n    focusPoint,\n    currentAddress,\n    onCoordsChange,\n    onAddressChange,\n}: {\n    children: React.ReactNode;\n    config?: Config;\n    focusPoint?: Coordinates;\n    currentAddress: string;\n    onCoordsChange: (action: SetPointAction) => void;\n    onAddressChange: (address: string) => void;\n}) {\n    const [scriptLoaded, onScriptLoaded] = useReducer(() => true, false);\n\n    const [center, setCenter] = useState<Coordinates>(fallbackCenter);\n\n    const { coords: userCoords }: { coords?: GeolocationCoordinates } =\n        useGeolocated({\n            positionOptions: {\n                enableHighAccuracy: false,\n            },\n        });\n\n    useEffect(() => {\n        if (focusPoint) {\n            setCenter(focusPoint);\n        } else if (userCoords) {\n            setCenter({\n                lat: userCoords.latitude,\n                lng: userCoords.longitude,\n            });\n        } else {\n            setCenter(fallbackCenter);\n        }\n    }, [focusPoint, userCoords]);\n\n    const onPlaceSelected = (place: Place) => {\n        onCoordsChange({ origin: 'placeSearch', value: place.coordinates });\n        onAddressChange(place.address);\n    };\n\n    return (\n        <>\n            {!!config && (\n                <LoadScript\n                    googleMapsApiKey={config.googleMapsKey}\n                    libraries={libraries} // allow the use of places api for searchbox\n                    onLoad={onScriptLoaded}\n                />\n            )}\n\n            {scriptLoaded ? (\n                <GoogleMap\n                    mapContainerStyle={{\n                        width: '100%',\n                        height: '400px',\n                    }}\n                    center={center}\n                    zoom={20}\n                    onClick={({ latLng }) =>\n                        onCoordsChange({\n                            origin: 'map',\n                            value: latLng?.toJSON() as Coordinates,\n                        })\n                    }\n                >\n                    <Search\n                        userCoords={userCoords}\n                        currentAddress={currentAddress}\n                        onPlaceSelected={onPlaceSelected}\n                        onAddressEdited={onAddressChange}\n                    />\n\n                    {children}\n                </GoogleMap>\n            ) : (\n                <div style={{ display: 'flex', justifyContent: 'center' }}>\n                    <Loader small />\n                </div>\n            )}\n        </>\n    );\n}","import React, { useEffect } from 'react';\nimport { Grid, TextInput } from '@strapi/design-system';\nimport { Coordinates } from '../../../../types';\n\nfunction generateId(len: number) {\n    function dec2hex(dec: number) {\n        return dec.toString(16).padStart(2, '0');\n    }\n\n    var arr = new Uint8Array((len || 40) / 2);\n    window.crypto.getRandomValues(arr);\n    return Array.from(arr, dec2hex).join('');\n}\n\nexport default function NumberFields({\n    coords,\n    onChange,\n}: {\n    coords: Coordinates;\n    onChange: (coords: Coordinates) => void;\n}) {\n    const windowInputValueDescriptor = Object.getOwnPropertyDescriptor(\n        window.HTMLInputElement.prototype,\n        'value'\n    );\n    if (!windowInputValueDescriptor) return null;\n\n    const latInputId = generateId(10);\n    const lngInputId = generateId(10);\n\n    const { lat, lng } = coords;\n\n    useEffect(() => {\n        const latInput = document.getElementById(latInputId) as HTMLInputElement;\n        const lngInput = document.getElementById(lngInputId) as HTMLInputElement;\n\n        const setInputValueNatively = (input: HTMLInputElement, value: number) =>\n            windowInputValueDescriptor.set!.call(input, isNaN(value) ? null : value);\n\n        setInputValueNatively(latInput, lat);\n        setInputValueNatively(lngInput, lng);\n\n        /* This will trigger a new render for the component */\n        const changeEvent = new Event('change', { bubbles: true });\n        latInput.dispatchEvent(changeEvent);\n        lngInput.dispatchEvent(changeEvent);\n    }, [lat, lng]);\n\n    return (\n        <Grid.Root gap={3}>\n            <Grid.Item col={6}>\n                <TextInput\n                    id={latInputId}\n                    placeholder='Latitude'\n                    aria-label='Latitude'\n                    hint='Latitude'\n                    name='latitude'\n                    onChange={(e: any) => {\n                        if (!e.target.value) return;\n                        onChange({ lat: Number(e.target.value), lng });\n                    }}\n                    size='S'\n                />\n            </Grid.Item>\n\n            <Grid.Item col={6}>\n                <TextInput\n                    id={lngInputId}\n                    placeholder='Longtitude'\n                    aria-label='Longtitude'\n                    hint='Longtitude'\n                    name='longtitude'\n                    onChange={(e: any) => {\n                        if (!e.target.value) return;\n                        onChange({ lat, lng: Number(e.target.value) });\n                    }}\n                    size='S'\n                />\n            </Grid.Item>\n        </Grid.Root>\n    );\n}","import React, { useEffect, useReducer, useState } from 'react';\nimport { Box, Typography, Loader, Button } from '@strapi/design-system';\nimport { Coordinates, Location } from '../../../../types';\nimport { isSamePoint, isValidPoint, noPoint } from '../../utils/input';\nimport { useIntl } from 'react-intl';\nimport useConfig from '../../hooks/useConfig';\nimport { Marker } from '@react-google-maps/api';\nimport { ArrowClockwise } from '@strapi/icons';\nimport Geohash from 'latlon-geohash';\nimport MapView from './MapView';\nimport NumberFields from './CoordsInput';\nimport { useAuth } from '@strapi/strapi/admin';\n\nexport default function Input(data: any) {\n\n    console.log('data', data)\n\n\n    const { formatMessage } = useIntl();\n\n    const token = useAuth('ConfigurationProvider', (state) => state.token);\n\n    const config = useConfig();\n\n    const [focusPoint, setFocusPoint] = useState<Coordinates | undefined>();\n\n    const [currentPoint, setCurrentPoint] = useReducer(\n        (state: Coordinates, action: any) => {\n            const { origin, value } = action;\n\n            if (\n                (origin === 'coordsInput' ||\n                    origin === 'placeSearch' ||\n                    origin === 'fieldValue') &&\n                isValidPoint(value) &&\n                !isSamePoint(state, value)\n            ) {\n                setFocusPoint(value);\n            }\n\n            return value;\n        },\n        noPoint\n    );\n\n    const [currentAddress, setCurrentAddress] = useState('');\n\n    const [nothingSelectedWarning, setNothingSelectedWarning] = useState(false);\n\n    useEffect(() => {\n        if (data.required && !isValidPoint(currentPoint)) {\n            setNothingSelectedWarning(true);\n        } else if (nothingSelectedWarning) {\n            setNothingSelectedWarning(false);\n        }\n    }, [currentPoint]);\n\n    useEffect(() => {\n        const newValue: string | null = isValidPoint(currentPoint)\n            ? JSON.stringify({\n                address: currentAddress,\n                coordinates: currentPoint,\n                geohash: Geohash.encode(currentPoint.lat, currentPoint.lng),\n            })\n            : null;\n\n        data.onChange({\n            target: {\n                name,\n                value: newValue,\n                type: data.attribute.type, // json\n            },\n        });\n    }, [currentPoint, currentAddress]);\n\n    useEffect(() => {\n        if (!data.value) return;\n\n        let parsedValue: Location = data.value;\n\n        if (typeof data.value === 'string') {\n            parsedValue = JSON.parse(data.value);\n        }\n\n        if (!parsedValue) return;\n\n        const { address, coordinates } = parsedValue;\n\n        if (address === currentAddress && isSamePoint(currentPoint, coordinates))\n            return;\n\n        setCurrentPoint({ origin: 'fieldValue', value: coordinates });\n        setCurrentAddress(address);\n    }, [data.value]);\n\n    const onReset = () => {\n        setCurrentPoint({ origin: 'reset', value: noPoint });\n\n        setCurrentAddress('');\n    };\n\n    return (\n        <>\n            <Typography variant='pi' fontWeight='bold'>\n                {formatMessage({\n                    id: 'input.label',\n                })}\n            </Typography>\n\n            {!config && (\n                <div style={{ display: 'flex', justifyContent: 'center' }}>\n                    <Loader small />\n                </div>\n            )}\n\n            {!!config && (\n                <>\n                    <Box\n                        marginTop={1}\n                        borderColor={nothingSelectedWarning ? 'danger600' : 'primary200'}\n                    >\n                        <MapView\n                            config={config}\n                            focusPoint={focusPoint}\n                            currentAddress={currentAddress}\n                            onCoordsChange={setCurrentPoint}\n                            onAddressChange={setCurrentAddress}\n                        >\n                            {isValidPoint(currentPoint) && <Marker position={currentPoint} />}\n                        </MapView>\n                    </Box>\n\n                    {nothingSelectedWarning && (\n                        <Box paddingTop={1}>\n                            <Typography variant='pi' textColor='danger600'>\n                                {formatMessage({\n                                    id: 'input.error.required',\n                                })}\n                            </Typography>\n                        </Box>\n                    )}\n\n                    <Box paddingTop={2}>\n                        <NumberFields\n                            coords={currentPoint}\n                            onChange={(point) =>\n                                setCurrentPoint({ origin: 'coordsInput', value: point })\n                            }\n                        />\n                    </Box>\n\n                    <Box paddingTop={2}>\n                        <Button startIcon={<ArrowClockwise />} onClick={onReset}>\n                            {formatMessage({\n                                id: 'input.button.reset',\n                            })}\n                        </Button>\n                    </Box>\n                </>\n            )}\n        </>\n    );\n}"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,UAAuB;AAAA,EAChC,KAAK;AAAA,EACL,KAAK;AACT;AAEa,MAAA,eAAe,CAAC,UAAgC;AAClD,SAAA,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,MAAM,GAAG;AAChD;AAEa,MAAA,cAAc,CACvB,QACA,WACU;AACV,SAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,QAAQ,OAAO;AAC9D;ACjCA,SAAwB,OAAO;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAKG;AACO,QAAA,EAAE,cAAc,IAAI,QAAQ;AAElC,QAAM,SAAS,CAAC,CAAC,aACX,IAAI,OAAO,KAAK,aAAa;AAAA,IAC3B,KAAK,WAAW;AAAA,IAChB,KAAK,WAAW;AAAA,EACnB,CAAA,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