Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/location/core/dist/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/location/core/dist/core.bundle.js.map |
{"version":3,"file":"core.bundle.js","sources":["../src/entity/generic/field.js","../src/entity/generic/fieldcollection.js","../src/entity/address/addressfield.js","../src/entity/address/addressfieldcollection.js","../src/entity/address/addresslink.js","../src/entity/address/addresslinkcollection.js","../src/entity/format/formatfield.js","../src/entity/format/formatfieldcollection.js","../src/entity/location/locationtype.js","../src/entity/address/addresstype.js","../src/entity/format/formattemplate.js","../src/entity/format/formattemplatecollection.js","../src/entity/format/formattemplatetype.js","../src/entity/format.js","../src/entity/address/converter/stringtemplateconverter.js","../src/entity/address/converter/stringconverter.js","../src/entity/address/converter/jsonconverter.js","../src/entity/address.js","../src/entity/location/locationfield.js","../src/entity/location/locationfieldcollection.js","../src/entity/location/locationobjectconverter.js","../src/entity/location/locationjsonconverter.js","../src/entity/location.js","../src/repository/actionrunner.js","../src/repository/baserepository.js","../src/repository/locationrepository.js","../src/repository/addressrepository.js","../src/repository/formatrepository.js","../src/repository/sourcerepository.js","../src/base/autocompleteservicebase.js","../src/common/autocomplete-cache.js","../src/base/photoservicebase.js","../src/base/mapbase.js","../src/base/sourcebase.js","../src/base/geocodingservicebase.js","../src/common/controlmode.js","../src/entity/location/locationfieldtype.js","../src/common/error.js","../src/common/errorpublisher.js","../src/common/storage.js","../src/common/point.js","../src/common/distancecalculator.js"],"sourcesContent":["export default class Field\n{\n\t#type;\n\n\tconstructor(props)\n\t{\n\t\tif(typeof props.type === 'undefined')\n\t\t{\n\t\t\tthrow new Error('Field type must be defined');\n\t\t}\n\n\t\tthis.#type = parseInt(props.type);\n\t}\n\n\tget type()\n\t{\n\t\treturn this.#type;\n\t}\n}","import Field from './field';\n\nexport default class FieldCollection\n{\n\t#fields = {};\n\n\tconstructor(props = {})\n\t{\n\t\tthis.fields = props.fields ? props.fields : [];\n\t}\n\n\tset fields(fields)\n\t{\n\t\tif(!Array.isArray(fields))\n\t\t{\n\t\t\tthrow new Error('Items must be array!');\n\t\t}\n\n\t\tfor(const field of fields)\n\t\t{\n\t\t\tthis.setField(field);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tget fields()\n\t{\n\t\treturn this.#fields;\n\t}\n\n\t/**\n\t * Checks if field already exist in collection\n\t * @param {int} type\n\t * @returns {boolean}\n\t */\n\tisFieldExists(type)\n\t{\n\t\treturn typeof this.#fields[type] !== 'undefined';\n\t}\n\n\tgetField(type)\n\t{\n\t\treturn this.isFieldExists(type) ? this.#fields[type] : null;\n\t}\n\n\tsetField(field)\n\t{\n\t\tif(!(field instanceof Field))\n\t\t{\n\t\t\tthrow new Error('Argument field must be instance of Field!');\n\t\t}\n\n\t\tthis.#fields[field.type] = field;\n\t\treturn this;\n\t}\n\n\tdeleteField(type)\n\t{\n\t\tif(this.isFieldExists(type))\n\t\t{\n\t\t\tdelete this.#fields[type];\n\t\t}\n\t}\n\n\tgetMaxFieldType()\n\t{\n\t\tconst types = Object.keys(this.#fields).sort((a, b) => {\n\t\t\treturn parseInt(a) - parseInt(b);\n\t\t});\n\n\t\tlet result = 0;\n\n\t\tif(types.length > 0)\n\t\t{\n\t\t\tresult = types[types.length - 1];\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tisEqual(addressFieldCollection: FieldCollection, upTo: Number)\n\t{\n\t\treturn (\n\t\t\tFieldCollection.areEqual(this, addressFieldCollection, upTo)\n\t\t\t&& FieldCollection.areEqual(addressFieldCollection, this, upTo)\n\t\t);\n\t}\n\n\tstatic areEqual(addressFieldCollection1: FieldCollection, addressFieldCollection2: FieldCollection, upTo: Number)\n\t{\n\t\tfor (let type in addressFieldCollection1.fields)\n\t\t{\n\t\t\tif (type > upTo)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet field = addressFieldCollection2.getField(type);\n\t\t\tif (!field)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (addressFieldCollection1.fields[type].value !== field.value)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n","import Field from \"../generic/field\";\n\nexport default class AddressField extends Field\n{\n\t#value;\n\n\t//todo: Fields validation\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\t\tthis.#value = props.value || '';\n\t}\n\n\tget value()\n\t{\n\t\treturn this.#value;\n\t}\n\n\tset value(value)\n\t{\n\t\tthis.#value = value;\n\t\treturn this;\n\t}\n}","import FieldCollection from '../generic/fieldcollection';\nimport AddressField from './addressfield';\n\nexport default class AddressFieldCollection extends FieldCollection\n{\n\tgetFieldValue(type)\n\t{\n\t\tlet result = null;\n\n\t\tif(this.isFieldExists(type))\n\t\t{\n\t\t\tconst field = this.getField(type);\n\n\t\t\tif(field)\n\t\t\t{\n\t\t\t\tresult = field.value;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetFieldValue(type, value)\n\t{\n\t\tthis.setField(\n\t\t\tnew AddressField({type, value})\n\t\t);\n\n\t\treturn this;\n\t}\n}","export default class AddressLink\n{\n\t#entityId;\n\t#entityType;\n\n\tconstructor(props)\n\t{\n\t\tthis.#entityId = props.entityId;\n\t\tthis.#entityType = props.entityType;\n\t}\n\n\tget entityId()\n\t{\n\t\treturn this.#entityId;\n\t}\n\n\tget entityType()\n\t{\n\t\treturn this.#entityType\n\t}\n}","import AddressLink from \"./addresslink\";\n\nexport default class AddressLinkCollection\n{\n\t#links = [];\n\n\tconstructor(props = {})\n\t{\n\t\tthis.links = !!props.links ? props.links : [];\n\t}\n\n\tset links(links: Array): void\n\t{\n\t\tif(!Array.isArray(links))\n\t\t{\n\t\t\tthrow new Error('links must be array!');\n\t\t}\n\n\t\tfor(let link of links)\n\t\t{\n\t\t\tthis.addLink(link);\n\t\t}\n\t}\n\n\tget links()\n\t{\n\t\treturn this.#links;\n\t}\n\n\taddLink(link: AddressLink)\n\t{\n\t\tif(!(link instanceof AddressLink))\n\t\t{\n\t\t\tthrow new Error('Argument link must be instance of Field!');\n\t\t}\n\n\t\tthis.#links.push(link);\n\t}\n\n\tclearLinks()\n\t{\n\t\tthis.#links = [];\n\t}\n}","import Field from '../generic/field';\n\nexport default class FormatField extends Field\n{\n\t#sort;\n\t#name;\n\t#description;\n\n\t// todo: Fields validation\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\n\t\tthis.#sort = parseInt(props.sort);\n\t\tthis.#name = props.name || '';\n\t\tthis.#description = props.description || '';\n\t}\n\n\tget sort()\n\t{\n\t\treturn this.#sort;\n\t}\n\n\tset sort(sort)\n\t{\n\t\tthis.#sort = sort;\n\t}\n\n\tget name()\n\t{\n\t\treturn this.#name;\n\t}\n\n\tset name(name)\n\t{\n\t\tthis.#name = name;\n\t}\n\n\tget description()\n\t{\n\t\treturn this.#description;\n\t}\n\n\tset description(description)\n\t{\n\t\tthis.#description = description;\n\t}\n}","import FieldCollection from '../generic/fieldcollection';\nimport FormatField from './formatfield';\n\nexport default class FormatFieldCollection extends FieldCollection\n{\n\tinitFields(fieldsData)\n\t{\n\t\tif(Array.isArray(fieldsData))\n\t\t{\n\t\t\tfieldsData.forEach((data) => {\n\n\t\t\t\tconst field = new FormatField(data);\n\n\t\t\t\tif(field)\n\t\t\t\t{\n\t\t\t\t\tthis.setField(field);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}","export default class LocationType\n{\n\tstatic UNKNOWN = 0;\n\n\tstatic COUNTRY = 100;\n\n\tstatic ADM_LEVEL_1 = 200;\n\tstatic ADM_LEVEL_2 = 210;\n\tstatic ADM_LEVEL_3 = 220;\n\tstatic ADM_LEVEL_4 = 230;\n\n\tstatic LOCALITY = 300;\n\tstatic SUB_LOCALITY = 310;\n\tstatic SUB_LOCALITY_LEVEL_1 = 320;\n\tstatic SUB_LOCALITY_LEVEL_2 = 330;\n\tstatic STREET = 340;\n\n\tstatic BUILDING = 400;\n\tstatic ADDRESS_LINE_1 = 410;\n\n\tstatic FLOOR = 420;\n\tstatic ROOM = 430;\n\n\tstatic TMP_TYPE_HINT = 5010;\n\tstatic TMP_TYPE_CLARIFICATION = 5020;\n}\n","import LocationType from '../location/locationtype';\n\nexport default class AddressType extends LocationType\n{\n\tstatic POSTAL_CODE = 50;\n\n\tstatic ADDRESS_LINE_2 = 600;\n\tstatic RECIPIENT_COMPANY = 700;\n\tstatic RECIPIENT = 710;\n\tstatic PO_BOX = 800;\n}","export default class FormatTemplate\n{\n\ttype;\n\ttemplate;\n\n\tconstructor(type: string, template: string)\n\t{\n\t\tthis.type = type;\n\t\tthis.template = template;\n\t}\n}","import FormatTemplate from './formattemplate';\n\nexport default class FormatTemplateCollection\n{\n\t#templates = {};\n\n\tconstructor(templateData: {})\n\t{\n\t\tfor (const type in templateData)\n\t\t{\n\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\tif (templateData.hasOwnProperty(type))\n\t\t\t{\n\t\t\t\tthis.setTemplate(\n\t\t\t\t\tnew FormatTemplate(type, templateData[type])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tisTemplateExists(type: string): boolean\n\t{\n\t\treturn typeof this.#templates[type] !== 'undefined';\n\t}\n\n\tgetTemplate(type: string): string\n\t{\n\t\treturn this.isTemplateExists(type) ? this.#templates[type] : null;\n\t}\n\n\tsetTemplate(template: FormatTemplate)\n\t{\n\t\tif (!(template instanceof FormatTemplate))\n\t\t{\n\t\t\tthrow new Error('Argument template must be instance of FormatTemplate!');\n\t\t}\n\n\t\tthis.#templates[template.type] = template;\n\t}\n}","/**\n * Template types\n */\nexport default class FormatTemplateType\n{\n\t// Default template\n\tstatic DEFAULT = 'DEFAULT';\n\n\t// Template for autocomplete\n\tstatic AUTOCOMPLETE = 'AUTOCOMPLETE';\n\n\t// Template for field ADDRESS_LINE_1\n\tstatic ADDRESS_LINE_1 = 'ADDRESS_LINE_1';\n}","import {Type} from 'main.core';\nimport FormatFieldCollection from './format/formatfieldcollection';\nimport AddressType from './address/addresstype';\nimport FormatTemplateCollection from './format/formattemplatecollection';\nimport FormatTemplate from './format/formattemplate';\nimport FormatTemplateType from './format/formattemplatetype';\n\n/**\n * Class defines how the Address will look like\n */\nexport default class Format\n{\n\tcode;\n\tname;\n\tdescription;\n\tlanguageId;\n\ttemplateCollection;\n\tfieldCollection;\n\tdelimiter;\n\tfieldForUnRecognized;\n\n\tconstructor(props)\n\t{\n\t\tif (Type.isUndefined(props.languageId))\n\t\t{\n\t\t\tthrow new TypeError('LanguageId must be defined');\n\t\t}\n\n\t\tthis.languageId = props.languageId;\n\t\tthis.code = props.code || '';\n\t\tthis.name = props.name || '';\n\t\tthis.templateAutocomplete = props.templateAutocomplete || '';\n\t\tthis.templateAddressLine1 = props.templateAddressLine1 || '';\n\t\tthis.description = props.description || '';\n\t\tthis.delimiter = props.delimiter || ', ';\n\t\tthis.fieldForUnRecognized = props.fieldForUnRecognized || AddressType.UNKNOWN;\n\n\t\tthis.fieldCollection = new FormatFieldCollection();\n\n\t\tif (Type.isObject(props.fieldCollection))\n\t\t{\n\t\t\tthis.fieldCollection.initFields(props.fieldCollection);\n\t\t}\n\n\t\tlet collection = {};\n\n\t\tif (Type.isObject(props.templateCollection))\n\t\t{\n\t\t\tcollection = props.templateCollection;\n\t\t}\n\n\t\tthis.templateCollection = new FormatTemplateCollection(collection);\n\n\n\t}\n\n\tgetField(type)\n\t{\n\t\treturn this.fieldCollection.getField(type);\n\t}\n\n\tisFieldExists(type)\n\t{\n\t\treturn this.fieldCollection.isFieldExists(type);\n\t}\n\n\tgetTemplate(type: string = FormatTemplateType.DEFAULT): FormatTemplate\n\t{\n\t\treturn this.templateCollection.getTemplate(type);\n\t}\n\n\tisTemplateExists(type: string): boolean\n\t{\n\t\treturn this.templateCollection.isTemplateExists(type);\n\t}\n\n\tget template(): FormatTemplate\n\t{\n\t\treturn this.templateCollection.getTemplate();\n\t}\n}","import {Type, Text} from \"main.core\";\nimport Address from \"../../address\";\nimport AddressType from '../addresstype';\nimport Format from \"../../format\";\n\nconst STR_DELIMITER_PLACEHOLDER = \"#S#\";\nconst REGEX_COMMA_AMONG_EMPTY_SPACE = \"\\\\s*,\\\\s*\";\nconst REGEX_GROUP_DELIMITER = \"(\\\\\\\"([^\\\"\\\\\\\\]*|\\\\\\\\\\\"|\\\\\\\\\\\\\\\\|\\\\\\\\)*\\\")\";\nconst REGEX_GROUP_FIELD_TEXT = REGEX_GROUP_DELIMITER;\nconst REGEX_GROUP_FIELD_NAME = \"([a-zA-Z][a-zA-Z_0-9]*(:(NU|UN|N|U))?)\";\nconst REGEX_GROUP_FIELD_LIST_END = \"\\\\s*\\\\]\";\nconst REGEX_GROUP_END = REGEX_GROUP_FIELD_LIST_END;\nconst REGEX_PART_FROM_DELIMITER_TO_FIELD_LIST = \"\\\\s*,\\\\s*\\\\[\\\\s*\";\nconst REGEX_GROUP_PART_BEFORE_FIELDS =\n\t\"(([^\\\\[\\\\\\\\]|\\\\\\\\\\\\[|\\\\\\\\\\\\\\\\)*)(\\\\[\\\\s*)(\\\"([^\\\"\\\\\\\\]*|\\\\\\\\\\\"|\\\\\\\\\\\\\\\\|\\\\\\\\)*\\\")\\\\s*,\\\\s*\\\\[\\\\s*\";\n\nconst ERR_PARSE_GROUP_START_POSITION = 1100;\nconst ERR_PARSE_GROUP_START = 1110;\nconst ERR_PARSE_GROUP_DELIMITER = 1120;\nconst ERR_PARSE_PART_FROM_DELIMITER_TO_FIELD_LIST = 1130;\nconst ERR_PARSE_GROUP_FIELD_TEXT = 1140;\nconst ERR_PARSE_GROUP_FIELD_NAME = 1150;\nconst ERR_PARSE_GROUP_FIELD = 1160;\nconst ERR_PARSE_GROUP_FIELD_LIST = 1170;\nconst ERR_PARSE_GROUP_FIELD_LIST_DELIMITER = 1180;\nconst ERR_PARSE_GROUP_FIELD_LIST_END = 1190;\nconst ERR_PARSE_GROUP_END = 1200;\nconst ERR_PARSE_GROUP = 1210;\n\n\nexport default class StringTemplateConverter\n{\n\t#template = \"\";\n\t#delimiter = \"\";\n\t#htmlEncode = false;\n\t#format = null;\n\n\tconstructor(template: string, delimiter: string, htmlEncode: boolean, format: Format = null)\n\t{\n\t\tthis.#template = template;\n\t\tthis.#delimiter = delimiter;\n\t\tthis.#htmlEncode = htmlEncode;\n\t\tthis.#format = format;\n\t}\n\n\tgetErrorCodes()\n\t{\n\t\tlet result = {};\n\n\t\tresult[ERR_PARSE_GROUP_START_POSITION] = \"ERR_PARSE_GROUP_START_POSITION\";\n\t\tresult[ERR_PARSE_GROUP_START] = \"ERR_PARSE_GROUP_START\";\n\t\tresult[ERR_PARSE_GROUP_DELIMITER] = \"ERR_PARSE_GROUP_DELIMITER\";\n\t\tresult[ERR_PARSE_PART_FROM_DELIMITER_TO_FIELD_LIST] = \"ERR_PARSE_PART_FROM_DELIMITER_TO_FIELD_LIST\";\n\t\tresult[ERR_PARSE_GROUP_FIELD_TEXT] = \"ERR_PARSE_GROUP_FIELD_TEXT\";\n\t\tresult[ERR_PARSE_GROUP_FIELD_NAME] = \"ERR_PARSE_GROUP_FIELD_NAME\";\n\t\tresult[ERR_PARSE_GROUP_FIELD] = \"ERR_PARSE_GROUP_FIELD\";\n\t\tresult[ERR_PARSE_GROUP_FIELD_LIST] = \"ERR_PARSE_GROUP_FIELD_LIST\";\n\t\tresult[ERR_PARSE_GROUP_FIELD_LIST_DELIMITER] = \"ERR_PARSE_GROUP_FIELD_LIST_DELIMITER\";\n\t\tresult[ERR_PARSE_GROUP_FIELD_LIST_END] = \"ERR_PARSE_GROUP_FIELD_LIST_END\";\n\t\tresult[ERR_PARSE_GROUP_END] = \"ERR_PARSE_GROUP_END\";\n\t\tresult[ERR_PARSE_GROUP] = \"ERR_PARSE_GROUP\";\n\n\t\treturn result;\n\t}\n\t\n\tgetErrorsText(context: {}): string\n\t{\n\t\tlet result = \"\";\n\n\t\tconst errorCodes = this.getErrorCodes();\n\t\tconst errors = context[\"error\"][\"errors\"];\n\t\tfor (let i = 0; i < errors.length; i++)\n\t\t{\n\t\t\tresult += `Error: ${errors[i][\"position\"]}, ${errorCodes[errors[i][\"code\"]]}\\n`;\n\t\t\tif (errors[i].hasOwnProperty(\"info\") && Type.isPlainObject(errors[i][\"info\"]))\n\t\t\t{\n\t\t\t\tconst errorInfo = errors[i][\"info\"];\n\t\t\t\tlet needHeader = true;\n\t\t\t\tfor (let paramName in errorInfo)\n\t\t\t\t{\n\t\t\t\t\tif (errorInfo.hasOwnProperty(paramName))\n\t\t\t\t\t{\n\t\t\t\t\t\tlet paramValue = errorInfo[paramName];\n\t\t\t\t\t\tlet needPrint = false;\n\t\t\t\t\t\tif (Type.isString(paramValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparamValue = `\"${paramValue}\"`;\n\t\t\t\t\t\t\tneedPrint = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (Type.isNumber(paramValue) || Type.isFloat(paramValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tneedPrint = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (Type.isBoolean(paramValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparamValue = ((paramValue) ? \"true\" : \"false\");\n\t\t\t\t\t\t\tneedPrint = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (Type.isArray(paramValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparamValue = \"[...]\";\n\t\t\t\t\t\t\tneedPrint = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (Type.isObject(paramValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparamValue = '{...}';\n\t\t\t\t\t\t\tneedPrint = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (needPrint)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (needHeader)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tresult += \" Error info:\\n\";\n\t\t\t\t\t\t\t\tneedHeader = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult += ` ${paramName}: ${paramValue}\\n`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet templateValue = context[\"template\"].replace(\"\\n\", \"\\\\n\");\n\t\ttemplateValue = templateValue.replace(\"\\\"\", \"\\\\\\\"\");\n\t\tresult += `Template: \"${templateValue}\"\\n\\n`;\n\n\t\treturn result;\n\t}\n\n\tcreateContext()\n\t{\n\t\treturn {\n\t\t\t\"level\": 0,\n\t\t\t\"position\": 0,\n\t\t\t\"template\": \"\",\n\t\t\t\"address\": null,\n\t\t\t\"info\": {},\n\t\t\t\"hasError\": false,\n\t\t\t\"error\": {\n\t\t\t\t\"code\": 0,\n\t\t\t\t\"position\": 0,\n\t\t\t\t\"errors\": [],\n\t\t\t\t\"info\": {},\n\t\t\t},\n\t\t};\n\t}\n\n\tclearContextInfo(context)\n\t{\n\t\tcontext[\"info\"] = {};\n\n\t\treturn context;\n\t}\n\n\tclearContextError(context)\n\t{\n\t\tcontext[\"hasError\"] = false;\n\t\tcontext[\"error\"] = {\n\t\t\t\"code\": 0,\n\t\t\t\"position\": 0,\n\t\t\t\"errors\": [],\n\t\t\t\"info\": {},\n\t\t};\n\n\t\treturn context;\n\t}\n\n\tclearContextInfoAndError(context)\n\t{\n\t\treturn this.clearContextError(this.clearContextInfo(context));\n\t}\n\n\tunescapeText(text: string): string\n\t{\n\t\tlet result = \"\";\n\t\tlet i;\n\n\t\tfor (i = 0; i < text.length; i++)\n\t\t{\n\t\t\tif (text[i] === \"\\\\\")\n\t\t\t{\n\t\t\t\tif ((text.length - i) > 1)\n\t\t\t\t{\n\t\t\t\t\tresult += text[++i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult += text[i];\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tparseGroupDelimiter(context: {}): {}\n\t{\n\t\t// Capturing the group's separator\n\t\tconst delimiterStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^^\n\t\tconst regEx = new RegExp(REGEX_GROUP_DELIMITER, \"mg\");\n\t\tregEx.lastIndex = delimiterStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === delimiterStartPosition)\n\t\t{\n\t\t\tcontext[\"info\"] = {\n\t\t\t\t\"position\": delimiterStartPosition,\n\t\t\t\t\"end\": delimiterStartPosition + matches[0].length,\n\t\t\t\t\"value\": this.unescapeText(\n\t\t\t\t\tcontext[\"template\"].substr(\n\t\t\t\t\t\tdelimiterStartPosition + 1,\n\t\t\t\t\t\tmatches[0].length - 2\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t};\n\t\t\tcontext[\"position\"] = context[\"info\"][\"end\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_DELIMITER, delimiterStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseFieldText(context: {}): {}\n\t{\n\t\tconst textBlockStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^^^^\n\t\tconst regEx = new RegExp(REGEX_GROUP_FIELD_TEXT, \"mg\");\n\t\tregEx.lastIndex = textBlockStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === textBlockStartPosition)\n\t\t{\n\t\t\tcontext[\"info\"] = {\n\t\t\t\t\"type\": \"text\",\n\t\t\t\t\"position\": textBlockStartPosition,\n\t\t\t\t\"end\": textBlockStartPosition + matches[0].length,\n\t\t\t\t\"value\": this.unescapeText(\n\t\t\t\t\tcontext[\"template\"].substr(\n\t\t\t\t\t\ttextBlockStartPosition + 1,\n\t\t\t\t\t\tmatches[0].length - 2\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t};\n\t\t\tcontext[\"position\"] = context[\"info\"][\"end\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_FIELD_TEXT, textBlockStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tsplitFieldName(fieldName: string): []\n\t{\n\t\tconst parts = fieldName.split(\":\");\n\t\tconst namePart = parts[0];\n\t\tconst modifiersPart = (parts.length > 1) ? parts[1] : \"\";\n\n\t\treturn [namePart, modifiersPart];\n\t}\n\n\t#isTemplateForFieldExists(fieldName: string): boolean\n\t{\n\t\treturn this.#format && this.#format.getTemplate(fieldName) !== null;\n\t}\n\n\t#getFieldValueByTemplate(fieldName: string, address: Address): ?string\n\t{\n\t\tif (!this.#isTemplateForFieldExists(fieldName))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tconst template = this.#format.getTemplate(fieldName).template;\n\t\tconst templateConverter = new StringTemplateConverter(template, this.#delimiter, this.#htmlEncode, this.#format);\n\t\treturn templateConverter.convert(address);\n\t}\n\t\n\t#getAlterFieldValue(address: Address, fieldType: number): string\n\t{\n\t\tlet localityValue = address.getFieldValue(AddressType.LOCALITY);\n\t\tlocalityValue = Type.isString(localityValue) ? localityValue : \"\";\n\t\tlet result = address.getFieldValue(fieldType);\n\t\tif (!Type.isString(result))\n\t\t{\n\t\t\tresult = \"\";\n\t\t}\n\t\tif (result !== \"\" && localityValue !== \"\")\n\t\t{\n\t\t\tconst localityValueUpper = localityValue.toUpperCase();\n\t\t\tconst targetValueUpper = result.toUpperCase();\n\t\t\tif (targetValueUpper.length >= localityValueUpper.length)\n\t\t\t{\n\t\t\t\tconst targetValueSubstr = targetValueUpper.substr(\n\t\t\t\t\ttargetValueUpper.length - localityValueUpper.length\n\t\t\t\t);\n\t\t\t\tif (localityValueUpper === targetValueSubstr)\n\t\t\t\t{\n\t\t\t\t\tresult = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\t\n\tgetAddressFieldValue(address: Address, fieldName: string, fieldModifiers: string): string\n\t{\n\t\tlet result = \"\";\n\n\t\tif (!Type.isUndefined(AddressType[fieldName]))\n\t\t{\n\t\t\tif (fieldName === \"ADM_LEVEL_1\" || fieldName === \"ADM_LEVEL_2\")\n\t\t\t{\n\t\t\t\t// Scratch \"Province & Region by Locality\"\n\t\t\t\tresult = this.#getAlterFieldValue(address, AddressType[fieldName]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = address.getFieldValue(AddressType[fieldName]);\n\t\t\t}\n\n\t\t\tif (result === null)\n\t\t\t{\n\t\t\t\tresult = this.#getFieldValueByTemplate(fieldName, address);\n\t\t\t}\n\t\t}\n\t\tif (!Type.isString(result))\n\t\t{\n\t\t\tresult = \"\";\n\t\t}\n\t\tif (result !== \"\")\n\t\t{\n\t\t\tif (fieldModifiers.indexOf(\"N\") >= 0)\n\t\t\t{\n\t\t\t\tresult = result.replace(/(\\r\\n|\\n|\\r)/g, \"#S#\");\n\t\t\t}\n\t\t\tif (fieldModifiers.indexOf(\"U\") >= 0)\n\t\t\t{\n\t\t\t\tresult = result.toUpperCase();\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tparseFieldName(context: {}): {}\n\t{\n\t\tconst fieldNameStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^^^^^^^^^^^^^^\n\t\tconst regEx = new RegExp(REGEX_GROUP_FIELD_NAME, \"mg\");\n\t\tregEx.lastIndex = fieldNameStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === fieldNameStartPosition)\n\t\t{\n\t\t\tcontext[\"position\"] = fieldNameStartPosition + matches[0].length;\n\t\t\tconst fieldParts = this.splitFieldName(matches[0]);\n\t\t\tconst fieldName = fieldParts[0];\n\t\t\tconst fieldModifiers = fieldParts[1];\n\t\t\tconst fieldValue = this.getAddressFieldValue(context[\"address\"], fieldName, fieldModifiers);\n\t\t\tcontext[\"info\"] = {\n\t\t\t\t\"type\": \"field\",\n\t\t\t\t\"position\": fieldNameStartPosition,\n\t\t\t\t\"end\": context[\"position\"],\n\t\t\t\t\"modifiers\": fieldModifiers,\n\t\t\t\t\"name\": fieldName,\n\t\t\t\t\"value\": fieldValue,\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_FIELD_NAME, fieldNameStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseFieldListDelimiter(context: {}): {}\n\t{\n\t\tconst markerStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N , ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^\n\t\tconst regEx = new RegExp(REGEX_COMMA_AMONG_EMPTY_SPACE, \"mg\");\n\t\tregEx.lastIndex = markerStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === markerStartPosition)\n\t\t{\n\t\t\tcontext[\"position\"] = markerStartPosition + matches[0].length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_FIELD_LIST_DELIMITER, markerStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseFieldListEnd(context: {}): {}\n\t{\n\t\tconst markerStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^\n\t\tconst regEx = new RegExp(REGEX_GROUP_FIELD_LIST_END, \"mg\");\n\t\tregEx.lastIndex = markerStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === markerStartPosition)\n\t\t{\n\t\t\tcontext[\"position\"] = markerStartPosition + matches[0].length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_FIELD_LIST_END, markerStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseField(context: {}): {}\n\t{\n\t\tlet fieldInfo = [];\n\t\tconst fieldStartPosition = context[\"position\"];\n\t\tconst errors = [];\n\n\t\t// Checking for the presence of a text block\n\t\tcontext = this.parseFieldText(context);\n\n\t\tif (context[\"hasError\"])\n\t\t{\n\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\tcontext = this.clearContextInfoAndError(context);\n\t\t\t// Checking for the presence of a field name\n\t\t\tcontext = this.parseFieldName(context);\n\t\t}\n\n\t\tif (context[\"hasError\"])\n\t\t{\n\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\tcontext = this.clearContextInfoAndError(context);\n\t\t\t// Checking for the presence of a nested group\n\t\t\tcontext = this.parseGroup(context);\n\t\t\tif (context[\"hasError\"])\n\t\t\t{\n\t\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\t}\n\t\t\telse if (context[\"info\"][\"position\"] > fieldStartPosition)\n\t\t\t{\n\t\t\t\t// Group found beyond the expected position\n\t\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_START_POSITION, fieldStartPosition);\n\t\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\t}\n\t\t}\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\tfieldInfo = context[\"info\"];\n\t\t\tfieldInfo[\"isFieldListEnd\"] = false;\n\t\t\tcontext = this.clearContextInfo(context);\n\n\t\t\t// Checking for the presence of a field separator\n\t\t\tcontext = this.parseFieldListDelimiter(context);\n\n\t\t\tif (context[\"hasError\"])\n\t\t\t{\n\t\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\t\tcontext = this.clearContextInfoAndError(context);\n\t\t\t\t// Checking for the presence of the end sign of the field list\n\t\t\t\tcontext = this.parseFieldListEnd(context);\n\t\t\t\tif (context[\"hasError\"])\n\t\t\t\t{\n\t\t\t\t\tthis.unshiftError(errors, context[\"error\"][\"code\"], context[\"error\"][\"position\"]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfieldInfo[\"isFieldListEnd\"] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (context[\"hasError\"])\n\t\t{\n\t\t\tthis.unshiftError(errors, ERR_PARSE_GROUP_FIELD, fieldStartPosition);\n\t\t\tthis.addContextErrors(context, errors);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcontext[\"info\"] = fieldInfo;\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseGroupFieldList(context: {}): {}\n\t{\n\t\tconst fieldListStartPosition = context[\"position\"];\n\t\tconst fieldValues = [];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^\n\t\tconst regEx = new RegExp(REGEX_PART_FROM_DELIMITER_TO_FIELD_LIST, \"mg\");\n\t\tregEx.lastIndex = fieldListStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === fieldListStartPosition)\n\t\t{\n\t\t\tcontext[\"position\"] = fieldListStartPosition + matches[0].length;\n\t\t\tlet isFieldListEnd = false;\n\t\t\twhile (!(context[\"hasError\"] || isFieldListEnd))\n\t\t\t{\n\t\t\t\tcontext = this.parseField(context);\n\t\t\t\tif (!context[\"hasError\"])\n\t\t\t\t{\n\t\t\t\t\tisFieldListEnd = (\n\t\t\t\t\t\tcontext[\"info\"].hasOwnProperty(\"isFieldListEnd\")\n\t\t\t\t\t\t&& context[\"info\"][\"isFieldListEnd\"]\n\t\t\t\t\t);\n\t\t\t\t\tif (context[\"info\"][\"value\"] !== \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldValues.push(context[\"info\"][\"value\"]);\n\t\t\t\t\t}\n\t\t\t\t\tcontext = this.clearContextInfo(context);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!context[\"hasError\"])\n\t\t\t{\n\t\t\t\tcontext[\"info\"] = {\"fieldValues\": fieldValues};\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_PART_FROM_DELIMITER_TO_FIELD_LIST, fieldListStartPosition);\n\t\t}\n\n\t\tif (context[\"hasError\"])\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_FIELD_LIST, fieldListStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseGroupStart(context: {}): {}\n\t{\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^^^^^^^^\n\t\tconst regEx = new RegExp(REGEX_GROUP_PART_BEFORE_FIELDS, \"mg\");\n\t\tregEx.lastIndex = context[\"position\"];\n\t\tconst matches = regEx.exec(context[\"template\"])\n\t\tif (matches)\n\t\t{\n\t\t\tcontext[\"info\"][\"groupStartPosition\"] = matches.index + matches[1].length;\n\t\t\tcontext[\"info\"][\"groupDelimiterStartPosition\"] = matches.index + matches[1].length + matches[3].length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_START, context[\"position\"]);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseGroupEnd(context: {}): {}\n\t{\n\t\tconst markerStartPosition = context[\"position\"];\n\t\t// [\", \", [ADDRESS_LINE_1:N,ADDRESS_LINE_2,\"Text\",LOCALITY,ADM_LEVEL_2]]\n\t\t// Are looking for ^\n\t\tconst regEx = new RegExp(REGEX_GROUP_END, \"mg\");\n\t\tregEx.lastIndex = markerStartPosition;\n\t\tconst matches = regEx.exec(context[\"template\"]);\n\t\tif (matches && matches.index === markerStartPosition)\n\t\t{\n\t\t\tcontext[\"position\"] = markerStartPosition + matches[0].length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addContextError(context, ERR_PARSE_GROUP_END, markerStartPosition);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tparseGroup(context: {}): {}\n\t{\n\t\tconst startSearchPosition = context[\"position\"];\n\t\tlet groupStartPosition = 0;\n\t\tlet delimiterValue = \"\";\n\t\tlet fieldValues = [];\n\n\t\tcontext[\"level\"]++;\n\n\t\t// Checking for the presence of a start of a group\n\t\tcontext = this.parseGroupStart(context);\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\t// Found a sign of the beginning of a group\n\t\t\tgroupStartPosition = context[\"info\"][\"groupStartPosition\"];\n\t\t\tcontext[\"position\"] = context[\"info\"][\"groupDelimiterStartPosition\"];\n\t\t\tcontext = this.clearContextInfo(context);\n\t\t\tcontext = this.parseGroupDelimiter(context);\n\t\t}\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\t// The value of the group separator was got\n\t\t\tdelimiterValue = context[\"info\"][\"value\"];\n\t\t\tcontext = this.clearContextInfo(context);\n\t\t\tcontext = this.parseGroupFieldList(context);\n\t\t}\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\t// The values of the field list was got\n\t\t\tfieldValues = context[\"info\"][\"fieldValues\"];\n\t\t\tcontext = this.clearContextInfo(context);\n\t\t\tcontext = this.parseGroupEnd(context);\n\t\t}\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\t// Kremlin,Moscow,Moscow,Russia,103132 -> Kremlin,Moscow,Russia,103132\n\t\t\tfieldValues = [...new Set(fieldValues)];\n\n\t\t\tlet value = fieldValues.join(delimiterValue);\n\n\t\t\t// Kaliningrad, Narvskaya, 72, , kv 8 -> Kaliningrad, Narvskaya, 72, kv 8\n\t\t\tconst reg = new RegExp(`(${delimiterValue}){2,}`, 'gim');\n\t\t\tvalue = value.replace(new RegExp(reg), delimiterValue);\n\n\t\t\t// The sign of the end of the group is received, the assembly of the group value.\n\t\t\tcontext[\"info\"] = {\n\t\t\t\t\"type\": \"group\",\n\t\t\t\t\"position\": groupStartPosition,\n\t\t\t\t\"end\": context[\"position\"],\n\t\t\t\t\"value\": value,\n\t\t\t};\n\t\t}\n\n\t\tcontext[\"level\"]--;\n\n\t\tif (context[\"hasError\"])\n\t\t{\n\t\t\tthis.addContextError(\n\t\t\t\tcontext,\n\t\t\t\tERR_PARSE_GROUP,\n\t\t\t\tstartSearchPosition,\n\t\t\t\t{\"groupStartPosition\": groupStartPosition}\n\t\t\t);\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tappendTextBlock(blocks: [], position: number, value: string)\n\t{\n\t\tlet lastBlockIndex = blocks.length - 1;\n\t\tlet lastBlock = (lastBlockIndex >= 0) ? blocks[lastBlockIndex] : null;\n\t\tif (lastBlock && lastBlock.hasOwnProperty(\"type\") && lastBlock[\"type\"] === \"text\")\n\t\t{\n\t\t\tblocks[lastBlockIndex][\"value\"] += value;\n\t\t\tblocks[lastBlockIndex][\"length\"] += value.length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tblocks[++lastBlockIndex] = {\n\t\t\t\t\"type\": \"text\",\n\t\t\t\t\"position\": position,\n\t\t\t\t\"length\": value.length,\n\t\t\t\t\"value\": value,\n\t\t\t};\n\t\t}\n\t}\n\n\tappendGroupBlock(blocks: [], position: number, value: string)\n\t{\n\t\tblocks.push({\n\t\t\t\"type\": \"group\",\n\t\t\t\"position\": position,\n\t\t\t\"length\": value.length,\n\t\t\t\"value\": value,\n\t\t});\n\t}\n\n\tunshiftError(errors: [{}], code: number, position: number, info: {} = null)\n\t{\n\t\terrors.unshift({\n\t\t\t\"code\": code,\n\t\t\t\"position\": position,\n\t\t\t\"info\": (Type.isPlainObject(info)) ? info : {},\n\t\t});\n\t}\n\n\taddContextError(context: {}, code: number, position: number, info: {} = null)\n\t{\n\t\tcontext[\"hasError\"] = true;\n\t\tcontext[\"error\"][\"code\"] = code;\n\t\tcontext[\"error\"][\"position\"] = position;\n\t\tcontext[\"error\"][\"info\"] = (Type.isPlainObject(info)) ? info : {};\n\t\tthis.unshiftError(context[\"error\"][\"errors\"], code, position, info);\n\t}\n\n\taddContextErrors(context: {}, errors: [{}], info: {} = null)\n\t{\n\t\tcontext[\"hasError\"] = true;\n\t\tcontext[\"error\"][\"code\"] = errors[0][\"code\"];\n\t\tcontext[\"error\"][\"position\"] = errors[0][\"position\"];\n\t\tcontext[\"error\"][\"info\"] = (Type.isPlainObject(info)) ? info : {};\n\t\tcontext[\"error\"][\"errors\"].splice(0, 0, errors);\n\t}\n\n\tparseBlocks(context: {}): {}\n\t{\n\t\t/* Variable for debug only\n\t\tlet errorDisplayed = false;\n\t\t*/\n\n\t\tconst blocks = [];\n\n\t\tconst templateLength = context[\"template\"].length;\n\t\twhile (context[\"position\"] < templateLength)\n\t\t{\n\t\t\tconst blockStartPosition = context[\"position\"];\n\t\t\tcontext = this.parseGroup(context);\n\t\t\tif (context[\"hasError\"])\n\t\t\t{\n\t\t\t\t// Debug info\n\t\t\t\t/*if (!errorDisplayed)\n\t\t\t\t{\n\t\t\t\t\tconsole.info(this.getErrorsText(context));\n\t\t\t\t\terrorDisplayed = true;\n\t\t\t\t}*/\n\n\t\t\t\tconst errorInfo = context[\"error\"][\"info\"];\n\t\t\t\tlet blockLength;\n\t\t\t\tif (!Type.isPlainObject(errorInfo)\n\t\t\t\t\t&& errorInfo.hasOwnProperty(\"groupStartPosition\")\n\t\t\t\t\t&& errorInfo[\"groupStartPosition\"] > blockStartPosition\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tblockLength = errorInfo[\"groupStartPosition\"] - blockStartPosition + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tblockLength = 1;\n\t\t\t\t}\n\n\t\t\t\tthis.appendTextBlock(\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontext[\"error\"][\"position\"],\n\t\t\t\t\tcontext[\"template\"].substr(blockStartPosition, blockLength)\n\t\t\t\t);\n\t\t\t\tcontext = this.clearContextInfoAndError(context);\n\t\t\t\tcontext[\"position\"] = blockStartPosition + blockLength;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconst groupStartPosition = context[\"info\"][\"position\"];\n\t\t\t\tif (groupStartPosition > blockStartPosition)\n\t\t\t\t{\n\t\t\t\t\tthis.appendTextBlock(\n\t\t\t\t\t\tblocks,\n\t\t\t\t\t\tblockStartPosition,\n\t\t\t\t\t\tcontext[\"template\"].substr(\n\t\t\t\t\t\t\tblockStartPosition,\n\t\t\t\t\t\t\tgroupStartPosition - blockStartPosition\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (context[\"info\"][\"value\"] !== \"\")\n\t\t\t\t{\n\t\t\t\t\tthis.appendGroupBlock(\n\t\t\t\t\t\tblocks,\n\t\t\t\t\t\tgroupStartPosition,\n\t\t\t\t\t\tcontext[\"info\"][\"value\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcontext = this.clearContextInfo(context);\n\t\t\t}\n\t\t}\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\tcontext[\"info\"] = {\"blocks\": blocks};\n\t\t}\n\n\t\treturn context;\n\t}\n\n\tconvert(address: Address): string\n\t{\n\t\tlet result = \"\";\n\n\t\tlet context = this.createContext();\n\t\tcontext[\"template\"] = this.#template;\n\t\tcontext[\"address\"] = address;\n\n\t\tcontext = this.parseBlocks(context);\n\n\t\tif (!context[\"hasError\"])\n\t\t{\n\t\t\tconst blocks = context[\"info\"][\"blocks\"];\n\t\t\tfor (let i = 0; i < blocks.length; i++)\n\t\t\t{\n\t\t\t\tif (blocks[i][\"type\"] === \"text\")\n\t\t\t\t{\n\t\t\t\t\tresult += this.unescapeText(blocks[i][\"value\"]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult += blocks[i][\"value\"];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (result !== \"\")\n\t\t{\n\t\t\tconst temp = result.split(STR_DELIMITER_PLACEHOLDER);\n\t\t\tlet parts = [];\n\t\t\tfor (let i = 0; i < temp.length; i++)\n\t\t\t{\n\t\t\t\tif (temp[i] !== \"\")\n\t\t\t\t{\n\t\t\t\t\tparts.push(temp[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.#htmlEncode && parts.length > 0)\n\t\t\t{\n\t\t\t\tfor (let i = 0; i < parts.length; i++)\n\t\t\t\t{\n\t\t\t\t\tparts[i] = Text.encode(parts[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult = parts.join(this.#delimiter);\n\t\t}\n\t\treturn result;\n\t}\n}\n","import {Text} from 'main.core';\nimport Address from '../../address';\nimport Format from '../../format';\nimport StringTemplateConverter from './stringtemplateconverter';\n\nexport default class StringConverter\n{\n\tstatic STRATEGY_TYPE_TEMPLATE = 'template';\n\tstatic STRATEGY_TYPE_TEMPLATE_COMMA = 'template_comma';\n\tstatic STRATEGY_TYPE_TEMPLATE_NL = 'template_nl';\n\tstatic STRATEGY_TYPE_TEMPLATE_BR = 'template_br';\n\tstatic STRATEGY_TYPE_FIELD_SORT = 'field_sort';\n\tstatic STRATEGY_TYPE_FIELD_TYPE = 'field_type';\n\n\tstatic CONTENT_TYPE_HTML = 'html';\n\tstatic CONTENT_TYPE_TEXT = 'text';\n\t/**\n\t * Convert address to string\n\t * @param {Address} address\n\t * @param {Format} format\n\t * @param {string} strategyType\n\t * @param {string} contentType\n\t * @returns {string}\n\t */\n\tstatic convertAddressToString(address: Address, format: Format, strategyType: string, contentType: string): string\n\t{\n\t\tlet result;\n\n\t\tif (strategyType === StringConverter.STRATEGY_TYPE_TEMPLATE\n\t\t\t|| strategyType === StringConverter.STRATEGY_TYPE_TEMPLATE_COMMA\n\t\t\t|| strategyType === StringConverter.STRATEGY_TYPE_TEMPLATE_NL\n\t\t\t|| strategyType === StringConverter.STRATEGY_TYPE_TEMPLATE_BR\n\t\t)\n\t\t{\n\t\t\tlet delimiter = null;\n\n\t\t\tswitch (strategyType)\n\t\t\t{\n\t\t\t\tcase StringConverter.STRATEGY_TYPE_TEMPLATE_COMMA:\n\t\t\t\t\tdelimiter = ', ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase StringConverter.STRATEGY_TYPE_TEMPLATE_NL:\n\t\t\t\t\tdelimiter = '\\n';\n\t\t\t\t\tbreak;\n\t\t\t\tcase StringConverter.STRATEGY_TYPE_TEMPLATE_BR:\n\t\t\t\t\tdelimiter = '<br />';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tresult = StringConverter.convertAddressToStringTemplate(\n\t\t\t\taddress, format.getTemplate(), contentType, delimiter, format\n\t\t\t);\n\t\t}\n\t\telse if (strategyType === StringConverter.STRATEGY_TYPE_FIELD_SORT)\n\t\t{\n\t\t\tconst fieldSorter = (a, b) => { return a.sort - b.sort; };\n\t\t\tresult = StringConverter.convertAddressToStringByField(address, format, fieldSorter, contentType);\n\t\t}\n\t\telse if (strategyType === StringConverter.STRATEGY_TYPE_FIELD_TYPE)\n\t\t{\n\t\t\tconst fieldSorter = (a, b) => {\n\t\t\t\tlet sortResult;\n\n\t\t\t\t// We suggest that UNKNOWN must be the last\n\t\t\t\tif (a.type === 0)\n\t\t\t\t{\n\t\t\t\t\tsortResult = 1;\n\t\t\t\t}\n\t\t\t\telse if (b.type === 0)\n\t\t\t\t{\n\t\t\t\t\tsortResult = -1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsortResult = a.type - b.type;\n\t\t\t\t}\n\n\t\t\t\treturn sortResult;\n\t\t\t};\n\n\t\t\tresult = StringConverter.convertAddressToStringByField(address, format, fieldSorter, contentType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow TypeError('Wrong strategyType');\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Convert address to string\n\t * @param {Address} address\n\t * @param {string} template\n\t * @param {string} contentType\n\t * @param {string|null} delimiter\n\t * @param {Format|null} format\n\t * @returns {string}\n\t */\n\tstatic convertAddressToStringTemplate(\n\t\taddress: Address,\n\t\ttemplate: Template,\n\t\tcontentType: string,\n\t\tdelimiter: string = null,\n\t\tformat: Format = null\n\t): string\n\t{\n\t\tconst needHtmlEncode = (contentType === StringConverter.CONTENT_TYPE_HTML);\n\n\t\tif (delimiter === null)\n\t\t{\n\t\t\tdelimiter = needHtmlEncode ? '<br />' : '\\n';\n\t\t}\n\n\t\tconst templateConverter = new StringTemplateConverter(template.template, delimiter, needHtmlEncode, format);\n\t\treturn templateConverter.convert(address);\n\t}\n\n\t/**\n\t * Convert address to string\n\t * @param {Address} address\n\t * @param {Format} format\n\t * @param {Function} fieldSorter\n\t * @param {string} contentType\n\t * @returns {string}\n\t */\n\tstatic convertAddressToStringByField(\n\t\taddress: Address,\n\t\tformat: Format,\n\t\tfieldSorter: Function,\n\t\tcontentType: string\n\t): string\n\t{\n\t\tif (!(format instanceof Format))\n\t\t{\n\t\t\tBX.debug('format must be instance of Format');\n\t\t}\n\n\t\tif (!(address instanceof Address))\n\t\t{\n\t\t\tBX.debug('address must be instance of Address');\n\t\t}\n\n\t\tconst fieldCollection = format.fieldCollection;\n\n\t\tif (!fieldCollection)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fields = Object.values(fieldCollection.fields);\n\n\t\t// todo: make only once or cache?\n\t\tfields.sort(fieldSorter);\n\n\t\tlet result = '';\n\n\t\tfor(const field of fields)\n\t\t{\n\t\t\tlet value = address.getFieldValue(field.type);\n\n\t\t\tif (value === null)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (contentType === StringConverter.CONTENT_TYPE_HTML)\n\t\t\t{\n\t\t\t\tvalue = Text.encode(value);\n\t\t\t}\n\n\t\t\tif (result !== '')\n\t\t\t{\n\t\t\t\tresult += format.delimiter;\n\t\t\t}\n\n\t\t\tresult += value;\n\t\t}\n\n\t\treturn result;\n\t}\n}","import Address from '../../address';\nimport AddressFieldCollection from '../addressfieldcollection';\nimport AddressLinkCollection from '../addresslinkcollection';\n\nexport default class JsonConverter\n{\n\t/**\n\t * @param {Object} jsonData\n\t * @returns {Address}\n\t */\n\tstatic convertJsonToAddress(jsonData: Object): Address\n\t{\n\t\treturn new Address(jsonData);\n\t}\n\n\t/**\n\t * @param {Address} address\n\t * @returns {{languageId: string, location: ({\"'...'\"}|null), id: number, fieldCollection: {\"'...'\"}}} Json data\n\t */\n\tstatic convertAddressToJson(address: Address): Object\n\t{\n\t\tconst obj = {\n\t\t\tid: address.id,\n\t\t\tlanguageId: address.languageId,\n\t\t\tlatitude: address.latitude,\n\t\t\tlongitude: address.longitude,\n\t\t\tfieldCollection: JsonConverter.#objectifyFieldCollection(address.fieldCollection),\n\t\t\tlinks: JsonConverter.#objectifyLinks(address.links),\n\t\t\tlocation: null\n\t\t};\n\n\t\tif (address.location)\n\t\t{\n\t\t\tobj.location = JSON.parse(address.location.toJson());\n\t\t}\n\n\t\treturn JSON.stringify(obj);\n\t}\n\n\t/**\n\t * @param {AddressFieldCollection} fieldCollection\n\t * @returns {Object}\n\t */\n\tstatic #objectifyFieldCollection(fieldCollection: AddressFieldCollection): Object\n\t{\n\t\tconst result = {};\n\n\t\tObject.values(fieldCollection.fields).forEach((field) => {\n\t\t\tresult[field.type] = field.value;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tstatic #objectifyLinks(links: AddressLinkCollection): Array<{entityId: string, entityType: string}>\n\t{\n\t\treturn links.map((link) => {\n\t\t\treturn {\n\t\t\t\tentityId: link.entityId,\n\t\t\t\tentityType: link.entityType\n\t\t\t};\n\t\t});\n\t}\n}","import {Type} from 'main.core';\nimport AddressFieldCollection from './address/addressfieldcollection';\nimport AddressLinkCollection from './address/addresslinkcollection';\nimport AddressLink from './address/addresslink';\nimport StringConverter from './address/converter/stringconverter';\nimport Format from './format';\nimport JsonConverter from './address/converter/jsonconverter';\nimport Location from './location';\n\nexport default class Address\n{\n\t#id;\n\t#languageId;\n\t#latitude;\n\t#longitude;\n\n\t#fieldCollection;\n\t#links;\n\n\t#location;\n\n\t/**\n\t * @param {{...}} props\n\t */\n\tconstructor(props)\n\t{\n\t\tif(Type.isUndefined(props.languageId))\n\t\t{\n\t\t\tthrow new TypeError('languageId must be defined');\n\t\t}\n\n\t\tthis.#languageId = props.languageId;\n\n\t\tthis.#id = props.id || 0;\n\t\tthis.#latitude = props.latitude || '';\n\t\tthis.#longitude = props.longitude || '';\n\t\tthis.#fieldCollection = new AddressFieldCollection();\n\n\t\tif(Type.isObject(props.fieldCollection))\n\t\t{\n\t\t\tfor(const [type, value] of Object.entries(props.fieldCollection))\n\t\t\t{\n\t\t\t\tthis.setFieldValue(type, value);\n\t\t\t}\n\t\t}\n\n\t\tthis.#links = new AddressLinkCollection();\n\n\t\tif(Type.isArray(props.links))\n\t\t{\n\t\t\tfor(const link of props.links)\n\t\t\t{\n\t\t\t\tthis.addLink(link.entityId, link.entityType);\n\t\t\t}\n\t\t}\n\n\t\tthis.#location = null;\n\n\t\tif(props.location)\n\t\t{\n\t\t\tif(props.location instanceof Location)\n\t\t\t{\n\t\t\t\tthis.#location = props.location;\n\t\t\t}\n\t\t\telse if(Type.isObject(props.location))\n\t\t\t{\n\t\t\t\tthis.#location = new Location(props.location);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tBX.debug('Wrong typeof props.location');\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns {int}\n\t */\n\tget id(): number\n\t{\n\t\treturn this.#id;\n\t}\n\n\t/**\n\t * @returns {Location}\n\t */\n\tget location(): ?Location\n\t{\n\t\treturn this.#location;\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tget languageId(): string\n\t{\n\t\treturn this.#languageId;\n\t}\n\n\t/**\n\t * @returns {AddressFieldCollection}\n\t */\n\tget fieldCollection(): AddressFieldCollection\n\t{\n\t\treturn this.#fieldCollection;\n\t}\n\n\t/**\n\t * @param {int} id\n\t */\n\tset id(id: number)\n\t{\n\t\tthis.#id = id;\n\t}\n\n\t/**\n\t * @param {Location} location\n\t */\n\tset location(location: ?Location)\n\t{\n\t\tthis.#location = location;\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tget latitude(): string\n\t{\n\t\treturn this.#latitude;\n\t}\n\n\t/**\n\t * @param {string} latitude\n\t */\n\tset latitude(latitude: string): void\n\t{\n\t\tthis.#latitude = latitude;\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tget longitude(): string\n\t{\n\t\treturn this.#longitude;\n\t}\n\n\t/**\n\t * @param {string} longitude\n\t */\n\tset longitude(longitude: string): void\n\t{\n\t\tthis.#longitude = longitude;\n\t}\n\n\t/**\n\t * @returns {AddressLinkCollection}\n\t */\n\tget links(): AddressLinkCollection\n\t{\n\t\treturn this.#links.links;\n\t}\n\n\t/**\n\t * @param {number} type\n\t * @param {mixed} value\n\t */\n\tsetFieldValue(type: number, value: string): void\n\t{\n\t\tthis.#fieldCollection.setFieldValue(type, value);\n\t}\n\n\t/**\n\t * @param {number} type\n\t * @returns {?string}\n\t */\n\tgetFieldValue(type: number): ?string\n\t{\n\t\treturn this.#fieldCollection.getFieldValue(type);\n\t}\n\n\t/**\n\t * Check if field exist\n\t * @param type\n\t * @returns {boolean}\n\t */\n\tisFieldExists(type: number): boolean\n\t{\n\t\treturn this.#fieldCollection.isFieldExists(type);\n\t}\n\n\t/**\n\t * @return {string} JSON\n\t */\n\ttoJson(): string\n\t{\n\t\treturn JsonConverter.convertAddressToJson(this);\n\t}\n\n\t/**\n\t * @param {Format}format\n\t * @param {?string}strategyType\n\t * @param {?string}contentType\n\t * @return {string}\n\t */\n\ttoString(format: Format, strategyType: ?string, contentType: ?string): string\n\t{\n\t\tif(!(format instanceof Format))\n\t\t{\n\t\t\tconsole.error('format must be instance of Format');\n\t\t\treturn '';\n\t\t}\n\n\t\tconst strategy = strategyType || StringConverter.STRATEGY_TYPE_TEMPLATE;\n\t\tconst type = contentType || StringConverter.CONTENT_TYPE_HTML;\n\t\treturn StringConverter.convertAddressToString(this, format, strategy, type);\n\t}\n\n\t/**\n\t * @returns {?Location}\n\t */\n\ttoLocation(): ?Location\n\t{\n\t\tlet result = null;\n\n\t\tif(this.location)\n\t\t{\n\t\t\tconst locationObj = JSON.parse(this.location.toJson());\n\t\t\tlocationObj.address = JSON.parse(this.toJson());\n\t\t\tresult = new Location(locationObj);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * @return {number}\n\t */\n\tgetType(): number\n\t{\n\t\treturn this.#fieldCollection.getMaxFieldType();\n\t}\n\n\t/**\n\t * @param {string} entityId\n\t * @param {string} entityType\n\t */\n\taddLink(entityId: number, entityType: string): void\n\t{\n\t\tthis.#links.addLink(new AddressLink({\n\t\t\tentityId: entityId,\n\t\t\tentityType: entityType\n\t\t}));\n\t}\n\n\tclearLinks(): void\n\t{\n\t\tthis.#links.clearLinks();\n\t}\n}","import Field from '../generic/field';\n\nexport default class LocationField extends Field\n{\n\t#value;\n\n\t// todo: Fields validation\n\tconstructor(props)\n\t{\n\t\tsuper(props);\n\t\tthis.#value = props.value || '';\n\t}\n\n\tget value(): string\n\t{\n\t\treturn this.#value;\n\t}\n\n\tset value(value: string)\n\t{\n\t\tthis.#value = value;\n\t}\n}","import FieldCollection from '../generic/fieldcollection';\nimport LocationField from './locationfield';\n\nexport default class LocationFieldCollection extends FieldCollection\n{\n\tgetFieldValue(type)\n\t{\n\t\tlet result = null;\n\n\t\tif(this.isFieldExists(type))\n\t\t{\n\t\t\tconst field = this.getField(type);\n\n\t\t\tif(field)\n\t\t\t{\n\t\t\t\tresult = field.value;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetFieldValue(type, value)\n\t{\n\t\tthis.setField(\n\t\t\tnew LocationField({type, value})\n\t\t);\n\n\t\treturn this;\n\t}\n}","import Location from '../location';\nimport LocationFieldCollection from './locationfieldcollection';\n\nexport default class LocationObjectConverter\n{\n\tstatic convertLocationToObject(location: Location): Object\n\t{\n\t\tif(!(location instanceof Location))\n\t\t{\n\t\t\tthrow new TypeError('location must be type of location');\n\t\t}\n\n\t\tconst obj = {\n\t\t\tid: location.id,\n\t\t\tcode: location.code,\n\t\t\texternalId: location.externalId,\n\t\t\tsourceCode: location.sourceCode,\n\t\t\ttype: location.type,\n\t\t\tname: location.name,\n\t\t\tlanguageId: location.languageId,\n\t\t\tlatitude: location.latitude,\n\t\t\tlongitude: location.longitude,\n\t\t\tfieldCollection: LocationObjectConverter.#objectifyFieldCollection(location.fieldCollection),\n\t\t\taddress: null\n\t\t};\n\n\t\tif(location.address)\n\t\t{\n\t\t\tobj.address = JSON.parse(location.address.toJson());\n\t\t}\n\n\t\treturn obj;\n\t}\n\n\tstatic #objectifyFieldCollection(fieldCollection: LocationObjectConverter): Object\n\t{\n\t\tlet result = {};\n\n\t\tObject.values(fieldCollection.fields).forEach((field) => {\n\t\t\tresult[field.type] = field.value;\n\t\t});\n\n\t\treturn result;\n\t}\n}","import Location from '../location';\nimport Address from '../address';\nimport LocationObjectConverter from './locationobjectconverter';\n\nexport default class LocationJsonConverter\n{\n\t/**\n\t * @param {{...}}jsonData\n\t * @returns {Location}\n\t */\n\tstatic convertJsonToLocation(jsonData)\n\t{\n\t\tconst initData = {...jsonData};\n\n\t\tif(jsonData.address)\n\t\t{\n\t\t\tinitData.address = new Address(jsonData.address);\n\t\t}\n\n\t\treturn new Location(initData);\n\t}\n\n\t/**\n\t * @param {Location} location\n\t * @returns {{...}}\n\t */\n\tstatic convertLocationToJson(location: Location)\n\t{\n\t\tif(!(location instanceof Location))\n\t\t{\n\t\t\tthrow new TypeError('location must be type of location');\n\t\t}\n\n\t\tconst obj = LocationObjectConverter.convertLocationToObject(location);\n\t\treturn obj ? JSON.stringify(obj) : '';\n\t}\n}","import {Type} from 'main.core';\nimport Address from './address';\nimport LocationJsonConverter from './location/locationjsonconverter';\nimport LocationFieldCollection from './location/locationfieldcollection';\n\nexport default class Location\n{\n\t#id;\n\t#code;\n\t#externalId;\n\t#sourceCode;\n\t#type;\n\t#name;\n\t#languageId;\n\t#latitude;\n\t#longitude;\n\t#address;\n\t#fieldCollection;\n\n\tconstructor(props = {})\n\t{\n\t\tthis.#id = parseInt(props.id) || 0;\n\t\tthis.#code = props.code || '';\n\t\tthis.#externalId = props.externalId || '';\n\t\tthis.#sourceCode = props.sourceCode || '';\n\t\tthis.#type = parseInt(props.type) || 0;\n\t\tthis.#name = props.name || '';\n\t\tthis.#languageId = props.languageId || '';\n\t\tthis.#latitude = props.latitude || '';\n\t\tthis.#longitude = props.longitude || '';\n\t\tthis.#fieldCollection = new LocationFieldCollection();\n\n\t\tif(Type.isObject(props.fieldCollection))\n\t\t{\n\t\t\tfor(const [type, value] of Object.entries(props.fieldCollection))\n\t\t\t{\n\t\t\t\tthis.setFieldValue(type, value);\n\t\t\t}\n\t\t}\n\n\t\tthis.#address = null;\n\n\t\tif(props.address)\n\t\t{\n\t\t\tif(props.address instanceof Address)\n\t\t\t{\n\t\t\t\tthis.#address = props.address;\n\t\t\t}\n\t\t\telse if(typeof props.address === 'object')\n\t\t\t{\n\t\t\t\tthis.#address = new Address(props.address);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tBX.debug('Wrong typeof props.address');\n\t\t\t}\n\t\t}\n\t}\n\n\tget id(): number\n\t{\n\t\treturn this.#id;\n\t}\n\n\tget code(): string\n\t{\n\t\treturn this.#code;\n\t}\n\n\tget externalId(): string\n\t{\n\t\treturn this.#externalId;\n\t}\n\n\tget sourceCode(): string\n\t{\n\t\treturn this.#sourceCode;\n\t}\n\n\tget type(): number\n\t{\n\t\treturn this.#type;\n\t}\n\n\tget name(): string\n\t{\n\t\treturn this.#name;\n\t}\n\n\tget languageId(): string\n\t{\n\t\treturn this.#languageId;\n\t}\n\n\tset id(value: number): void\n\t{\n\t\tthis.#id = value;\n\t}\n\n\tset code(code: string): void\n\t{\n\t\tthis.#code = code;\n\t}\n\n\tset externalId(value: string): void\n\t{\n\t\tthis.#externalId = value;\n\t}\n\n\tset sourceCode(value: string): void\n\t{\n\t\tthis.#sourceCode = value;\n\t}\n\n\tset type(value: number): void\n\t{\n\t\tthis.#type = value;\n\t}\n\n\tset name(value: string): void\n\t{\n\t\tthis.#name = value;\n\t}\n\n\tset languageId(value: string): void\n\t{\n\t\tthis.#languageId = value;\n\t}\n\n\tget latitude(): string\n\t{\n\t\treturn this.#latitude;\n\t}\n\n\tset latitude(latitude: string): void\n\t{\n\t\tthis.#latitude = latitude;\n\t}\n\n\tget longitude(): string\n\t{\n\t\treturn this.#longitude;\n\t}\n\n\tset longitude(longitude: string): void\n\t{\n\t\tthis.#longitude = longitude;\n\t}\n\n\tset address(address: Address): void\n\t{\n\t\tthis.#address = address;\n\t}\n\n\tget address(): ?Address\n\t{\n\t\treturn this.#address;\n\t}\n\n\ttoJson(): string\n\t{\n\t\treturn LocationJsonConverter.convertLocationToJson(this);\n\t}\n\n\ttoAddress(): ?Address\n\t{\n\t\tlet result = null;\n\n\t\tif(this.address)\n\t\t{\n\t\t\tconst addressObj = JSON.parse(this.address.toJson());\n\t\t\taddressObj.location = JSON.parse(this.toJson());\n\t\t\tresult = new Address(addressObj);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tget fieldCollection(): LocationFieldCollection\n\t{\n\t\treturn this.#fieldCollection;\n\t}\n\n\tsetFieldValue(type: number, value: string): void\n\t{\n\t\tthis.#fieldCollection.setFieldValue(type, value);\n\t}\n\n\tgetFieldValue(type: number): ?string\n\t{\n\t\treturn this.#fieldCollection.getFieldValue(type);\n\t}\n\n\tisFieldExists(type: number): boolean\n\t{\n\t\treturn this.#fieldCollection.isFieldExists(type);\n\t}\n\n\thasExternalRelation(): boolean\n\t{\n\t\treturn (this.#externalId && this.#sourceCode);\n\t}\n}","export default class ActionRunner\n{\n\t#path = '';\n\n\tconstructor(props)\n\t{\n\t\tif(!props.path)\n\t\t{\n\t\t\tthrow new Error('props.path must not be empty!');\n\t\t}\n\n\t\tthis.#path = props.path;\n\t}\n\n\trun(action, data)\n\t{\n\t\tif(!action)\n\t\t{\n\t\t\tthrow new Error('action can not be empty!');\n\t\t}\n\n\t\treturn BX.ajax.runAction(`${this.#path}.${action}`, {data});\n\t}\n}","import ActionRunner from './actionrunner';\n\nexport default class BaseRepository\n{\n\t#actionRunner = null;\n\n\tconstructor(props = {})\n\t{\n\t\tthis._path = props.path;\n\n\t\tif(props.actionRunner && props.actionRunner instanceof ActionRunner)\n\t\t{\n\t\t\tthis.#actionRunner = props.actionRunner;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#actionRunner = new ActionRunner({path: this._path});\n\t\t}\n\t}\n\n\tget path()\n\t{\n\t\treturn this._path;\n\t}\n\n\tget actionRunner()\n\t{\n\t\treturn this.#actionRunner;\n\t}\n\n\tprocessResponse(response: Object)\n\t{\n\t\tif(response.status !== 'success')\n\t\t{\n\t\t\tBX.debug('Request was not successful');\n\t\t\tlet message = '';\n\n\t\t\tif(Array.isArray(response.errors) && response.errors.length > 0)\n\t\t\t{\n\t\t\t\tfor(const error of response.errors)\n\t\t\t\t{\n\t\t\t\t\tif(typeof error.message === 'string' && error.message !== '')\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage += `${error}\\n`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new Error(message);\n\t\t}\n\n\t\treturn response.data ? response.data : null;\n\t}\n}","import BaseRepository from './baserepository';\nimport LocationJsonConverter from '../entity/location/locationjsonconverter';\nimport Location from '../entity/location';\nimport Address from '../entity/address';\nimport LocationObjectConverter from '../entity/location/locationobjectconverter';\n\nexport default class LocationRepository extends BaseRepository\n{\n\tconstructor(props = {})\n\t{\n\t\tprops.path = props.path || 'location.api.location';\n\t\tsuper(props);\n\t}\n\n\tfindParents(location: Location): Promise\n\t{\n\t\tif(!(location instanceof Location))\n\t\t{\n\t\t\tthrow new TypeError('location must be type of Location');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findParents',\n\t\t\t{\n\t\t\t\tlocation: LocationObjectConverter.convertLocationToObject(location)\n\t\t\t})\n\t\t\t.then(this.processResponse.bind(this))\n\t\t\t.then(this.#convertCollection.bind(this));\n\t}\n\n\tfindByExternalId(externalId: string, sourceCode: string, languageId: string): Promise\n\t{\n\t\tif(!externalId || !sourceCode || !languageId)\n\t\t{\n\t\t\tthrow new Error('externalId and sourceCode and languageId must be defined');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findByExternalId',\n\t\t\t{\n\t\t\t\texternalId: externalId,\n\t\t\t\tsourceCode: sourceCode,\n\t\t\t\tlanguageId: languageId\n\t\t\t})\n\t\t\t.then(this.processResponse.bind(this))\n\t\t\t.then(this.#convertLocation.bind(this));\n\t}\n\n\tfindById(locationId: number, languageId: string)\n\t{\n\t\tif(!locationId || !languageId)\n\t\t{\n\t\t\tthrow new Error('locationId and languageId must be defined');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findById',\n\t\t\t{\n\t\t\t\tid: locationId,\n\t\t\t\tlanguageId: languageId\n\t\t\t})\n\t\t\t.then(this.processResponse.bind(this))\n\t\t\t.then(this.#convertLocation.bind(this));\n\t}\n\n\t#convertCollection(collectionJsonData: Array): Array<Location>\n\t{\n\t\tif(!Array.isArray(collectionJsonData))\n\t\t{\n\t\t\tthrow new Error('Can\\'t convert location collection data');\n\t\t}\n\n\t\tconst result = [];\n\n\t\tcollectionJsonData.forEach((location) => {\n\t\t\tresult.push(\n\t\t\t\tthis.#convertLocation(location)\n\t\t\t);\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t#convertLocation(locationData)\n\t{\n\t\tif(!locationData)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif(typeof locationData !== 'object')\n\t\t{\n\t\t\tthrow new Error('Can\\'t convert location data');\n\t\t}\n\n\t\treturn LocationJsonConverter.convertJsonToLocation(locationData);\n\t}\n}","import {Address} from 'location.core';\nimport BaseRepository from './baserepository';\n\nexport default class AddressRepository extends BaseRepository\n{\n\tconstructor(props = {})\n\t{\n\t\tprops.path = 'location.api.address';\n\t\tsuper(props);\n\t}\n\n\tfindById(addressId: number)\n\t{\n\t\tif(addressId <= 0)\n\t\t{\n\t\t\tthrow new Error('addressId must be more than zero');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findById',\n\t\t\t{\n\t\t\t\taddressId: addressId,\n\t\t\t})\n\t\t\t.then(this.processResponse)\n\t\t\t.then((address) => { // address json data or null\n\t\t\t\tlet result = null;\n\n\t\t\t\tif(address)\n\t\t\t\t{\n\t\t\t\t\tresult = this.convertJsonToAddress(address);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t});\n\t}\n\n\tsave(address)\n\t{\n\t\tif(!address)\n\t\t{\n\t\t\tthrow new Error('address must be defined');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'save',\n\t\t\t{\n\t\t\t\taddress: address,\n\t\t\t})\n\t\t\t.then(this.processResponse)\n\t\t\t.then((response) => {\t//Address json data\n\t\t\t\tlet result = null;\n\n\t\t\t\tif(typeof response === 'object')\n\t\t\t\t{\n\t\t\t\t\tresult = this.convertJsonToAddress(response);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t});\n\t}\n\n\tconvertJsonToAddress(jsonData)\n\t{\n\t\treturn new Address(jsonData);\n\t}\n}\n\n","import BaseRepository from \"./baserepository\";\nimport Format from \"../entity/format\";\nimport {Type} from \"main.core\";\n\n/**\n * Class responsible for the addresses format obtaining.\n */\nexport default class FormatRepository extends BaseRepository\n{\n\tconstructor(props = {}) {\n\t\tprops.path = 'location.api.format';\n\t\tsuper(props);\n\t}\n\n\t/**\n\t * Find all available formats\n\t * @param {string} languageId\n\t * @returns {Promise}\n\t */\n\tfindAll(languageId: string): Promise\n\t{\n\t\tif(!Type.isString(languageId))\n\t\t{\n\t\t\tthrow new TypeError('languageId must be type of string');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findAll',\n\t\t\t{\n\t\t\t\tlanguageId: languageId\n\t\t\t})\n\t\t\t.then(this.processResponse)\n\t\t\t.then(\n\t\t\t\t(data) => this.convertFormatCollection(data)\n\t\t\t);\n\t}\n\n\t/**\n\t * Find address format by its code\n\t * @param {string} formatCode\n\t * @param {string} languageId\n\t * @returns {Promise}\n\t */\n\tfindByCode(formatCode: string, languageId: string): Promise\n\t{\n\t\tif(!Type.isString(formatCode))\n\t\t{\n\t\t\tthrow new TypeError('formatCode must be type of string');\n\t\t}\n\n\t\tif(!Type.isString(languageId))\n\t\t{\n\t\t\tthrow new TypeError('languageId must be type of string');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findByCode',\n\t\t\t{\n\t\t\t\tformatCode: formatCode,\n\t\t\t\tlanguageId: languageId\n\t\t\t})\n\t\t\t.then(this.processResponse)\n\t\t\t.then(this.convertFormatData);\n\t}\n\n\t/**\n\t * Find default address format\n\t * @param {string} languageId\n\t * @returns {Promise}\n\t */\n\tfindDefault(languageId: string): Promise\n\t{\n\t\tif(!Type.isString(languageId))\n\t\t{\n\t\t\tthrow new TypeError('languageId must be type of string');\n\t\t}\n\n\t\treturn this.actionRunner.run(\n\t\t\t'findDefault',\n\t\t\t{\n\t\t\t\tlanguageId: languageId\n\t\t\t})\n\t\t\t.then(this.processResponse)\n\t\t\t.then(this.convertFormatData);\n\t}\n\n\tconvertFormatCollection(formatDataCollection: Array): Array<Format>\n\t{\n\t\tif(!Type.isArray(formatDataCollection))\n\t\t{\n\t\t\tthrow new TypeError('Can\\'t convert format collection data');\n\t\t}\n\n\t\tlet result = [];\n\n\t\tformatDataCollection.forEach((format) => {\n\t\t\tresult.push(\n\t\t\t\tthis.convertFormatData(format)\n\t\t\t);\n\t\t});\n\t\t\n\t\treturn result;\n\t}\n\n\tconvertFormatData(formatData: {}): Format\n\t{\n\t\tif(!Type.isObject(formatData))\n\t\t{\n\t\t\tthrow new TypeError('Can\\'t convert format data');\n\t\t}\n\n\t\treturn new Format(formatData);\n\t}\n}\n","import BaseRepository from './baserepository';\n\nexport default class SourceRepository extends BaseRepository\n{\n\tconstructor(props = {}) {\n\t\tprops.path = 'location.api.source';\n\t\tsuper(props);\n\t}\n\n\tgetProps(): Promise\n\t{\n\t\treturn this.actionRunner.run('getProps', {})\n\t\t\t.then(this.processResponse);\n\t}\n}\n","// @flow\n\nimport {Location, Point} from 'location.core';\n\n/**\n * Autocomplete search parameters\n */\nexport type AutocompleteServiceParams = {\n\tbiasPoint: ?Point\n};\n\n/**\n * Base class for the source autocomplete services.\n */\nexport class AutocompleteServiceBase {\n\t/**\n\t * @param {String} text\n\t * @param {AutocompleteServiceParams} params\n\t */\n\t// eslint-disable-next-line no-unused-vars\n\tautocomplete(text: string, params: AutocompleteServiceParams): Promise<Array<Location>, Error> {\n\t\tthrow new Error('Method autocomplete() Must be implemented');\n\t}\n}\n","import { md5 } from 'main.md5';\n\nconst MAX_ITEMS_CNT = 100;\nconst MAX_SIZE_IN_BYTES = 5 * 1024 * 1024;\nconst CACHE_TTL = 3600;\n\nexport default class AutocompleteCache\n{\n\tstatic set(sourceCode: string, params: Object, data: Object)\n\t{\n\t\tconst results = AutocompleteCache.#getAll(sourceCode);\n\n\t\tresults.push({\n\t\t\thash: AutocompleteCache.#makeParamsHash(params),\n\t\t\tdata: data,\n\t\t});\n\n\t\tBX.localStorage.set(\n\t\t\tAutocompleteCache.#getStorageName(sourceCode),\n\t\t\tAutocompleteCache.#getResultsToStore(results),\n\t\t\tCACHE_TTL\n\t\t);\n\t}\n\n\tstatic get(sourceCode: string, params: Object): ?Object\n\t{\n\t\tconst hash = AutocompleteCache.#makeParamsHash(params);\n\t\tconst results = AutocompleteCache.#getAll(sourceCode);\n\n\t\tfor (const result of results)\n\t\t{\n\t\t\tif (result && result.hash === hash)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic #getResultsToStore(results: Array): Array\n\t{\n\t\tif (new Blob([JSON.stringify(results)]).size > MAX_SIZE_IN_BYTES)\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\tif (results.length > MAX_ITEMS_CNT)\n\t\t{\n\t\t\treturn results.slice(results.length - MAX_ITEMS_CNT);\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tstatic #getAll(sourceCode: string): Array\n\t{\n\t\tconst currentResults = BX.localStorage.get(AutocompleteCache.#getStorageName(sourceCode));\n\n\t\treturn Array.isArray(currentResults) ? currentResults : [];\n\t}\n\n\tstatic #makeParamsHash(params: Object): string\n\t{\n\t\treturn md5(JSON.stringify(params));\n\t}\n\n\tstatic #getStorageName(sourceCode: string): string\n\t{\n\t\treturn `location${sourceCode}AutocompleteCache`;\n\t}\n}\n","import {Location} from 'location.core';\n\nexport type BasePhotoServiceRequestPhotosPropsType = {\n\tlocation: Location,\n\tthumbnailHeight: number,\n\tthumbnailWidth: number,\n\tmaxPhotoCount: number\n}\n\nexport default class PhotoServiceBase\n{\n\trequestPhotos(props: BasePhotoServiceRequestPhotosPropsType): Promise\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n}","import { EventEmitter } from 'main.core.events';\nimport {\n\tLocation,\n\tLocationType,\n} from 'location.core';\n\n/**\n * Base class for source maps\n */\nexport default class MapBase extends EventEmitter\n{\n\tconstructor()\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Location.Core.MapBase');\n\t}\n\n\trender(props: Object): Promise\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tset location(location: Location): void\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tpanTo(latitude: string, longitude: string): void\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tset mode(mode: string): void\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tset zoom(zoom: number): void\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tstatic getZoomByLocation(location: ?Location): number\n\t{\n\t\tconst defaultZoom = 18;\n\t\tif (!location)\n\t\t{\n\t\t\treturn defaultZoom;\n\t\t}\n\n\t\tconst locationType = location.type;\n\t\tif (locationType <= 0)\n\t\t{\n\t\t\treturn defaultZoom;\n\t\t}\n\n\t\tif (locationType < LocationType.COUNTRY)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\telse if (locationType === LocationType.COUNTRY)\n\t\t{\n\t\t\treturn 4;\n\t\t}\n\t\telse if (locationType <= LocationType.ADM_LEVEL_1)\n\t\t{\n\t\t\treturn 6;\n\t\t}\n\t\telse if (locationType <= LocationType.LOCALITY)\n\t\t{\n\t\t\treturn 11;\n\t\t}\n\t\telse if (locationType <= LocationType.STREET)\n\t\t{\n\t\t\treturn 16;\n\t\t}\n\n\t\treturn defaultZoom;\n\t}\n\n\tonLocationChangedEventSubscribe(listener: function): void\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tonMapShow()\n\t{\n\n\t}\n\n\tdestroy()\n\t{\n\n\t}\n}\n","import AutocompleteServiceBase from \"./autocompleteservicebase\";\nimport PhotoServiceBase from \"./photoservicebase\";\nimport MapBase from \"./mapbase\";\n\n/**\n * Base class for the sources\n */\nexport default class SourceBase\n{\n\tget sourceCode(): string\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tget map(): MapBase\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tget autocompleteService(): AutocompleteServiceBase\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tget photoService(): PhotoServiceBase\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n\n\tget geocodingService()\n\t{\n\t\tthrow new Error('Must be implemented');\n\t}\n}","import {Location} from 'location.core';\n\n/**\n * Base class for the source geocoding service\n */\nexport default class GeocodingServiceBase\n{\n\tgeocode(addressString: string): Promise<Array<Location>, Error>\n\t{\n\t\tif(!addressString)\n\t\t{\n\t\t\treturn Promise.resolve([]);\n\t\t}\n\n\t\treturn this.geocodeConcrete(addressString);\n\t}\n\n\tgeocodeConcrete(addressString: string): Promise<Array<Location>, Error>\n\t{\n\t\tthrow new Error('Method geocodeConcrete() must be implemented');\n\t}\n}","export default class ControlMode\n{\n\tstatic get edit()\n\t{\n\t\treturn 'edit';\n\t}\n\n\tstatic get view()\n\t{\n\t\treturn 'view';\n\t}\n\n\tstatic isValid(mode: string)\n\t{\n\t\treturn mode === ControlMode.edit || mode === ControlMode.view;\n\t}\n}","export default class LocationFieldType\n{\n\tstatic POSTAL_CODE = 50;\n\tstatic ISO_3166_1_ALPHA_2 = 1000;\n}","export class SourceCreationError extends Error\n{\n}\n\nexport class MethodNotImplemented extends Error\n{\n}\n","import {EventEmitter} from 'main.core.events';\n\nexport default class ErrorPublisher extends EventEmitter\n{\n\tstatic #instance = null;\n\tstatic #onErrorEvent = 'onError';\n\n\tstatic getInstance()\n\t{\n\t\tif(ErrorPublisher.#instance === null)\n\t\t{\n\t\t\tErrorPublisher.#instance = new ErrorPublisher();\n\t\t}\n\n\t\treturn ErrorPublisher.#instance;\n\t}\n\n\tconstructor()\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Location.Core.ErrorPublisher');\n\t}\n\n\tnotify(errors: Error[])\n\t{\n\t\tthis.emit(ErrorPublisher.#onErrorEvent, {errors});\n\t}\n\n\tsubscribe(listener)\n\t{\n\t\tsuper.subscribe(ErrorPublisher.#onErrorEvent, listener);\n\t}\n}","import JsonConverter from '../entity/address/converter/jsonconverter';\nimport Address from '../entity/address';\n\nexport default class Storage\n{\n\t#lastAddressLocalStorageKey = `bitrixLocationLastAddress`;\n\n\tstatic #instance = null;\n\n\tstatic getInstance()\n\t{\n\t\tif(Storage.#instance === null)\n\t\t{\n\t\t\tStorage.#instance = new Storage();\n\t\t}\n\n\t\treturn Storage.#instance;\n\t}\n\n\tset lastAddress(address: ?Address)\n\t{\n\t\tif (address)\n\t\t{\n\t\t\tBX.localStorage.set(this.#lastAddressLocalStorageKey, {'json': address.toJson()}, 86400 * 30);\n\t\t}\n\t}\n\tget lastAddress()\n\t{\n\t\tconst lastAddress = BX.localStorage.get(this.#lastAddressLocalStorageKey);\n\t\tif (lastAddress && lastAddress['json'])\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn JsonConverter.convertJsonToAddress(JSON.parse(lastAddress['json']));\n\t\t\t}\n\t\t\tcatch(e) {}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n","/**\n * Base class for the working with latitude and longitude\n */\nexport default class Point\n{\n\t/** {String} */\n\t#latitude;\n\t/** {String} */\n\t#longitude;\n\n\tconstructor(latitude: string, longitude: string)\n\t{\n\t\tthis.#latitude = latitude;\n\t\tthis.#longitude = longitude;\n\t}\n\n\tget latitude(): string\n\t{\n\t\treturn this.#latitude;\n\t}\n\n\tget longitude(): string\n\t{\n\t\treturn this.#longitude;\n\t}\n\n\ttoArray(): Array\n\t{\n\t\treturn [this.latitude, this.longitude];\n\t}\n\n\tstatic fromJson(jsonData): Point\n\t{\n\t\treturn new Point(jsonData.latitude, jsonData.longitude);\n\t}\n}","export default class DistanceCalculator\n{\n\t/**\n\t * @param {number} lat1\n\t * @param {number} lon1\n\t * @param {number} lat2\n\t * @param {number} lon2\n\t * @returns {number}\n\t */\n\tstatic getDistanceFromLatLonInKm(lat1: number, lon1: number, lat2: number, lon2: number): number\n\t{\n\t\tconst R = 6371; // Radius of the earth in km\n\t\tconst dLat = DistanceCalculator.deg2rad(lat2 - lat1);\n\t\tconst dLon = DistanceCalculator.deg2rad(lon2 - lon1);\n\t\tconst a =\tMath.sin(dLat / 2) * Math.sin(dLat / 2)\n\t\t\t+ Math.cos(DistanceCalculator.deg2rad(lat1)) * Math.cos(DistanceCalculator.deg2rad(lat2))\n\t\t\t* Math.sin(dLon / 2) * Math.sin(dLon / 2);\n\n\t\tconst c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\treturn R * c;\n\t}\n\n\t/**\n\t * @param {number} deg\n\t * @returns {number}\n\t */\n\tstatic deg2rad(deg: number): number\n\t{\n\t\treturn deg * (Math.PI / 180);\n\t}\n}\n"],"names":["Field","props","type","Error","parseInt","FieldCollection","_classPrivateFieldInitSpec","fields","isFieldExists","field","types","Object","keys","sort","a","b","result","length","addressFieldCollection","upTo","areEqual","Array","isArray","setField","addressFieldCollection1","addressFieldCollection2","getField","value","AddressField","AddressFieldCollection","AddressLink","entityId","entityType","AddressLinkCollection","links","link","push","addLink","FormatField","name","description","FormatFieldCollection","fieldsData","forEach","data","LocationType","AddressType","FormatTemplate","template","FormatTemplateCollection","templateData","hasOwnProperty","setTemplate","isTemplateExists","FormatTemplateType","Format","Type","isUndefined","languageId","TypeError","code","templateAutocomplete","templateAddressLine1","delimiter","fieldForUnRecognized","UNKNOWN","fieldCollection","isObject","initFields","collection","templateCollection","DEFAULT","getTemplate","STR_DELIMITER_PLACEHOLDER","REGEX_COMMA_AMONG_EMPTY_SPACE","REGEX_GROUP_DELIMITER","REGEX_GROUP_FIELD_TEXT","REGEX_GROUP_FIELD_NAME","REGEX_GROUP_FIELD_LIST_END","REGEX_GROUP_END","REGEX_PART_FROM_DELIMITER_TO_FIELD_LIST","REGEX_GROUP_PART_BEFORE_FIELDS","ERR_PARSE_GROUP_START_POSITION","ERR_PARSE_GROUP_START","ERR_PARSE_GROUP_DELIMITER","ERR_PARSE_PART_FROM_DELIMITER_TO_FIELD_LIST","ERR_PARSE_GROUP_FIELD_TEXT","ERR_PARSE_GROUP_FIELD_NAME","ERR_PARSE_GROUP_FIELD","ERR_PARSE_GROUP_FIELD_LIST","ERR_PARSE_GROUP_FIELD_LIST_DELIMITER","ERR_PARSE_GROUP_FIELD_LIST_END","ERR_PARSE_GROUP_END","ERR_PARSE_GROUP","StringTemplateConverter","htmlEncode","format","context","errorCodes","getErrorCodes","errors","i","isPlainObject","errorInfo","needHeader","paramName","paramValue","needPrint","isString","isNumber","isFloat","isBoolean","templateValue","replace","clearContextError","clearContextInfo","text","delimiterStartPosition","regEx","RegExp","lastIndex","matches","exec","index","unescapeText","substr","addContextError","textBlockStartPosition","fieldName","parts","split","namePart","modifiersPart","address","fieldModifiers","getFieldValue","indexOf","toUpperCase","fieldNameStartPosition","fieldParts","splitFieldName","fieldValue","getAddressFieldValue","markerStartPosition","fieldInfo","fieldStartPosition","parseFieldText","unshiftError","clearContextInfoAndError","parseFieldName","parseGroup","parseFieldListDelimiter","parseFieldListEnd","addContextErrors","fieldListStartPosition","fieldValues","isFieldListEnd","parseField","startSearchPosition","groupStartPosition","delimiterValue","parseGroupStart","parseGroupDelimiter","parseGroupFieldList","parseGroupEnd","Set","join","reg","blocks","position","lastBlockIndex","lastBlock","info","unshift","splice","templateLength","blockStartPosition","blockLength","appendTextBlock","appendGroupBlock","createContext","parseBlocks","temp","Text","encode","templateConverter","convert","fieldType","localityValue","LOCALITY","localityValueUpper","targetValueUpper","targetValueSubstr","StringConverter","strategyType","contentType","STRATEGY_TYPE_TEMPLATE","STRATEGY_TYPE_TEMPLATE_COMMA","STRATEGY_TYPE_TEMPLATE_NL","STRATEGY_TYPE_TEMPLATE_BR","convertAddressToStringTemplate","STRATEGY_TYPE_FIELD_SORT","fieldSorter","convertAddressToStringByField","STRATEGY_TYPE_FIELD_TYPE","sortResult","needHtmlEncode","CONTENT_TYPE_HTML","BX","debug","Address","values","JsonConverter","jsonData","obj","id","latitude","longitude","location","JSON","parse","toJson","stringify","map","entries","setFieldValue","Location","convertAddressToJson","console","error","strategy","convertAddressToString","locationObj","getMaxFieldType","clearLinks","LocationField","LocationFieldCollection","LocationObjectConverter","externalId","sourceCode","LocationJsonConverter","initData","convertLocationToObject","convertLocationToJson","addressObj","ActionRunner","path","action","ajax","runAction","BaseRepository","_path","actionRunner","response","status","message","LocationRepository","_classPrivateMethodInitSpec","run","then","processResponse","bind","_classPrivateMethodGet","locationId","collectionJsonData","locationData","convertJsonToLocation","AddressRepository","addressId","convertJsonToAddress","FormatRepository","convertFormatCollection","formatCode","convertFormatData","formatDataCollection","formatData","SourceRepository","AutocompleteServiceBase","params","MAX_ITEMS_CNT","MAX_SIZE_IN_BYTES","CACHE_TTL","AutocompleteCache","results","hash","localStorage","set","Blob","size","slice","currentResults","get","md5","PhotoServiceBase","MapBase","setEventNamespace","listener","mode","zoom","defaultZoom","locationType","COUNTRY","ADM_LEVEL_1","STREET","EventEmitter","SourceBase","GeocodingServiceBase","addressString","Promise","resolve","geocodeConcrete","ControlMode","edit","view","LocationFieldType","SourceCreationError","MethodNotImplemented","ErrorPublisher","emit","Storage","lastAddress","e","_classStaticPrivateFieldSpecGet","_classStaticPrivateFieldSpecSet","Point","DistanceCalculator","lat1","lon1","lat2","lon2","R","dLat","deg2rad","dLon","Math","sin","cos","c","atan2","sqrt","deg","PI"],"mappings":";;;;;;;;KAAqBA,KAAK;GAIzB,eAAYC,KAAK,EACjB;KAAA;KAAA;OAAA;OAAA;;KACC,IAAG,OAAOA,KAAK,CAACC,IAAI,KAAK,WAAW,EACpC;OACC,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;;KAG9C,sCAAI,SAASC,QAAQ,CAACH,KAAK,CAACC,IAAI,CAAC;;GACjC;KAAA;KAAA,oBAGD;OACC,yCAAO,IAAI;;;GACX;CAAA;;;;;;;ACjBF,CAA4B;CAAA,IAEPG,eAAe;GAInC,2BACA;KAAA,IADYJ,KAAK,uEAAG,EAAE;KAAA;KAAAK;OAAA;OAAA,OAFZ;;KAIT,IAAI,CAACC,MAAM,GAAGN,KAAK,CAACM,MAAM,GAAGN,KAAK,CAACM,MAAM,GAAG,EAAE;;GAC9C;KAAA;;CAuBF;CACA;CACA;CACA;KAJC,8BAKcL,IAAI,EAClB;OACC,OAAO,OAAO,sCAAI,WAASA,IAAI,CAAC,KAAK,WAAW;;;KAChD;KAAA,yBAEQA,IAAI,EACb;OACC,OAAO,IAAI,CAACM,aAAa,CAACN,IAAI,CAAC,GAAG,sCAAI,WAASA,IAAI,CAAC,GAAG,IAAI;;;KAC3D;KAAA,yBAEQO,K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