/*!
 * Copyright (c) what3words http://what3words.com
 */
const SELECTORS = {
    input: "input",
    script: 'script[src*="/what3words.js?"],script[src*="/what3words.esm.js?"]',
};
var ScriptInitParameter;
(function (ScriptInitParameter) {
    ScriptInitParameter["KEY"] = "key";
    ScriptInitParameter["BASEURL"] = "baseUrl";
    ScriptInitParameter["VERSION"] = "version";
    ScriptInitParameter["CALLBACK"] = "callback";
    ScriptInitParameter["HEADERS"] = "headers";
})(ScriptInitParameter || (ScriptInitParameter = {}));
const ScriptInitParameters = [
    ScriptInitParameter.KEY,
    ScriptInitParameter.BASEURL,
    ScriptInitParameter.CALLBACK,
    ScriptInitParameter.HEADERS,
];
var Variant;
(function (Variant) {
    Variant["DEFAULT"] = "default";
    Variant["INHERIT"] = "inherit";
})(Variant || (Variant = {}));
const DEFAULTS = {
    emptyString: "",
    null: null,
    true: true,
    false: false,
    name: "what3words_3wa",
    prefix: "///",
    threeWordAddress: "lock.spout.radar",
    variant: Variant.DEFAULT,
    typeaheadDelay: 300, // number of milliseconds to wait after user has finished typing
    iconSize: 17,
    iconColor: "#e11f26",
    textColor: "#0a3049",
    addressSize: 24,
    symbolSize: 28,
    serviceErrorMessage: "An error occurred while contacting external servers. Please try again.",
    // API Configuration
    headers: "{}",
    base_url: "https://api.what3words.com",
    // Autosuggest result filters / clippings
    language: "en",
    returnCoordinates: false,
    options: [],
    target: "_blank",
    tooltipLocation: "entrance of the building",
    // Map provider configuration
    bounds: {
        south: 0,
        west: 0,
        north: 0,
        east: 0,
    },
    center: {
        // default set to w3w HQ - https://www.google.com/maps?q=51.520847,-0.195521
        lat: 51.520847,
        lng: -0.195521,
    },
};
const W3W_REGEX = /(?:\/\/\/|(?:http(?:s)?:\/\/).?(?:www\.)?(?:what3words|w3w)?\.\D+\/)?(\/{0,}(?:[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+[.｡。･・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+[.｡。･・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+|[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3}[.｡。･・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3}[.｡。･・︒។։။۔።।][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]+){1,3}))/i;
const W3W_TEXTAREA_REGEX = /(?:\/\/\/|(?:http(?:s)?:\/\/)?(?:www\.)?(?:what3words|w3w)?\.\D+\/)?(\/{0,}[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[・.。][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[・.。][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,})/gi;
const SESSION_ID_KEY = "component-session";
const MAP_SCRIPT_ID = "gmaps-api";
const RETRIES = 3;
const MAP_SELECTOR = "div[slot=map]";
const SEARCH_CONTROL_SELECTOR = "[slot=search-control]";
const MAP_TYPE_CONTROL_SELECTOR = "[slot=map-type-control]";
const ZOOM_CONTROL_SELECTOR = "[slot=zoom-control]";
const CURRENT_LOCATION_CONTROL_SELECTOR = "[slot=current-location-control]";
const AUTOSUGGEST_SELECTOR = "what3words-autosuggest";
const TOP_LEFT = 1;
const SELECTED_ZOOM_LEVEL = 19;
const MIN_GRID_ZOOM_LEVEL = 18;
const MARKER_SRC = "https://what3words.com/map/marker.png";
const PHRASE_PARAMETER_PLACEHOLDER = "${PARAM}";
const W3W_TEXTAREA_PROPERTIES = [
    "boxSizing",
    "width",
    "height",
    "overflowX",
    "overflowY",
    "borderWidth",
    "borderStyle",
    "borderColor",
    "padding",
    "margin",
    "fontFamily",
    "fontStyle",
    "fontVariant",
    "fontWeight",
    "fontStretch",
    "fontSize",
    "fontSizeAdjust",
    "lineHeight",
    "textAlign",
    "textTransform",
    "textIndent",
    "textDecoration",
    "letterSpacing",
    "wordSpacing",
    "direction",
];

export { AUTOSUGGEST_SELECTOR as A, CURRENT_LOCATION_CONTROL_SELECTOR as C, DEFAULTS as D, MAP_SCRIPT_ID as M, PHRASE_PARAMETER_PLACEHOLDER as P, RETRIES as R, ScriptInitParameter as S, TOP_LEFT as T, W3W_REGEX as W, ZOOM_CONTROL_SELECTOR as Z, SESSION_ID_KEY as a, SELECTORS as b, MIN_GRID_ZOOM_LEVEL as c, MARKER_SRC as d, SELECTED_ZOOM_LEVEL as e, SEARCH_CONTROL_SELECTOR as f, MAP_TYPE_CONTROL_SELECTOR as g, MAP_SELECTOR as h, W3W_TEXTAREA_REGEX as i, W3W_TEXTAREA_PROPERTIES as j, ScriptInitParameters as k };
