@topvisor/ui 1.3.5-3 → 1.3.5-5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/.chunks/{core-DF7fuQev.es.js → core-CaWxDXrZ.es.js} +4 -4
  2. package/.chunks/{core-DF7fuQev.es.js.map → core-CaWxDXrZ.es.js.map} +1 -1
  3. package/.chunks/{core-BS_ygt0h.amd.js → core-DmO1i1Ua.amd.js} +2 -2
  4. package/.chunks/{core-BS_ygt0h.amd.js.map → core-DmO1i1Ua.amd.js.map} +1 -1
  5. package/.chunks/{datepicker-BYLW8X5k.amd.js → datepicker-CPrHVH4x.amd.js} +2 -2
  6. package/.chunks/{datepicker-BYLW8X5k.amd.js.map → datepicker-CPrHVH4x.amd.js.map} +1 -1
  7. package/.chunks/{datepicker-BVIBaChw.es.js → datepicker-J8Zg9mKt.es.js} +2 -2
  8. package/.chunks/{datepicker-BVIBaChw.es.js.map → datepicker-J8Zg9mKt.es.js.map} +1 -1
  9. package/.chunks/{dialog_selectorRegions-D5DOxBQO.es.js → dialog_selectorRegions-DoEjgXtb.es.js} +4 -4
  10. package/.chunks/{dialog_selectorRegions-D5DOxBQO.es.js.map → dialog_selectorRegions-DoEjgXtb.es.js.map} +1 -1
  11. package/.chunks/{dialog_selectorRegions-CaR2-Qo2.amd.js → dialog_selectorRegions-DzufTzj9.amd.js} +2 -2
  12. package/.chunks/{dialog_selectorRegions-CaR2-Qo2.amd.js.map → dialog_selectorRegions-DzufTzj9.amd.js.map} +1 -1
  13. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-B5rYBKgA.amd.js → dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js} +2 -2
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-B5rYBKgA.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js.map} +1 -1
  15. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-CPByl0SB.es.js → dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js} +2 -2
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-CPByl0SB.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js.map} +1 -1
  17. package/.chunks/{forms-BrdvrjiZ.es.js → forms-COXAfg9G.es.js} +53 -51
  18. package/.chunks/{forms-BrdvrjiZ.es.js.map → forms-COXAfg9G.es.js.map} +1 -1
  19. package/.chunks/{forms-CzUjrBXG.amd.js → forms-DXX5M4DO.amd.js} +3 -3
  20. package/.chunks/{forms-CzUjrBXG.amd.js.map → forms-DXX5M4DO.amd.js.map} +1 -1
  21. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js +199 -0
  22. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js.map +1 -0
  23. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js +2 -0
  24. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js.map +1 -0
  25. package/.chunks/{menu.vue_vue_type_style_index_0_lang-BNr8VcFM.es.js → menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js} +2 -2
  26. package/.chunks/{menu.vue_vue_type_style_index_0_lang-BNr8VcFM.es.js.map → menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js.map} +1 -1
  27. package/.chunks/{menu.vue_vue_type_style_index_0_lang-jnHbXDIR.amd.js → menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js} +2 -2
  28. package/.chunks/{menu.vue_vue_type_style_index_0_lang-jnHbXDIR.amd.js.map → menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js.map} +1 -1
  29. package/.chunks/{notice-CzWMWg_D.amd.js → notice-CSGn_jTM.amd.js} +2 -2
  30. package/.chunks/{notice-CzWMWg_D.amd.js.map → notice-CSGn_jTM.amd.js.map} +1 -1
  31. package/.chunks/{notice-BPgkjMG1.es.js → notice-P7CXfEuX.es.js} +2 -2
  32. package/.chunks/{notice-BPgkjMG1.es.js.map → notice-P7CXfEuX.es.js.map} +1 -1
  33. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +36 -0
  34. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +1 -0
  35. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +2 -0
  36. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +1 -0
  37. package/.chunks/{page.vue_vue_type_script_setup_true_lang-XMwkQHNU.es.js → page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js} +4 -4
  38. package/.chunks/{page.vue_vue_type_script_setup_true_lang-XMwkQHNU.es.js.map → page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js.map} +1 -1
  39. package/.chunks/{page.vue_vue_type_script_setup_true_lang-C-BJRiFc.amd.js → page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js} +2 -2
  40. package/.chunks/{page.vue_vue_type_script_setup_true_lang-C-BJRiFc.amd.js.map → page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js.map} +1 -1
  41. package/.chunks/popup-CF4k7j3U.amd.js +2 -0
  42. package/.chunks/popup-CF4k7j3U.amd.js.map +1 -0
  43. package/.chunks/{popup-do4HUI7u.es.js → popup-G7FYKscC.es.js} +116 -90
  44. package/.chunks/popup-G7FYKscC.es.js.map +1 -0
  45. package/.chunks/{utils-B6aJagiK.es.js → utils-CWm0zAtM.es.js} +3 -3
  46. package/.chunks/{utils-B6aJagiK.es.js.map → utils-CWm0zAtM.es.js.map} +1 -1
  47. package/.chunks/{utils-BgVG2kmp.amd.js → utils-D505nRsu.amd.js} +2 -2
  48. package/.chunks/{utils-BgVG2kmp.amd.js.map → utils-D505nRsu.amd.js.map} +1 -1
  49. package/.chunks/{utils-BqT8hS8L.amd.js → utils-DmxcQpWA.amd.js} +2 -2
  50. package/.chunks/{utils-BqT8hS8L.amd.js.map → utils-DmxcQpWA.amd.js.map} +1 -1
  51. package/.chunks/{utils-DyhMNhnz.es.js → utils-Rbz9mxy6.es.js} +2 -2
  52. package/.chunks/{utils-DyhMNhnz.es.js.map → utils-Rbz9mxy6.es.js.map} +1 -1
  53. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CVsiIZz5.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js} +2 -2
  54. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CVsiIZz5.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js.map} +1 -1
  55. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Bo064qPK.es.js → widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js} +2 -2
  56. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Bo064qPK.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js.map} +1 -1
  57. package/assets/forms.css +1 -1
  58. package/assets/listItem.css +1 -1
  59. package/charts/charts.amd.js +1 -1
  60. package/charts/charts.js +1 -1
  61. package/core/app.amd.js +1 -1
  62. package/core/app.js +5 -5
  63. package/dialog/dialog.amd.js +1 -1
  64. package/dialog/dialog.js +2 -2
  65. package/forms/forms.amd.js +1 -1
  66. package/forms/forms.js +1 -1
  67. package/formsExt/formsExt.amd.js +1 -1
  68. package/formsExt/formsExt.amd.js.map +1 -1
  69. package/formsExt/formsExt.js +387 -388
  70. package/formsExt/formsExt.js.map +1 -1
  71. package/layout/layout.amd.js +1 -1
  72. package/layout/layout.js +1 -1
  73. package/package.json +1 -1
  74. package/popup/popup.amd.js +1 -1
  75. package/popup/popup.amd.js.map +1 -1
  76. package/popup/popup.js +39 -34
  77. package/popup/popup.js.map +1 -1
  78. package/popup/worker.amd.js +1 -1
  79. package/popup/worker.amd.js.map +1 -1
  80. package/popup/worker.js +24 -20
  81. package/popup/worker.js.map +1 -1
  82. package/project/project.amd.js +1 -1
  83. package/project/project.amd.js.map +1 -1
  84. package/project/project.js +26 -25
  85. package/project/project.js.map +1 -1
  86. package/src/api/api/types/ext.d.ts +2 -2
  87. package/src/components/forms/button/types.d.ts +6 -0
  88. package/src/components/forms/input/input.vue.d.ts +1 -1
  89. package/src/components/forms/input/types.d.ts +1 -1
  90. package/src/components/forms/inputDate/inputDate.vue.d.ts +1 -1
  91. package/src/components/formsExt/libs/optionGroup/types.d.ts +1 -1
  92. package/src/components/formsExt/selector2/composables/useAPI.d.ts +3 -2
  93. package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -1
  94. package/src/components/formsExt/selector2/selector2.vue.d.ts +2 -0
  95. package/src/components/formsExt/selector2/types.d.ts +18 -1
  96. package/src/components/formsExt/selector2/utils.d.ts +1 -0
  97. package/src/components/popup/lib/popup.d.ts +14 -2
  98. package/src/components/popup/lib/worker.d.ts +1 -1
  99. package/src/components/popup/popup/opener/opener.vue.d.ts +17 -0
  100. package/src/components/popup/popup/opener/types.d.ts +51 -0
  101. package/src/components/popup/popup/opener.vue.d.ts +1 -1
  102. package/src/components/popup/popup/types.d.ts +1 -45
  103. package/src/components/project/tagSelector/utils/el.d.ts +1 -1
  104. package/tabsView/tabsView.amd.js +1 -1
  105. package/tabsView/tabsView.js +2 -2
  106. package/utils/clipboard.amd.js +1 -1
  107. package/utils/clipboard.js +1 -1
  108. package/utils/date.amd.js +1 -1
  109. package/utils/date.js +1 -1
  110. package/utils/device.amd.js +1 -1
  111. package/utils/device.js +1 -1
  112. package/utils/lodash.amd.js +1 -1
  113. package/utils/lodash.js +1 -1
  114. package/utils/price.amd.js +1 -1
  115. package/utils/price.js +1 -1
  116. package/utils/searchers.amd.js +1 -1
  117. package/utils/searchers.js +3 -3
  118. package/utils/string.amd.js +1 -1
  119. package/utils/string.js +1 -1
  120. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DZ6ExJKC.es.js +0 -192
  121. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DZ6ExJKC.es.js.map +0 -1
  122. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-_sniT1lq.amd.js +0 -2
  123. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-_sniT1lq.amd.js.map +0 -1
  124. package/.chunks/popup-UOJ-t8-v.amd.js +0 -2
  125. package/.chunks/popup-UOJ-t8-v.amd.js.map +0 -1
  126. package/.chunks/popup-do4HUI7u.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/selectorCompetitors/composables.ts","../../src/components/project/selectorRegion/utils/consts.ts","../../src/components/project/selectorRegion/utils/utils.ts","../../src/components/project/selectorRegion/composables/selectSearcher.ts","../../src/components/project/selectorRegion/composables/selectRegion.ts","../../src/components/project/selectorRegion/composables/compare.ts","../../src/components/project/selectorRegion/composables/selectorRegion.ts","../../src/components/project/selectorRegion/selectorRegion.vue","../../src/components/project/tagSelector/utils/utils.ts","../../src/components/project/tagSelector/utils/el.ts","../../src/components/project/tagSelector/tagsDefaults.ts","../../src/components/project/tagSelector/tagIcon/tagIcon.vue","../../src/components/project/tagSelector/popupListItem/tagPopupListItem.vue","../../src/components/project/tagSelector/popupOpener/popupOpener.vue","../../src/components/project/tagSelector/tagSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './types';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\nimport { useI18n } from '@/core/plugins/i18n';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: useI18n().Common.Select_all,\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>\n","import type { MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\nimport type { Competitor, Item } from '@/components/project/selectorCompetitors/types';\n\nexport const useItemsFromCompetitors = (competitors: MaybeRefOrGetter<Competitor[]>, projectId: MaybeRefOrGetter<number>) => {\n\treturn computed(() => {\n\t\tconst activeCompetitors = toValue(competitors).filter(competitor => competitor.on >= 0 || competitor.id === projectId);\n\n\t\tconst items: Item[] = activeCompetitors.map(competitor => {\n\t\t\treturn {\n\t\t\t\tvalue: competitor.id,\n\t\t\t\ttitle: competitor.url + ` [${competitor.id}]`,\n\t\t\t\ticon: competitor.id === toValue(projectId) ? '' : '',\n\t\t\t\tcontent: competitor.name,\n\t\t\t};\n\t\t});\n\n\t\treturn items;\n\t});\n};\n","import type { Region, SearcherIndexed } from '../types';\nimport { useI18n } from '@/core/plugins/i18n';\n\n/**\n * Ключ ПС - для выбора нескольких ПС или регионов\n */\nexport const searhcerCompareKey = -1;\n\n/**\n * Ключ ПС или индекса Региона, используется для ПС или Региона, не настроенных в проекте\n *\n * Также, используется для API с возможностью не указывать регион, см. `props.autoRegion`\n */\nexport const dummyIndex = -2;\n\n/**\n * Регион - без региона\n */\nexport const globalRegionIndex = -1;\n\nexport const searchersNames = {\n\t0: 'Yandex',\n\t1: 'Google',\n\t4: 'YouTube',\n\t5: 'Bing',\n\t7: 'Seznam',\n\t8: 'AppStore',\n\t9: 'GoogleStore',\n\t20: 'Yandex.com',\n\t21: 'Yandex.com.tr',\n};\n\nexport const regionUndefined: Region = {\n\tkey: dummyIndex,\n\tname: '--',\n\tindex: dummyIndex,\n};\n\nexport const searcherUndefined: SearcherIndexed = {\n\tkey: dummyIndex,\n\tname: '--',\n\tregions: [regionUndefined],\n\tregionByIndex: new Map([[dummyIndex, regionUndefined]]),\n};\n\nconst regionAuto: Region = {\n\tkey: dummyIndex,\n\tname: 'Autoselect',\n\tindex: dummyIndex,\n};\n\nconst searcherAuto: SearcherIndexed = {\n\tkey: dummyIndex,\n\tname: 'Autoselect',\n\tregions: [regionAuto],\n\tregionByIndex: new Map([[dummyIndex, regionAuto]]),\n};\n\nconst regionGlobal: Region = {\n\tcountryCode: '00',\n\tdepth: 1,\n\tdevice: 0,\n\tkey: globalRegionIndex,\n\tindex: globalRegionIndex,\n\tlang: 'ru',\n\tname: 'Without region',\n};\n\nexport const getRegionAuto = () => {\n\tregionAuto.name = useI18n().Common.Autoselect!;\n\n\treturn regionAuto;\n};\n\nexport const getSearcherAuto = () => {\n\tgetRegionAuto();\n\n\tsearcherAuto.name = useI18n().Common.Autoselect!;\n\tconsole.log(searcherAuto);\n\n\treturn searcherAuto;\n};\n\nexport const getRegionGlobal = () => {\n\tregionGlobal.name = useI18n().Keywords.Without_region!;\n\n\treturn regionGlobal;\n};\n","import type { Region, Searcher, SearcherByKey, SearcherIndexed } from '../types';\nimport { dummyIndex, getRegionGlobal, getSearcherAuto, searchersNames, searcherUndefined } from './consts';\nimport { useAsyncTopDialog } from '@/components/dialog/dialog/composables/utils';\n\n/**\n * Генерация Map ПС с Map регионов из массива searchers\n * - ключ для ПС - searcherKey\n * - ключ для региона - regionIndex\n *\n * Если поисковиков в списке нет, в список будет добавлен searcherUndefined\n *\n * Если регионов в списке нет, в список будет добавлен regionUndefined\n *\n * @param forFrequency - получить массив для просмотра частоты (или ставок)\n * @param autoRegion - добавить элемент с ключем -2, который в API заменяется на нужный ключ в зависимости от контекста\n * @param searchers - поисковики с регионами проекта, см.: get/projects_2/projects, show_searchers_and_regions = 1\n */\nexport const genSearcherByKey = (\n\tforFrequency: boolean = false,\n\tautoRegion: boolean = false,\n\tsearchers: Searcher[] = [],\n) => {\n\tlet searcherByKey: SearcherByKey;\n\n\tif (forFrequency) {\n\t\tsearcherByKey = genSearchersMapVolume(searchers);\n\t} else {\n\t\tsearcherByKey = genSearchersMapCommon(searchers);\n\t}\n\n\tif (autoRegion) searcherByKey.set(dummyIndex, getSearcherAuto());\n\tif (!searcherByKey.size) searcherByKey.set(dummyIndex, searcherUndefined);\n\n\treturn searcherByKey;\n};\n\n/**\n * Список ПС с регионами\n *\n * @param searchers\n * @param onlyEnabledRegions\n * @param forceSearchersKeys - ключи ПС, которые нееобходимо вывести в любом случае\n * @param forFrequency - для частоты будут выводиться только Яндекс, Google и Mail\n */\nconst genSearchersMapCommon = (\n\tsearchers: Searcher[],\n\tonlyEnabledRegions: boolean = true,\n\tforceSearchersKeys: Searcher['key'][] = [],\n\tforFrequency: boolean = false,\n) => {\n\tconst searcherByKey: Map<Searcher['key'], SearcherIndexed> = new Map();\n\n\t// настроенные ПС\n\tsearchers.forEach((searcher) => {\n\t\tif (!searcher.enabled) return;\n\t\tif (forFrequency && typeof searcher.key === 'number' && searcher.key > 1) return;\n\n\t\tconst searcherI = { ...searcher } as SearcherIndexed;\n\t\tsearcherI.regionByIndex = new Map();\n\n\t\tif (searcher.regions) {\n\t\t\tsearcher.regions.forEach((region: Region) => {\n\t\t\t\tif (onlyEnabledRegions && !region.enabled) return;\n\n\t\t\t\tconst regionI = { ...region };\n\t\t\t\tsearcherI.regionByIndex.set(regionI.index, regionI);\n\t\t\t});\n\t\t}\n\n\t\tif (!searcherI.regionByIndex.size && !forceSearchersKeys.length) {\n\t\t\t// searcherI.regionByIndex.set(regionUndefined.index, regionUndefined);\n\t\t}\n\n\t\tif (\n\t\t\t// режим вывода ПС без регионов\n\t\t\t!searcher.regions ||\n\n\t\t\t// есть включенные регионы\n\t\t\tsearcherI.regionByIndex.size ||\n\n\t\t\t// запрошен вывод конкретных ПС\n\t\t\tforceSearchersKeys.length\n\t\t) {\n\t\t\tif (typeof searcherI.key === 'number') searcherByKey.set(searcherI.key, searcherI);\n\t\t}\n\t});\n\n\t// дополнительные ПС\n\tforceSearchersKeys.forEach((searcherKey) => {\n\t\tif (searcherByKey.has(searcherKey)) return;\n\n\t\tconst searcherI: SearcherIndexed = {\n\t\t\tkey: searcherKey,\n\t\t\tname: searchersNames[searcherKey],\n\t\t\tregions: [],\n\t\t\tregionByIndex: new Map(),\n\t\t};\n\n\t\tsearcherByKey.set(searcherI.key, searcherI);\n\t});\n\n\treturn searcherByKey;\n};\n\n/**\n * Список ПС с регионами для проверки частоты (Яндекс, Google, Mail если добавлен в проект)\n *\n * @param searchers\n */\nconst genSearchersMapVolume = (searchers: Searcher[]) => {\n\tconst serarcherByKey = genSearchersMapCommon(searchers, false, [0, 1], true);\n\n\t// в Mail нет регионов\n\tif (serarcherByKey.has(2)) {\n\t\tconst searcherMail = serarcherByKey.get(2);\n\t\tif (searcherMail) searcherMail.regionByIndex = new Map();\n\t}\n\n\t// добавление глобального региона\n\tserarcherByKey.forEach((searcher) => {\n\t\tif (!searcher.regionByIndex) return;\n\n\t\tconst region = { ...getRegionGlobal() };\n\t\tsearcher.regionByIndex.set(region.index, region);\n\t});\n\n\treturn serarcherByKey;\n};\n\n/**\n * Поиск региона по заданному критерию из списка поисковиков проекта\n *\n * @param forFrequency - поиск региона для просмотра частоты или ставок\n * @param searchRegion - объект с параметрами региона, который следует найти\n * @param searchers\n */\nexport const findRegion = (forFrequency: boolean, searchRegion: Partial<Region>, searchers: Searcher[] = []) => {\n\tconst searcherByKey = genSearcherByKey(forFrequency, false, searchers);\n\n\tlet findedRegion: Region | undefined;\n\n\t// поиск ПС\n\tsearcherByKey.forEach((searcher) => {\n\t\tif (searchRegion.searcher_key !== undefined && searchRegion.searcher_key != searcher.key) return;\n\t\tif (!searcher.regions) return;\n\n\t\t// поиск региона\n\t\tsearcher.regions.forEach((region) => {\n\t\t\tif (findedRegion) return;\n\n\t\t\tif (searchRegion.key !== undefined && searchRegion.key != region.key) return;\n\t\t\tif (searchRegion.index !== undefined && searchRegion.index != region.index) return;\n\n\t\t\tif (!forFrequency) {\n\t\t\t\tif (searchRegion.lang !== undefined && searchRegion.lang != region.lang) return;\n\t\t\t\tif (searchRegion.device !== undefined && searchRegion.device != region.device) return;\n\t\t\t}\n\n\t\t\tregion.searcher_key = searcher.key;\n\t\t\tfindedRegion = region;\n\n\t\t\treturn false;\n\t\t});\n\n\t\tif (findedRegion) return false;\n\t});\n\n\treturn findedRegion;\n};\n\n/**\n * Открыть диалоговое окно с выбором нескольких регионов\n *\n * @see import('../dialog_selectorRegions/types').Props\n */\nexport const dialogSelectorRegions = useAsyncTopDialog(() => {\n\treturn import('@/components/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue');\n});\n","import { computed, type ComputedRef, ref } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport type { Props, SearcherByKey } from '../types';\nimport type { Option, Options } from '@/components/forms/select/types';\nimport { dummyIndex, searhcerCompareKey } from '../utils/consts';\nimport { getSearcherGIcon } from '@/core/utils/searchers';\n\n/**\n * Создание и управление реактивными переменными для выбора ПС\n *\n * @param props - входные props компонента\n * @param mapSearchers - Map ПС (реактивная)\n */\nexport const useSelectSearcher = (\n\tprops: Props,\n\tmapSearchers: ComputedRef<SearcherByKey>,\n) => {\n\tconst i18n = useI18n();\n\n\t/**\n\t * Ключ выбранной поисковой системы\n\t */\n\tconst searcherKey = ref(mapSearchers.value.keys().next().value ?? dummyIndex);\n\n\t/**\n\t * Коллекция опций для выбора ПС\n\t */\n\tconst optionBySearcherKey = computed(() => {\n\t\tconst res: Options = new Map();\n\t\tmapSearchers.value.forEach((searcher) => {\n\t\t\tlet option: Option = {\n\t\t\t\tvalue: searcher.key,\n\t\t\t\ttitle: searcher.name,\n\t\t\t};\n\n\t\t\tif (props.addSearcherIcon) option.icon = getSearcherGIcon(searcher.key);\n\n\t\t\tres.set(searcher.key, option);\n\t\t});\n\n\t\t// добавить режим сравнения, если есть хотя бы одна ПС с одним регионом\n\t\tif (props.addCompare && !res.has(dummyIndex)) {\n\t\t\tconst dummyOption: Option = {\n\t\t\t\tvalue: '',\n\t\t\t\ttitle: '--------------------',\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t\tres.set(dummyOption.value, dummyOption);\n\n\t\t\tconst compareOption: Option = {\n\t\t\t\tvalue: searhcerCompareKey,\n\t\t\t\ttitle: i18n.Common.Compare!,\n\t\t\t};\n\t\t\tres.set(compareOption.value, compareOption);\n\t\t}\n\n\t\treturn res;\n\t});\n\n\treturn {\n\t\tsearcherKey,\n\t\toptionBySearcherKey,\n\t};\n};\n","import { computed, type ComputedRef, ref, watch } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { getDeviceGIcon, getLangLabel } from '@/core/utils/searchers';\nimport type { Option } from '@/components/forms/select/types';\nimport { dummyIndex } from '../utils/consts';\nimport type { Props, Region, SearcherIndexed } from '../types';\n\n/**\n * Создание и управление реактивными переменными для выбора региона\n *\n * @param props - входные props компонента\n * @param activeSearcherIndexed - объект активной поисковой системы (реактивная)\n */\nexport const useSelectRegion = (props: Props, activeSearcherIndexed: ComputedRef<SearcherIndexed>) => {\n\tconst i18n = useI18n();\n\n\t/**\n\t * Индекс выбранного региона\n\t */\n\tconst regionIndex = ref(dummyIndex);\n\n\tif (props.modelValue.length === 1) {\n\t\tregionIndex.value = props.modelValue[0];\n\t}\n\n\tif (regionIndex.value === dummyIndex) {\n\t\tif (props.forFrequency) {\n\t\t\t// в качетсве ключа используется region.key, а не region.index\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.values().next().value?.key ?? dummyIndex;\n\t\t} else {\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.keys().next().value ?? dummyIndex;\n\t\t}\n\t}\n\n\t/**\n\t * Коллекция опций для выбора региона\n\t */\n\tconst optionByRegionIndex = computed(() => {\n\t\tconst options = new Map<number, Option>();\n\n\t\tactiveSearcherIndexed.value.regionByIndex?.forEach((region) => {\n\t\t\tlet regionLabel = region.name;\n\n\t\t\t// на частоту в текущей версии устройство и язык не влияют\n\t\t\t// обратите внимание, в качетсве ключа используется region.key, а не region.index\n\t\t\tif (props.forFrequency) {\n\t\t\t\tconst option: Option = {\n\t\t\t\t\tvalue: region.key,\n\t\t\t\t\ttitle: regionLabel,\n\t\t\t\t};\n\t\t\t\tif (!options.has(region.key)) options.set(region.key, option);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (region.device) {\n\t\t\t\tregionLabel += ' (' + i18n.Common['Device_' + region.device] + ')';\n\t\t\t}\n\n\t\t\tconst langLabel = getLangLabel(activeSearcherIndexed.value.key || 0, region.lang ?? '');\n\t\t\tif (langLabel) regionLabel += ' / ' + langLabel;\n\n\t\t\tconst option: Option = {\n\t\t\t\tvalue: region.index,\n\t\t\t\ttitle: regionLabel,\n\t\t\t\ticon: region.device ? getDeviceGIcon(region.device) : undefined,\n\t\t\t};\n\n\t\t\toptions.set(region.index, option);\n\t\t});\n\n\t\treturn options;\n\t});\n\n\t/**\n\t * Выбор максимально похожего региона в новой коллекции регионов\n\t */\n\twatch(optionByRegionIndex, (optionByRegionIndex, oldOptionByRegionIndex) => {\n\t\tif (props.onlySearcher || regionIndex.value !== undefined && optionByRegionIndex.get(regionIndex.value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet newRegionIndex = optionByRegionIndex.keys().next().value as Region['index'];\n\t\tif (regionIndex.value === dummyIndex || newRegionIndex === dummyIndex) {\n\t\t\tregionIndex.value = newRegionIndex;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionName = (oldOptionByRegionIndex?.get(regionIndex.value) as Option)?.title || '';\n\t\tlet regionMatchLevel = -1;\n\t\tfor (const [index, option] of optionByRegionIndex.entries()) {\n\t\t\tconst title = (option as Option).title;\n\n\t\t\tif (typeof title !== 'string' || typeof index === 'string') {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// полное совпадение\n\t\t\tif (title === regionName) {\n\t\t\t\tnewRegionIndex = index;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst regexpDevice = new RegExp(` \\\\((${i18n.Common['Device_1']}|${i18n.Common['Device_2']})\\\\)`);\n\t\t\tlet regionNameCompare = regionName;\n\t\t\tlet regionMatchLevelI = 3;\n\n\t\t\t// без устройства\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\t// без языка\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\t// без устройства и без языка\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\n\t\t\t\tregionNameCompare = regionNameCompare.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\tif (title.indexOf(regionNameCompare) === -1) continue;\n\t\t\tif (regionMatchLevelI <= regionMatchLevel) continue;\n\n\t\t\tregionMatchLevel = regionMatchLevelI;\n\t\t\tnewRegionIndex = index;\n\t\t}\n\n\t\tregionIndex.value = newRegionIndex;\n\t});\n\n\treturn {\n\t\tregionIndex,\n\t\toptionByRegionIndex,\n\t};\n};\n","import { type ComputedRef, ref, watch } from 'vue';\nimport type { Props, SearcherByKey } from '../types';\n\n/**\n * Создание и управление реактивными переменными для сравнения\n *\n * @param props - входные props компонента\n * @param searcherByKey - Map ПС (реактивная)\n * @param allRegionsIndexes - Все доступные индексы регионов (реактивная)\n */\nexport const useCompare = (props: Props, searcherByKey: ComputedRef<SearcherByKey>, allRegionsIndexes: ComputedRef<Set<number>>) => {\n\t/**\n\t * Индексы регионов/ПС в сравнение\n\t */\n\tconst regionsIndexes = ref<number[]>([]);\n\n\t/**\n\t * Загрузка индексов регионов для сравнения\n\t *\n\t * Если в modelValue передано несколько регионов, они будут установлены как выбранные для сравнения\n\t */\n\tconst compareLoad = () => {\n\t\tif (props.onlySearcher && searcherByKey.value) {\n\t\t\tregionsIndexes.value = Array.from(searcherByKey.value.keys());\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionsIndexesSaved: Props['modelValue'] = [];\n\n\t\tif (props.modelValue.length > 1) {\n\t\t\tregionsIndexesSaved = [...props.modelValue];\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// загрузить индексы регионов, если они были сохранены\n\t\t\t\tregionsIndexesSaved = JSON.parse(\n\t\t\t\t\tlocalStorage.getItem('ui:project:regionSelector' + props.projectId + ':regionsIndexes') as string,\n\t\t\t\t) ?? [];\n\t\t\t} catch (e) {\n\n\t\t\t}\n\t\t}\n\n\t\t// убрать из сравнения регионы, которых нет в props.searchers\n\t\tif (regionsIndexesSaved.length) {\n\t\t\tregionsIndexesSaved = regionsIndexesSaved.filter((regionIndex) => {\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\n\t\t\t});\n\t\t}\n\n\t\t// если не сохранено ни одного региона, выбрать все регионы проекта\n\t\tif (!regionsIndexesSaved.length) {\n\t\t\tregionsIndexesSaved = Array.from(allRegionsIndexes.value);\n\t\t}\n\n\t\tregionsIndexes.value = [...regionsIndexesSaved];\n\t};\n\n\t/**\n\t * Сохранение выбранных регионов\n\t */\n\tconst compareSave = () => {\n\t\tif (regionsIndexes.value.length) {\n\t\t\tlocalStorage.setItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes', JSON.stringify(regionsIndexes.value));\n\t\t} else {\n\t\t\tlocalStorage.removeItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes');\n\t\t}\n\t};\n\n\twatch(regionsIndexes, () => {\n\t\tcompareSave();\n\t});\n\n\tif (props.addCompare) {\n\t\t// if (props.compareRegionsIndexes?.length) {\n\t\t// \tcompareRegionsIndexes.value = [...props.compareRegionsIndexes];\n\t\t// } else {\n\t\t// \tcompareLoad();\n\t\t// }\n\n\t\tcompareLoad();\n\t}\n\n\treturn {\n\t\tregionsIndexes,\n\t};\n};\n","import { computed, watch } from 'vue';\nimport { findRegion, genSearcherByKey } from '../utils/utils';\nimport { dummyIndex, globalRegionIndex, searcherUndefined, searhcerCompareKey } from '../utils/consts';\nimport type { Props, Region, SearcherIndexed } from '../types';\nimport { useSelectSearcher } from './selectSearcher';\nimport { useSelectRegion } from './selectRegion';\nimport { useCompare } from './compare';\n\n/**\n * Создание и управления рективными переменными компонента\n *\n * @param props - входные props компонента\n */\nexport const useSelectorRegion = (props: Props) => {\n\tconst searcherByKey = computed(() => {\n\t\treturn genSearcherByKey(props.forFrequency, props.autoRegion, props.searchers);\n\t});\n\n\tconst activeSearcherIndexed = computed(() => {\n\t\treturn searcherByKey.value.get(selectSearcher.searcherKey.value) || searcherUndefined;\n\t});\n\n\t/**\n\t * Все индексы регионов из searcherByKey\n\t *\n\t * Активность регионов определяется в searcherByKey\n\t */\n\tconst allRegionsIndexes = computed(() => {\n\t\tconst regionsIndexes = new Set<number>();\n\n\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\tsearcher.regionByIndex.forEach((region) => {\n\t\t\t\tif (region.index === globalRegionIndex) return;\n\t\t\t\tif (region.index === dummyIndex) return;\n\n\t\t\t\tregionsIndexes.add(region.index);\n\t\t\t});\n\t\t});\n\n\t\treturn regionsIndexes;\n\t});\n\n\tconst selectSearcher = useSelectSearcher(props, searcherByKey);\n\tconst selectRegion = useSelectRegion(props, activeSearcherIndexed);\n\tconst compare = useCompare(props, searcherByKey, allRegionsIndexes);\n\n\t// контроль за внешним изменением списка ПС\n\twatch(searcherByKey, () => {\n\t\t// возможные значения для сравнения регионов/пс\n\t\tif (props.onlySearcher) {\n\t\t\tcompare.regionsIndexes.value = Array.from(searcherByKey.value.keys());\n\t\t} else {\n\t\t\tcompare.regionsIndexes.value = compare.regionsIndexes.value.filter(regionIndex => {\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\n\t\t\t});\n\t\t}\n\n\t\tif (selectSearcher.searcherKey.value === searhcerCompareKey) return;\n\n\t\tlet newSearcherKey = searcherByKey.value.keys().next().value;\n\n\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\t// определить выбранную ПС\n\t\t\tif (props.onlySearcher && searcher.key === selectSearcher.searcherKey.value) {\n\t\t\t\tnewSearcherKey = selectSearcher.searcherKey.value;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tselectRegion.regionIndex.value &&\n\t\t\t\tsearcher.regionByIndex?.has(selectRegion.regionIndex.value)\n\t\t\t) {\n\t\t\t\tnewSearcherKey = searcher.key;\n\t\t\t}\n\n\t\t\t// выбрать первую ПС с выбранным регионом\n\t\t\tif (!props.onlySearcher) {\n\t\t\t\tlet regionsNewSearcher: SearcherIndexed['regionByIndex'] | undefined;\n\n\t\t\t\tif (newSearcherKey !== undefined) {\n\t\t\t\t\tregionsNewSearcher = searcherByKey.value.get(newSearcherKey)?.regionByIndex;\n\t\t\t\t}\n\n\t\t\t\tconst regionsCurrentSearcher = searcherByKey.value.get(searcher.key)?.regionByIndex;\n\t\t\t\tif (\n\t\t\t\t\tregionsNewSearcher?.has(dummyIndex) &&\n\t\t\t\t\t!regionsCurrentSearcher?.has(dummyIndex)\n\t\t\t\t) {\n\t\t\t\t\tnewSearcherKey = searcher.key;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// if (props.addCompare && !selectSearcher.optionBySearcherKey.value.has(dummyIndex)) {\n\t\t// \tif (!selectRegion.regionIndex.value && compare.regionsIndexes.value?.length) newSearcherKey = searhcerCompareKey;\n\t\t// }\n\n\t\t// if (props.onlySearcher && selectRegion.regionIndex.value !== dummyIndex) newSearcherKey = selectRegion.regionIndex.value;\n\n\t\tif (newSearcherKey !== undefined) {\n\t\t\tselectSearcher.searcherKey.value = newSearcherKey;\n\t\t}\n\n\t\tif (\n\t\t\tselectRegion.regionIndex.value !== undefined &&\n\t\t\t!(activeSearcherIndexed.value?.regionByIndex)?.has(selectRegion.regionIndex.value)\n\t\t) {\n\t\t\tselectRegion.regionIndex.value = activeSearcherIndexed.value?.regions?.keys().next().value as number;\n\t\t}\n\t}, { immediate: true });\n\n\tconst getSearcherKey = () => {\n\t\tif (selectSearcher.searcherKey.value === searhcerCompareKey || selectSearcher.searcherKey.value === dummyIndex) return;\n\n\t\treturn selectSearcher.searcherKey.value;\n\t};\n\n\tconst getRegionIndex = () => {\n\t\tif (props.onlySearcher) return;\n\n\t\tif (selectRegion.regionIndex.value === dummyIndex) return;\n\n\t\tlet res: Region['index'] | undefined = selectRegion.regionIndex.value;\n\n\t\t// в качестве ключа используется region.key\n\t\tif (props.forFrequency) {\n\t\t\tconst regionKey = selectRegion.regionIndex.value;\n\t\t\tconst region = findRegion(props.forFrequency, { searcher_key: getSearcherKey(), key: regionKey } as Region, props.searchers);\n\n\t\t\tres = region?.index;\n\t\t}\n\n\t\treturn res;\n\t};\n\n\t/**\n\t * Получить выбранную ПС\n\t */\n\tconst getSearcher = () => {\n\t\tconst searcherKey = getSearcherKey();\n\t\tif (searcherKey === undefined) return;\n\n\t\treturn searcherByKey.value.get(searcherKey);\n\t};\n\n\t/**\n\t * Получить выбранный регион\n\t */\n\tconst getRegion = () => {\n\t\tconst regionIndex = getRegionIndex();\n\t\tif (regionIndex === undefined) return;\n\n\t\treturn getSearcher()?.regionByIndex?.get(regionIndex);\n\t};\n\n\treturn {\n\t\tselectSearcher,\n\t\tselectRegion,\n\t\tcompare,\n\n\t\tsearcherByKey,\n\t\tallRegionsIndexes,\n\n\t\tgetSearcher,\n\t\tgetRegion,\n\t};\n};\n","<script setup lang=\"ts\">\nimport { watch } from 'vue';\nimport type { Props, Region } from './types';\nimport Select from '@/components/forms/select/select.vue';\nimport Button from '@/components/forms/button/button.vue';\nimport { useSelectorRegion } from './composables/selectorRegion';\nimport { dummyIndex, globalRegionIndex, searhcerCompareKey } from './utils/consts';\nimport { dialogSelectorRegions } from '@/components/project/selectorRegion/utils/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tsearchers: () => [],\n\t// compareRegionsIndexes: () => [],\n\taddSearcherIcon: true,\n\taddRegionIcon: true,\n\taddChanger: true,\n});\n\nconst model = defineModel<Props['modelValue']>({ required: true });\nconst modelSingle = defineModel<Props['modelValueSingle']>('modelValueSingle');\n\nconst {\n\tselectSearcher,\n\tselectRegion,\n\tcompare,\n\n\tsearcherByKey,\n\tallRegionsIndexes,\n\n\tgetSearcher,\n\tgetRegion,\n} = useSelectorRegion(props);\n\nconst onClickCompare = () => {\n\tconst regions: Region[] = [];\n\n\tsearcherByKey.value.forEach((searcher) => {\n\t\tif (!searcher.enabled) return;\n\n\t\tsearcher.regions.forEach((region) => {\n\t\t\tif (!region.enabled) return;\n\n\t\t\tregions.push(region);\n\t\t});\n\t});\n\n\tdialogSelectorRegions.open('selectorRegions', {\n\t\tregions,\n\t\tregionsIndexes: compare.regionsIndexes.value,\n\t\t'@update:regionsIndexes': (regionsIndexes: number[]) => compare.regionsIndexes.value = regionsIndexes,\n\t});\n};\n\nwatch([selectRegion.regionIndex, selectSearcher.searcherKey, compare.regionsIndexes], () => {\n\tif (selectSearcher.searcherKey.value === searhcerCompareKey && compare.regionsIndexes.value.length) {\n\t\tif (JSON.stringify(model.value) === JSON.stringify(compare.regionsIndexes.value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tmodel.value = [...compare.regionsIndexes.value];\n\t} else {\n\t\tif (props.onlySearcher) {\n\t\t\tmodel.value = [selectSearcher.searcherKey.value];\n\n\t\t\tif (selectSearcher.searcherKey.value === dummyIndex && !props.autoRegion) model.value.length = 0;\n\t\t} else {\n\t\t\tmodel.value = [selectRegion.regionIndex.value];\n\n\t\t\t// не добавлять несуществующий регион в результаты\n\t\t\tif (selectRegion.regionIndex.value === dummyIndex && !props.autoRegion) model.value.length = 0;\n\t\t}\n\t}\n\n\t// регионов нет\n\tif (!props.onlySearcher && !allRegionsIndexes.value.size) {\n\t\tselectSearcher.searcherKey.value = dummyIndex;\n\t}\n});\n\nif (modelSingle.value) {\n\twatch(modelSingle, () => {\n\t\tif (modelSingle.value) {\n\t\t\tmodel.value = [modelSingle.value];\n\t\t}\n\t}, { immediate: true });\n}\n\nwatch(model, () => {\n\tif (model.value[0]) {\n\t\tmodelSingle.value = model.value[0];\n\t}\n\n\t// проверка входных данных v-model на корректность\n\tif (props.onlySearcher) {\n\t\tif (\n\t\t\t!model.value.length ||\n\t\t\tmodel.value.length === 1 && !searcherByKey.value.has(model.value[0]) ||\n\t\t\tmodel.value.length === 1 && model.value[0] === dummyIndex && !props.autoRegion\n\t\t) {\n\t\t\tlet defaultKey: number | undefined = searcherByKey.value.keys().next().value;\n\n\t\t\t// запретить устанавливать несуществующий регион\n\t\t\tif (defaultKey === dummyIndex && !props.autoRegion) {\n\t\t\t\tdefaultKey = undefined;\n\n\t\t\t\tmodelSingle.value = dummyIndex;\n\t\t\t}\n\n\t\t\tif (defaultKey !== undefined) {\n\t\t\t\tmodel.value = [defaultKey];\n\t\t\t}else{\n\t\t\t\tmodel.value.length = 0;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tmodel.value.length > 1 &&\n\t\t\tJSON.stringify(model.value) !== JSON.stringify(compare.regionsIndexes.value)\n\t\t) {\n\t\t\tmodel.value = [...compare.regionsIndexes.value];\n\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tlet newModel = [...new Set(model.value)];\n\n\t\tlet defaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.keys().next().value;\n\t\tif (props.forFrequency) {\n\t\t\tdefaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.values().next().value?.key;\n\t\t}\n\n\t\t// запретить устанавливать несуществующий регион\n\t\tif (defaultIndex === dummyIndex && !props.autoRegion) {\n\t\t\tdefaultIndex = undefined;\n\n\t\t\tmodelSingle.value = dummyIndex;\n\t\t}\n\n\t\tif (!newModel.length) {\n\t\t\tif (defaultIndex !== undefined) {\n\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t}\n\t\t} else if (newModel.length === 1) {\n\t\t\tlet all = allRegionsIndexes.value;\n\n\t\t\tif (props.forFrequency) {\n\t\t\t\tall = new Set();\n\t\t\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\t\t\tsearcher.regionByIndex.forEach((region) => {\n\t\t\t\t\t\tif (region.index === globalRegionIndex) return;\n\t\t\t\t\t\tif (region.index === dummyIndex) return;\n\n\t\t\t\t\t\tall.add(region.key);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// убрано, так как dummyIndex запрещено выбирать в model\n\t\t\t// if (!all.has(newModel[0]) && newModel[0] !== dummyIndex) {\n\t\t\tif (!all.has(newModel[0])) {\n\t\t\t\tnewModel = [];\n\t\t\t\tif (defaultIndex !== undefined) {\n\t\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tnewModel = newModel.filter(index => allRegionsIndexes.value.has(index));\n\t\t\tif (!newModel.length && defaultIndex !== undefined) {\n\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (JSON.stringify(model.value) !== JSON.stringify(newModel)) {\n\t\t\tmodel.value = newModel;\n\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// входные данные v-model совпадают с внутренними значениями\n\tif (\n\t\tmodel.value.length === 1 &&\n\t\tmodel.value[0] === (props.onlySearcher ? selectSearcher.searcherKey.value : selectRegion.regionIndex.value)\n\t) {\n\t\treturn;\n\t}\n\n\t// if (\n\t// \tmodel.value.length > 1 &&\n\t// \tselectorSearcher.searcherKey.value === searhcerCompareKey &&\n\t// \tJSON.stringify(model.value) === JSON.stringify(selectorCompare.regionsIndexes.value)\n\t// ) {\n\t// \treturn;\n\t// }\n\n\t// обновление regionIndex, searcherKey, selectorCompare.regionsIndexes\n\tif (props.onlySearcher) {\n\t\t// if (!model.value.length) {\n\t\t// \tselectorSearcher.searcherKey.value = dummyIndex;\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\n\t\tif (model.value.length === 1) {\n\t\t\tselectSearcher.searcherKey.value = model.value[0];\n\n\t\t\treturn;\n\t\t}\n\n\t\tselectSearcher.searcherKey.value = searhcerCompareKey;\n\n\t\treturn;\n\t} else {\n\t\tif (!model.value.length) {\n\t\t\t// selectSearcher.searcherKey.value = dummyIndex;\n\t\t\t// selectRegion.regionIndex.value = dummyIndex;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (model.value.length === 1 && selectSearcher.searcherKey.value !== searhcerCompareKey) {\n\t\t\tselectRegion.regionIndex.value = model.value[0];\n\n\t\t\tlet newSearherKey: number | undefined;\n\t\t\tfor (const searcher of searcherByKey.value.values()) {\n\t\t\t\tfor (const region of searcher.regionByIndex.values()) {\n\t\t\t\t\tconst currentRegionIndex = props.forFrequency ? region.key : region.index;\n\t\t\t\t\tif (currentRegionIndex === selectRegion.regionIndex.value) {\n\t\t\t\t\t\tnewSearherKey = searcher.key;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (newSearherKey !== undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newSearherKey !== undefined) {\n\t\t\t\tselectSearcher.searcherKey.value = newSearherKey;\n\t\t\t}\n\t\t} else {\n\t\t\tselectSearcher.searcherKey.value = searhcerCompareKey;\n\t\t\tcompare.regionsIndexes.value = [...model.value];\n\t\t}\n\t}\n}, { immediate: true });\n\ndefineExpose({\n\tgetSearcher,\n\tgetRegion,\n});\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-selectorRegion': true,\n\t\t\t'top-selectorRegion-onlySearcher': onlySearcher,\n\t\t}\"\n\t>\n\t\t<Select\n\t\t\t:options=\"selectSearcher.optionBySearcherKey.value\"\n\t\t\tv-model=\"selectSearcher.searcherKey.value\"\n\t\t\tname=\"searcher_key\"\n\t\t\t:addChanger=\"addChanger\"\n\t\t/>\n\n\t\t<Select\n\t\t\tv-if=\"!onlySearcher && selectSearcher.searcherKey.value !== searhcerCompareKey\"\n\t\t\tclass=\"top-select-region\"\n\t\t\t:options=\"selectRegion.optionByRegionIndex.value\"\n\t\t\tv-model=\"selectRegion.regionIndex.value\"\n\t\t\t:name=\"forFrequency ? 'region_key' : 'region_index'\"\n\t\t\t:addChanger=\"addChanger\"\n\t\t\t:data-top-icon=\"addRegionIcon ? '' : undefined\"\n\t\t/>\n\n\t\t<Button\n\t\t\tv-if=\"addCompare && !onlySearcher && selectSearcher.searcherKey.value === searhcerCompareKey\"\n\t\t\tname=\"compare\"\n\t\t\t@click=\"onClickCompare\"\n\t\t\t:data-count-compare-regions-indexes=\"compare.regionsIndexes.value.length\"\n\t\t>\n\t\t\t{{ $i18n.Common.Selected_regions }}\n\t\t</Button>\n\t</div>\n</template>\n\n<style>\n@import \"./styles/searcherColors.css\";\n\n.top-selectorRegion {\n\twidth: 340px;\n\tdisplay: inline-flex;\n\tvertical-align: middle;\n}\n\n.top-selectorRegion > .top-select {\n\tflex-grow: 1;\n}\n\n.top-selectorRegion > .top-select:focus-within {\n\tz-index: 4;\n}\n\n.top-selectorRegion > .top-select > .top-select_select:hover,\n.top-selectorRegion > .top-select > .top-select_select.top-error {\n\tz-index: 1;\n}\n\n.top-selectorRegion > .top-select-searcher_key {\n\twidth: 140px;\n\tmax-width: 160px;\n\tmargin-right: -1px;\n}\n\n.top-selectorRegion > .top-select-region > select {\n\tborder-top-left-radius: 0;\n\tborder-bottom-left-radius: 0;\n}\n\n.top-selectorRegion > .top-select-region {\n\t--top-icon-size: 20px;\n\t--top-icon-color: var(--color-text-primary);\n\n\t--top-icon2-size: 20px;\n\t--top-icon2-color: var(--color-text-primary);\n}\n\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2] {\n\t--top-icon2-size: 16px;\n}\n\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2]:after {\n\ttext-indent: -4px;\n}\n\n.top-selectorRegion > [name=\"compare\"] {\n\tborder-top-left-radius: 0;\n\tborder-bottom-left-radius: 0;\n\tflex-grow: 1;\n}\n\n.top-selectorRegion > [name=\"compare\"]:after {\n\tcontent: \"(\" attr(data-count-compare-regions-indexes) \")\";\n\tmargin: 0 0 0 6px;\n}\n\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key > select {\n\tborder-top-right-radius: 0;\n\tborder-bottom-right-radius: 0;\n\tmargin-right: 0;\n}\n\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key[data-value=\"-1\"] > select {\n\tborder-right: none;\n}\n\n.top-selectorRegion-onlySearcher {\n\twidth: 140px;\n}\n</style>\n","import type { Props as TagSelectorOpenerProps } from '../popupOpener/types';\nimport type { Tag, TagIdExclude } from '../types';\n\n/**\n * Полуичить значение исключения тега tagId\n */\nexport const genTagIdExcluded = (tagId: Tag['id']): TagIdExclude => {\n\treturn '-' + tagId as TagIdExclude;\n};\n\n/**\n * Вернуть чистый tagId без exclude флага\n */\nexport const genTagIdClear = (tagId: Tag['id'] | TagIdExclude) => {\n\tif (tagId[0] === '-') return tagId.substring(1) as Tag['id'];\n\n\treturn tagId as Tag['id'];\n};\n\n/**\n * Получить инфомрацию о теге по его id\n */\nexport const getTagById = (tagId: Tag['id'] | TagIdExclude, tags: TagSelectorOpenerProps['tags']) => {\n\ttagId = genTagIdClear(tagId);\n\n\tconst tag = tags.find(tag => tag.id === tagId);\n\tif (!tag) return;\n\n\treturn tag;\n};\n","import { isRef, type Ref, ref, unref, watch } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { storage } from '@/core/utils/dom';\nimport TopPopupWorker from '@/components/popup/lib/worker';\nimport type { OpenerProps as PopupOpenerProps } from '@/components/popup/popup/types';\nimport type { Props as TagSelectorOpenerProps, TagSelectorTarget } from '../popupOpener/types';\nimport type { Props as TagIconProps } from '../tagIcon/types';\nimport { genTagIdClear, getTagById } from './utils';\n\n/**\n * Сгенерировать элемент для открытия popup с выбором тегов\n *\n * Альтернатива TopTagSelectorPopupOpener для работы вне vue\n *\n * Требует монтирования компонента TopTagSelector\n */\nexport const genElPopupOpener = (\n\tprops: TagSelectorOpenerProps & { modelValue: TagSelectorOpenerProps['modelValue'] | Ref<TagSelectorOpenerProps['modelValue']> },\n\tpropsPopup?: Partial<PopupOpenerProps>,\n\thtmlSetterSeveral?: string,\n): HTMLElement => {\n\tif (!propsPopup) propsPopup = { id: props.id };\n\n\t// Значения по умолчанию см. в: `@/components/popup/popup/opener.vue`\n\tpropsPopup.id = props.id;\n\tpropsPopup.pos ??= '3';\n\tpropsPopup.notch ??= true;\n\tpropsPopup.posBy ??= 'fixed';\n\n\tconst el = TopPopupWorker.genElPopupOpener('div', propsPopup as PopupOpenerProps);\n\n\tel.classList.add('top-tagSelector');\n\tif (props.useTopButton) el.classList.add('top-tagSelector-useTopButton', 'top-button', 'top-color_theme', 'top-as-selector');\n\tif (!props.useTopButton) el.classList.add('top-tagSelector-custom');\n\tif (props.mode === 'filter') el.classList.add('top-tagSelector-filter');\n\tif (props.mode === 'setter' && !props.filters) el.classList.add('top-tagSelector-setter_single');\n\tif (props.mode === 'setter' && props.filters) el.classList.add('top-tagSelector-setter_several');\n\n\t// прокcи клик: lazy connect\n\tel.onclick = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tel.onclick = null;\n\n\t\tconst model = ref(props.modelValue);\n\n\t\tconst target: TagSelectorTarget = {\n\t\t\tmodel,\n\t\t\tmode: props.mode,\n\t\t\ttargetId: props.targetId,\n\t\t\tfilters: props.filters,\n\t\t\tpayload: props.payload,\n\t\t};\n\n\t\tstorage(el, 'topTagSelectorTarget', target);\n\n\t\tdelete el.dataset.topPopupDisabled;\n\n\t\tif (!isRef(props.modelValue)) {\n\t\t\twatch(model, () => {\n\t\t\t\tprops.modelValue = model.value;\n\n\t\t\t\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\t\t\t});\n\t\t}\n\n\t\t// выполнение клика\n\t\tel.click();\n\t};\n\n\tif (isRef(props.modelValue)) {\n\t\twatch(props.modelValue, () => elPopupOpenerRender(el, props, htmlSetterSeveral));\n\t} else {\n\t\tstorage(el, 'topTagSelectorRender', (modelValue: TagSelectorOpenerProps['modelValue']) => {\n\t\t\tprops.modelValue = modelValue;\n\n\t\t\tconst target = storage(el, 'topTagSelectorTarget');\n\t\t\tif (target) target.model.value = modelValue;\n\n\t\t\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\t\t});\n\t}\n\n\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\n\treturn el;\n};\n\n/**\n * Вызвать перерисовку элемента, который был создан через genElPopupOpener()\n *\n * Работет только для элементов не с реактивным modelValue\n */\nexport const renderElPopupOpener = (el: HTMLElement, modelValue: TagSelectorOpenerProps['modelValue']) => {\n\tstorage(el, 'topTagSelectorRender')?.(modelValue);\n};\n\n/**\n * Отрисовать TopTagSelecorPopupOpener\n */\nconst elPopupOpenerRender = (el, props: TagSelectorOpenerProps, htmlSetterSeveral?: string) => {\n\tconst tagsIds = unref(props.modelValue);\n\n\tel.classList.toggle('top-tagSelector-selectedOne', !tagsIds.length || tagsIds.length === 1);\n\tel.classList.toggle('top-tagSelector-toTwoLine', tagsIds.length > 5);\n\n\tif (props.mode === 'setter' && props.filters) {\n\t\tel.innerHTML = `<div>${htmlSetterSeveral}</div>`;\n\n\t\treturn;\n\t}\n\n\tel.innerHTML = '';\n\n\tif (!tagsIds.length && props.mode === 'filter') {\n\t\tconst elTagIcon = genElTagIcon({\n\t\t\tid: 'all',\n\t\t\tcolorId: '',\n\t\t\tname: useI18n().Common?.All_tags ?? '',\n\t\t\tstate: '',\n\t\t});\n\n\t\tel.append(elTagIcon);\n\t}\n\n\ttagsIds.forEach(tagId => {\n\t\tconst elTagIcon = genElTagIcon({\n\t\t\tid: genTagIdClear(tagId),\n\t\t\tcolorId: getTagById(tagId, props.tags)?.color_id ?? '',\n\t\t\tname: getTagById(tagId, props.tags)?.name ?? '',\n\t\t\tstate: genTagIdClear(tagId) === tagId ? 'selected' : 'excluded',\n\t\t});\n\n\t\tel.append(elTagIcon);\n\t});\n};\n\n/**\n * Сгенерировтаь элемент для открытия popup с выбором тегов\n *\n * Альтернатива TopTagSelecorTagIcon для работы вне vue\n */\nconst genElTagIcon = (props: TagIconProps) => {\n\tconst el = document.createElement('div');\n\n\tel.classList.add('top-tagSelector_tagIcon');\n\tel.classList.toggle('top-tagSelector-active', !!props.state);\n\tel.classList.toggle('top-tagSelector-excluded', props.state === 'excluded');\n\n\tel.dataset.tag_id = props.id;\n\tel.dataset.tag_color_id = props.colorId;\n\tel.title = props.name;\n\n\treturn el;\n};\n","import type { Tag } from './types';\n\nexport default [\n\t{\n\t\tid: '1',\n\t\tname: 'Without Tag',\n\t\tcolor_id: '1',\n\t},\n\t{\n\t\tid: '2',\n\t\tname: 'Red',\n\t\tcolor_id: '2',\n\t},\n\t{\n\t\tid: '3',\n\t\tname: 'Orange',\n\t\tcolor_id: '3',\n\t},\n\t{\n\t\tid: '4',\n\t\tname: 'Yellow',\n\t\tcolor_id: '4',\n\t},\n\t{\n\t\tid: '5',\n\t\tname: 'Blue',\n\t\tcolor_id: '5',\n\t},\n\t{\n\t\tid: '6',\n\t\tname: 'Purple',\n\t\tcolor_id: '6',\n\t},\n\t{\n\t\tid: '7',\n\t\tname: 'Green',\n\t\tcolor_id: '7',\n\t},\n\t{\n\t\tid: '8',\n\t\tname: 'Magenta',\n\t\tcolor_id: '8',\n\t},\n\t{\n\t\tid: '9',\n\t\tname: 'Dark blue',\n\t\tcolor_id: '9',\n\t},\n\t{\n\t\tid: '10',\n\t\tname: 'Turquoise',\n\t\tcolor_id: '10',\n\t},\n] as Tag[];\n","<script setup lang=\"ts\">\nimport type { Props } from './types';\n\ndefineProps<Props>();\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-tagSelector_tagIcon': true,\n\t\t\t'top-tagSelector-active': !!state,\n\t\t\t'top-tagSelector-excluded': state === 'excluded',\n\t\t}\"\n\t\t:data-tag_id=\"id\"\n\t\t:data-tag_color_id=\"colorId\"\n\t\t:title=\"name\"\n\t></div>\n</template>\n\n<style>\n[data-tag_id] { display: inline-flex; gap: var(--top-gap-2); align-items: center; }\n\n[data-tag_id=\"\"] { border-color: #bdc3c7 !important; color: #55555F !important; }\n[data-tag_color_id=\"1\"] { border-color: var(--color-tag-1) !important; color: #55555F !important; }\n[data-tag_color_id=\"2\"] { border-color: var(--color-tag-2) !important; color: var(--color-tag-2) !important; }\n[data-tag_color_id=\"3\"] { border-color: var(--color-tag-3) !important; color: var(--color-tag-3) !important; }\n[data-tag_color_id=\"4\"] { border-color: var(--color-tag-4) !important; color: var(--color-tag-4) !important; }\n[data-tag_color_id=\"5\"] { border-color: var(--color-tag-5) !important; color: var(--color-tag-5) !important; }\n[data-tag_color_id=\"6\"] { border-color: var(--color-tag-6) !important; color: var(--color-tag-6) !important; }\n[data-tag_color_id=\"7\"] { border-color: var(--color-tag-7) !important; color: var(--color-tag-7) !important; }\n[data-tag_color_id=\"8\"] { border-color: var(--color-tag-8) !important; color: var(--color-tag-8) !important; }\n[data-tag_color_id=\"9\"] { border-color: var(--color-tag-9) !important; color: var(--color-tag-9) !important; }\n[data-tag_color_id=\"10\"] { border-color: var(--color-tag-10) !important; color: var(--color-tag-10) !important; }\n\n[data-tag_id=\"\"].top-tagSelector-active { background: #bdc3c7 !important; }\n[data-tag_color_id=\"1\"].top-tagSelector-active { background: var(--color-tag-1) !important; }\n[data-tag_color_id=\"2\"].top-tagSelector-active { background: var(--color-tag-2) !important; }\n[data-tag_color_id=\"3\"].top-tagSelector-active { background: var(--color-tag-3) !important; }\n[data-tag_color_id=\"4\"].top-tagSelector-active { background: var(--color-tag-4) !important; }\n[data-tag_color_id=\"5\"].top-tagSelector-active { background: var(--color-tag-5) !important; }\n[data-tag_color_id=\"6\"].top-tagSelector-active { background: var(--color-tag-6) !important; }\n[data-tag_color_id=\"7\"].top-tagSelector-active { background: var(--color-tag-7) !important; }\n[data-tag_color_id=\"8\"].top-tagSelector-active { background: var(--color-tag-8) !important; }\n[data-tag_color_id=\"9\"].top-tagSelector-active { background: var(--color-tag-9) !important; }\n[data-tag_color_id=\"10\"].top-tagSelector-active { background: var(--color-tag-10) !important; }\n\n[data-tag_id=\"all\"] {\n\tborder-color: transparent !important; background: none !important;\n}\n\n[data-tag_id=\"all\"]:before {\n\tcontent: \"\";\n\tcolor: var(--color-tag-all) !important;\n\tfont-size: 26px;\n\tmin-width: calc(100% + 4px);\n\theight: calc(100% + 4px);\n\tmargin-top: -18px;\n\tmargin-left: -8px;\n}\n\n/* в кнопке выбора тэгов и в popup */\n.top-tagSelector-useTopButton [data-tag_id],\n.top-tagSelector_popup [data-tag_id] {\n\t--top-tag-selector-size: 10px;\n\n\tbox-sizing: content-box;\n\tborder-radius: 100%; border: 2px solid var(--color-layout-front-1); background: var(--color-layout-front-1);\n\twidth: var(--top-tag-selector-size);\n\theight: var(--top-tag-selector-size);\n\tfont-size: calc(var(--top-tag-selector-size) + 4px);\n\t/*font-family: inherit !important;*/\n}\n\n/* исключение тегов */\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id],\n[data-tag_id].top-tagSelector-excluded { position: relative; }\n\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id]:before,\n[data-tag_id].top-tagSelector-excluded:before {\n\tcontent: \"\";\n\twidth: calc(var(--top-tag-selector-size) * 2); height: 1px; background: inherit;\n\ttransform: rotate(-45deg); filter: brightness(80%);\n\tdisplay: block;\n\tposition: absolute; top: calc(var(--top-tag-selector-size) / 2); left: calc(0px - var(--top-tag-selector-size) / 2);\n}\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id]:not([data-tag_id=\"all\"]):not(.top-tagSelector-active):before { background: #AAA; }\n[data-tag_id].top-tagSelector-excluded:after,\n[data-tag_id].top-tagSelector-excluded ~ .top-tagSelector_tagListItemName { text-decoration: line-through; }\n\n/* popup */\n.top-popup_listItem.top-tagSelector-active { background: var(--top-popup-background-color-active) !important; }\n\n.top-popup_listItem:hover [data-tag_id=\"all\"]:before { border-color: var(--top-popup-background-color-hover); }\n.top-popup_listItem.top-tagSelector-active [data-tag_id=\"all\"]:before,\n.top-popup_listItem.top-active [data-tag_id=\"all\"]:before { border-color: var(--top-popup-background-color-active); }\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from 'vue';\nimport type { Emits, Props } from './types';\nimport TopTagIcon from '../tagIcon/tagIcon.vue';\nimport TopPopupListItem from '@/components/popup/popup/listItem.vue';\n\nconst props = defineProps<Props>();\nconst emit = defineEmits<Emits>();\n\nconst name = defineModel<Props['name']>('name', {\n\trequired: true,\n});\n\nconst elName = ref<HTMLElement | null>(null);\n\n/**\n * @todo Удалить через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии\n */\nconst firefoxProps = computed(() => {\n\tif (navigator.userAgent.indexOf('Firefox') != -1) {\n\n\t\treturn {\n\t\t\tcontenteditable: inEdit.value,\n\t\t\tonpaste: (event: Event) => event.preventDefault(),\n\t\t};\n\t}\n\n\treturn {};\n});\n\n/**\n * Включен режим редактирвоания\n */\nconst inEdit = ref(false);\n\n/**\n * Включить режим редактирование\n */\nconst turnToEdit = async () => {\n\tinEdit.value = true;\n\n\tawait nextTick();\n\n\telName.value?.focus();\n};\n\n/**\n * Применить редактирование\n */\nconst editCommit = () => {\n\tconst name = elName.value?.innerText;\n\tif (!name) return editCancel();\n\n\tif (elName.value) elName.value.innerText = name;\n\n\tinEdit.value = false;\n\n\temit('update:name', name);\n};\n\n/**\n * Отменить редактирование\n */\nconst editCancel = async () => {\n\tif (elName.value) elName.value.innerText = props.name;\n\n\tinEdit.value = false;\n};\n\n/**\n * Применить выбор\n */\nconst changeSelect = (e: MouseEvent) => {\n\t// в режиме редактирования выбор не применяется\n\tif (inEdit.value) return;\n\n\t// тег запрещено выбирать\n\tif (props.disabled) return;\n\n\tlet toState: Props['state'] = 'selected';\n\n\tif (props.canExclude) {\n\t\tif (e.ctrlKey || e.metaKey) {\n\t\t\ttoState = 'excluded';\n\t\t}\n\t}\n\n\tif (props.state == toState) {\n\t\ttoState = '';\n\t}\n\n\tif (toState === '') emit('unselect');\n\tif (toState === 'selected') emit('select');\n\tif (toState === 'excluded') emit('exclude');\n};\n</script>\n\n<template>\n\t<TopPopupListItem\n\t\t:class=\"{\n\t\t\t'top-tagSelector_tagListItem': true,\n\t\t\t'top-tagSelector_tagListItem-inEdit': inEdit,\n\t\t\t'top-tagSelector_tagListItem-disabled': disabled,\n\t\t\t'top-tagSelector_tagListItem-canExclude': canExclude,\n\t\t\t'top-tagSelector-active': !!state,\n\t\t\t'top-tagSelector-excluded': state === 'excluded'\n\t\t}\"\n\t\t@click.stop=\"changeSelect\"\n\t>\n\t\t<TopTagIcon\n\t\t\t:id\n\t\t\t:name\n\t\t\t:colorId\n\t\t\t:state\n\t\t/>\n\n\t\t<span\n\t\t\tref=\"elName\"\n\t\t\tclass=\"top-tagSelector_tagListItemName\"\n\t\t\t:contenteditable=\"inEdit ? 'plaintext-only' : false\"\n\t\t\t:=\"firefoxProps\"\n\t\t\t@keydown.enter.stop=\"editCommit\"\n\t\t\t@keydown.esc.stop=\"editCancel\"\n\t\t>\n\t\t\t{{ name }}\n\t\t</span>\n\n\t\t<template v-if=\"editable\">\n\t\t\t<span\n\t\t\t\tv-if=\"!inEdit\"\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\tclass=\"top-tagSelector_edit\"\n\t\t\t\t@click=\"turnToEdit\"\n\t\t\t></span>\n\n\t\t\t<span\n\t\t\t\tv-else\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\tclass=\"top-tagSelector_edit\"\n\t\t\t\t@click.stop=\"editCommit\"\n\t\t\t></span>\n\t\t</template>\n\t</TopPopupListItem>\n</template>\n\n<style>\n.top-tagSelector_tagListItem.top-popup_listItem {\n\tpadding-top: var(--top-padding-2) !important;\n\tpadding-bottom: var(--top-padding-2) !important;\n\tgap: 10px;\n}\n\n.top-tagSelector_tagListItemName {\n\tborder-radius: var(--top-radius-1);\n\twidth: 120px;\n\tpadding: 4px 2px;\n\tmargin: -4px -2px;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tflex-grow: 1;\n}\n\n/* редактирование */\n.top-tagSelector_edit {\n\t--top-icon-size: 18px;\n\t--top-icon-color: var(--color-text-3);\n\n\twidth: 20px;\n\tflex-grow: 0;\n}\n\n.top-tagSelector_edit:before {\n\tline-height: 0;\n}\n\n.top-tagSelector_edit { opacity: 0; }\n.top-tagSelector_edit:hover {\n\t--top-icon-color: var(--color-text-primary);\n}\n\n.top-tagSelector_tagListItem:hover .top-tagSelector_edit,\n.top-tagSelector_tagListItem-inEdit .top-tagSelector_edit {\n\tcursor: pointer;\n\topacity: 1;\n}\n\n.top-tagSelector_tagListItem-inEdit {\n\tbackground: var(--color-layout-front-3) !important;\n\toutline: 1px dashed var(--color-line-2);\n\toutline-offset: -1px;\n}\n\n.top-tagSelector_tagListItem-inEdit .top-tagSelector_tagListItemName {\n\tcursor: text;\n\tbackground: var(--color-layout-front-1);\n}\n\n/* disabled */\n.top-tagSelector_tagListItem-disabled {\n\tcursor: not-allowed !important;\n\topacity: 0.85;\n}\n.top-tagSelector_tagListItem-disabled:hover {\n\tbackground: inherit;\n}\n.top-tagSelector_tagListItem-disabled [data-tag_id] {\n\topacity: 0.6;\n}\n</style>\n","top-forms-focusable top-size_s top-button-withoutText top-tagSelector-useTopButton\n\n<script setup lang=\"ts\">\nimport type { Props, TagSelectorTarget } from './types';\nimport TopPopupOpener from '../../../popup/popup/opener.vue';\nimport TopButton from '@/components/forms/button/button.vue';\nimport { genTagIdClear, getTagById } from '../utils/utils';\nimport TopTagIcon from '../tagIcon/tagIcon.vue';\n\ndefineOptions({\n\tinheritAttrs: false,\n});\n\nconst props = defineProps<Props>();\n\nconst model = defineModel<Props['modelValue']>({\n\trequired: true,\n});\n\nconst component = props.useTopButton ? TopButton : 'div';\nconst componentSlotName = props.useTopButton ? 'html' : 'default';\n\nconst topTagSelectorTarget: TagSelectorTarget = {\n\tmodel,\n\tmode: props.mode,\n\ttargetId: props.targetId,\n\tfilters: props.filters,\n\tpayload: props.payload,\n};\n</script>\n\n<template>\n\t<TopPopupOpener :id>\n\t\t<component\n\t\t\t:is=\"component\"\n\t\t\t:class=\"{\n\t\t\t\t'top-tagSelector': true,\n\t\t\t\t'top-tagSelector-useTopButton': props.useTopButton,\n\t\t\t\t'top-tagSelector-custom': !props.useTopButton,\n\t\t\t\t'top-as-selector': props.useTopButton,\n\t\t\t\t'top-tagSelector-filter': props.mode === 'filter',\n\t\t\t\t'top-tagSelector-setter_single': props.mode === 'setter' && !filters,\n\t\t\t\t'top-tagSelector-setter_several': props.mode === 'setter' && filters,\n\t\t\t\t'top-tagSelector-selectedOne': !model.length || model.length === 1,\n\t\t\t\t'top-tagSelector-toTwoLine': model.length > 5,\n\t\t\t}\"\n\t\t\tcolor=\"theme\"\n\t\t\t:styling\n\t\t\tv-top-data:topTagSelectorTarget=\"topTagSelectorTarget\"\n\t\t\t:=$attrs\n\t\t>\n\t\t\t<template #[componentSlotName]>\n\t\t\t\t<TopTagIcon\n\t\t\t\t\tv-if=\"!model.length && mode === 'filter'\"\n\t\t\t\t\tid=\"all\"\n\t\t\t\t\tcolorId=\"\"\n\t\t\t\t\t:name=\"$i18n.Common.All_tags ?? ''\"\n\t\t\t\t\tstate=\"\"\n\t\t\t\t/>\n\n\t\t\t\t<!-- Массовое редактирование -->\n\t\t\t\t<div v-if=\"mode === 'setter' && filters\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Список тегов -->\n\t\t\t\t<TopTagIcon\n\t\t\t\t\tv-else\n\t\t\t\t\tv-for=\"tagId in model\"\n\t\t\t\t\t:id=\"genTagIdClear(tagId)\"\n\t\t\t\t\t:colorId=\"getTagById(tagId, tags)?.color_id ?? ''\"\n\t\t\t\t\t:name=\"getTagById(tagId, tags)?.name ?? ''\"\n\t\t\t\t\t:state=\"genTagIdClear(tagId) === tagId ? 'selected' : 'excluded'\"\n\t\t\t\t/>\n\t\t\t</template>\n\t\t</component>\n\t</TopPopupOpener>\n</template>\n\n<style>\n.top-tagSelector {\n\tcursor: pointer;\n\tmin-width: 0;\n\twhite-space: nowrap;\n\tjustify-content: left;\n}\n\n.top-tagSelector-useTopButton {\n\twidth: 112px;\n\tgap: var(--top-gap-1);\n\tvertical-align: middle;\n}\n\n.top-tagSelector.top-button.top-as-selector {\n\twidth: calc(112px + 8px);\n}\n\n/* все теги в фильтре */\n.top-tagSelector-useTopButton [data-tag_id=\"all\"]:before {\n\tmargin-right: 6px;\n}\n\n/* фильтр по одному тегу */\n.top-tagSelector-useTopButton.top-tagSelector-selectedOne [data-tag_id]:after {\n\tcontent: attr(title);\n\tmargin-left: 20px;\n\tmin-width: 74px;\n\ttext-align: left;\n\tline-height: 1.2;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.top-tagSelector-useTopButton.top-tagSelector-selectedOne [data-tag_id=\"all\"]:after {\n\tmargin-left: 0;\n}\n\n/* фильтр по многим тегам */\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine {\n\tflex-wrap: wrap;\n\talign-content: center;\n}\n\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine [data-tag_id] {\n\t--top-tag-selector-size: 8px;\n}\n\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine [data-tag_id]:nth-child(5) {\n\tmargin-right: 5px;\n}\n\n/* установка тегов */\n.top-tagSelector-useTopButton.top-tagSelector-setter_several,\n.top-tagSelector-useTopButton.top-tagSelector-setter_several.top-as-selector{\n\twidth: auto;\n}\n\n.top-tagSelector-custom {\n\tposition: relative;\n\tdisplay: flex !important; flex-direction: column; flex-wrap: wrap; align-items: stretch !important;\n}\n\n.top-tagSelector-custom [data-tag_id] {\n\twidth: auto; min-height: 20%; min-width: 50%;\n\tflex: 1 1 auto;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, reactive, ref, shallowRef, watch } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { storage } from '@/core/utils/dom';\nimport { debounce } from '@/core/utils/lodash';\n\nimport type { Option } from '@/components/forms/select/types';\nimport TopSelect from '@/components/forms/select/select.vue';\n\nimport TopButton from '@/components/forms/button/button.vue';\n\nimport type { PopupEvent } from '@/components/popup/popup/types';\nimport TopPopup from '../../popup/popup/popup.vue';\nimport TopPopupListItem from '../../popup/popup/listItem.vue';\n\nimport type { Emits, FiltersAction, Props, Tag } from './types';\nimport tagsDefaults from './tagsDefaults';\nimport { genTagIdExcluded } from './utils/utils';\n\nimport type { Props as TagListItemProps } from './popupListItem/types';\nimport TopTagListItem from './popupListItem/tagPopupListItem.vue';\n\nimport type { TagSelectorTarget } from './popupOpener/types';\nimport TopTagSelectorPopupOpener from './popupOpener/popupOpener.vue';\n\nconst i18n = useI18n();\n\nconst props = withDefaults(defineProps<Props>(), {\n\ttagsMax: 10,\n\trequiredForSetter: true,\n\temitDelay: 500,\n\tuseTopButton: true,\n});\n\n/**\n * Выбранные теги кнопки в этом компоненте\n *\n * Редактирвоание ведется только через `editTarget.model`\n */\nconst model = defineModel<Props['modelValue']>({\n\trequired: true,\n});\n\n/**\n * Список тегов\n */\nconst tags = defineModel<Tag[]>('tags', {\n\tdefault: reactive(tagsDefaults),\n});\n\nconst emit = defineEmits<Emits>();\n\nconst emitDebounce: typeof emit = debounce((name, e) => {\n\temit(name, e);\n}, props.emitDelay);\n\n// требуется сразу указать один тег\nif (props.singleMode && !model.value.length) {\n\tmodel.value = [tags.value[0].id];\n}\n\nconst id = props.id ?? 'top-popup-id-' + Math.random() + '';\n\nconst filtersAction = ref<FiltersAction>('add');\n\n/**\n * Сгенерировать опции для выбора дейсвтия массого редактирования\n */\nconst genFiltersActionOptions = () => {\n\tconst tagsText = ' ' + i18n.Common.Tags?.toLowerCase();\n\n\tconst res = new Map<FiltersAction, Option>();\n\tres.set('add', { value: 'add', title: i18n.Common.Add + tagsText });\n\tres.set('replace', { value: 'replace', title: i18n.Common.Replace + tagsText });\n\tres.set('delete', { value: 'delete', title: i18n.Common.Delete + tagsText });\n\n\treturn res;\n};\n\n/**\n * Целевой объект редактирования тегов\n *\n * Определяется кнопкой, которая открыла popup выбора тегов\n */\nlet target = shallowRef<TagSelectorTarget>({\n\tmodel,\n\tmode: 'filter',\n\ttargetId: undefined,\n\tfilters: undefined,\n\tpayload: undefined,\n});\n\nwatch(model, () => {\n\temitDebounce('selector', model.value);\n});\n\n/**\n * Можно ли выбрать еще теги\n */\nconst disabled = computed(() => {\n\tif (target.value.mode !== 'setter') return;\n\n\tif (!props.maxTagsForSetter) return;\n\n\t// массовая смена тегов, количество тегов в результате узнать невозможно\n\tif (target.value.filters) return;\n\n\treturn target.value.model.value.length >= props.maxTagsForSetter;\n});\n\nconst genTargetTagState = (tagId: Tag['id'] | 'all'): TagListItemProps['state'] => {\n\tif (tagId !== 'all') {\n\t\tif (target.value.model.value.includes(tagId)) return 'selected';\n\n\t\tif (target.value.model.value.includes(genTagIdExcluded(tagId))) return 'excluded';\n\t}\n\n\t// Все теги, ни один из тегов не выбран\n\tif (tagId === 'all' && !target.value.model.value.length) return 'selected';\n\n\treturn '';\n};\n\nconst updateTargetModel = (tagId: Tag['id'], action: 'unselect' | 'select' | 'exclude') => {\n\tconst tagIdExcluded = genTagIdExcluded(tagId);\n\n\tlet tagsIds = target.value.model.value.filter(modelTagId => modelTagId !== tagId && modelTagId !== tagIdExcluded);\n\n\tif (action === 'select') tagsIds.push(tagId);\n\tif (action === 'exclude') tagsIds.push(tagIdExcluded);\n\n\t// режим редактирвоания тегов одного объекта с требованием указать хотя бы один тег\n\tif (target.value.mode === 'setter' && target.value.targetId !== undefined && props.requiredForSetter) {\n\t\t// нельзя снимать выделение со всех тегов\n\t\tif (!tagsIds.length) {\n\t\t\ttagsIds.push('1');\n\t\t}\n\n\t\t// при первом выборе сразу снять тег \"Без тега\"\n\t\tif (tagsIds.length === 2 && target.value.model.value.length === 1 && target.value.model.value[0] === '1') {\n\t\t\ttagsIds = tagsIds.filter((tagId) => tagId !== '1');\n\t\t}\n\t}\n\n\t// режим выбора одного тега\n\tif (props.singleMode && !target.value.filters) {\n\t\t// нужно указать хотя бы один тег\n\t\tif (!tagsIds.length) {\n\t\t\ttagsIds = target.value.model.value;\n\t\t}\n\n\t\tif (tagsIds.length > 1) {\n\t\t\ttagsIds = [tagsIds[tagsIds.length - 1]];\n\t\t}\n\t}\n\n\t// всегда выводить теги в порядке, указанном в настройках tags\n\ttagsIds.sort((a, b) => {\n\t\tif (!props.tags) return 0;\n\n\t\tconst aIndex = props.tags.findIndex((tag) => tag.id === a);\n\t\tconst bIndex = props.tags.findIndex((tag) => tag.id === b);\n\n\t\treturn aIndex - bIndex;\n\t});\n\n\ttarget.value.model.value = tagsIds;\n\n\tif (target.value.mode === 'setter' && target.value.targetId !== undefined) {\n\t\temitDebounce('setter', {\n\t\t\ttagsIds: tagsIds as Tag['id'][],\n\t\t\ttargetId: target.value.targetId,\n\t\t\tpayload: target.value.payload,\n\t\t});\n\t}\n};\n\nconst classString = computed(() => {\n\tlet res = 'top-tagSelector_popup';\n\n\tif (target.value.mode === 'filter') res += ' top-tagSelector_popup-filter';\n\tif (target.value.mode === 'setter') res += ' top-tagSelector_popup-setter';\n\n\treturn res;\n});\n\n/**\n * Добавить тег\n */\nconst addTag = () => {\n\tconst tagName = prompt('', 'New tag');\n\tif (!tagName || tagName === 'New tag') return;\n\n\tconst tagId = tags.value.length + 1;\n\n\ttags.value.push({\n\t\tid: String(tagId) as Tag['id'],\n\t\tname: tagName,\n\t\tcolor_id: String((tagId - 1) % 10 + 1) as Tag['color_id'],\n\t});\n\n\temit('tagsChanged', tags.value);\n};\n\nconst onOpen = (popupEvent: PopupEvent) => {\n\t// popup открыт другой кнопкой c другим modelValue, для редактирвоания объектов\n\ttarget.value = storage(popupEvent.elPopupOpener, 'topTagSelectorTarget');\n\tif (!target.value) throw new Error('Open popup TopTagSelector required v-data:topTagSelectorTarget');\n\n\t// при начале массовой установки тегов сбросить состояние формы\n\tif (target.value.filters) {\n\t\tfiltersAction.value = 'add';\n\t\ttarget.value.model.value = [];\n\t}\n\n\tif (!Core.$?.ui['sortable']) {\n\t\tconsole.info('Для работы сортировки требуется глобальная загрузка jQuery UI Sortable');\n\n\t\treturn;\n\t}\n\n\tif (!Core.state.isMobile && !Core.state.isMobileUA && tags.value) {\n\t\t$(popupEvent.elPopup).sortable({\n\t\t\titems: 'li:has([data-tag_id]:not([data-tag_id=\"all\"]))',\n\n\t\t\t/**\n\t\t\t * @todo Удалить `[contenteditable=\"true\"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии\n\t\t\t */\n\t\t\tcancel: '[contenteditable=\"plaintext-only\"], [contenteditable=\"true\"]',\n\n\t\t\tdistance: 10,\n\t\t\tstop: function (_e, ui) {\n\t\t\t\tif (!tags.value) return;\n\n\t\t\t\tconst $tags = $(ui.item).parent().find('[data-tag_id]');\n\n\t\t\t\tconst tagsSorted: Tag['id'][] = [];\n\t\t\t\t$tags.each((_index, elTag) => {\n\t\t\t\t\tif (!tags.value) return;\n\n\t\t\t\t\tconst tagId = $(elTag).attr('data-tag_id') as Tag['id'];\n\t\t\t\t\ttagsSorted.push(tagId);\n\t\t\t\t});\n\n\t\t\t\ttags.value.sort((tagIdA, tagIdB) => {\n\t\t\t\t\tconst a = tagsSorted.findIndex(tagSorted => tagSorted === tagIdA.id);\n\t\t\t\t\tconst b = tagsSorted.findIndex(tagSorted => tagSorted === tagIdB.id);\n\n\t\t\t\t\treturn a - b;\n\t\t\t\t});\n\n\t\t\t\temitDebounce('tagsChanged', tags.value);\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst onClose = (popupEvent: PopupEvent) => {\n\tif (!Core.$?.ui['sortable']) return;\n\n\tif ($(popupEvent.elPopup).data('ui-sortable')) {\n\t\t$(popupEvent.elPopup).sortable('destroy');\n\t}\n};\n</script>\n\n<template>\n\t<TopTagSelectorPopupOpener\n\t\tv-model=\"model\"\n\t\t:id\n\t\t:tags\n\t\t:styling\n\t\tmode=\"filter\"\n\t\t:useTopButton\n\t/>\n\n\t<TopPopup\n\t\t:id\n\t\t:class=\"classString\"\n\t\t@open=\"onOpen($event)\"\n\t\t@close=\"onClose($event)\"\n\t\t:transition-duration=\"50\"\n\t>\n\t\t<!-- Массовое редактирование-->\n\t\t<template #header v-if=\"target.mode === 'setter' && target.filters\">\n\t\t\t<TopSelect\n\t\t\t\tv-model=\"filtersAction\"\n\t\t\t\t:options=\"genFiltersActionOptions()\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template #footer v-if=\"target.mode === 'setter' && target.filters\">\n\t\t\t<TopButton color=\"theme\">\n\t\t\t\t{{ $i18n.Common.Cancel }}\n\t\t\t</TopButton>\n\n\t\t\t<TopButton\n\t\t\t\t@click=\"emitDebounce('setter', {\n\t\t\t\t\ttagsIds: target.model.value as Tag['id'][],\n\t\t\t\t\tfilters: target.filters,\n\t\t\t\t\tfiltersAction,\n\t\t\t\t\tpayload: target.payload,\n\t\t\t\t})\"\n\t\t\t>\n\t\t\t\t{{ filtersAction === 'add' ? $i18n.Common['Add'] : '' }}\n\t\t\t\t{{ filtersAction === 'replace' ? $i18n.Common['Replace'] : '' }}\n\t\t\t\t{{ filtersAction === 'delete' ? $i18n.Common['Delete'] : '' }}\n\t\t\t</TopButton>\n\t\t</template>\n\n\t\t<template #contentList>\n\t\t\t<TopTagListItem\n\t\t\t\tv-if=\"target.mode === 'filter' && !singleMode\"\n\t\t\t\tid=\"all\"\n\t\t\t\tcolorId=\"\"\n\t\t\t\t:name=\"$i18n.Common.All_tags ?? ''\"\n\t\t\t\t:state=\"target.model.value.length ? '' : 'selected'\"\n\t\t\t\t@select=\"target.model.value = []\"\n\t\t\t/>\n\n\t\t\t<TopTagListItem\n\t\t\t\tv-for=\"tag in tags\"\n\t\t\t\t:key=\"tag.id\"\n\t\t\t\t:id=\"tag.id\"\n\t\t\t\t:colorId=\"tag.color_id\"\n\t\t\t\t:name=\"tag.name\"\n\t\t\t\t:state=\"genTargetTagState(tag.id)\"\n\t\t\t\t:canExclude=\"target.mode === 'filter' && !singleMode\"\n\t\t\t\t:editable=\"tagsEditable\"\n\t\t\t\t:disabled=\"disabled && genTargetTagState(tag.id) === ''\"\n\t\t\t\t@unselect=\"updateTargetModel(tag.id, 'unselect')\"\n\t\t\t\t@select=\"updateTargetModel(tag.id, 'select')\"\n\t\t\t\t@exclude=\"updateTargetModel(tag.id, 'exclude')\"\n\t\t\t\t@update:name=\"tag.name = $event as string, emitDebounce('tagsChanged', tags);\"\n\t\t\t/>\n\n\t\t\t<TopPopupListItem\n\t\t\t\tv-if=\"tagsEditable && tags.length < tagsMax && tags.length < 20\"\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t@click.stop=\"addTag\"\n\t\t\t>\n\t\t\t\t{{ $i18n.Common.Add }}\n\t\t\t</TopPopupListItem>\n\t\t</template>\n\t</TopPopup>\n</template>\n\n<style>\n.top-tagSelector_popup .top-popup {\n\tuser-select: none;\n\tmin-width: 220px !important;\n\ttext-align: left;\n}\n\n.top-tagSelector_popup .top-popup_header .top-select{\n\tflex-grow: 1;\n}\n</style>\n"],"names":["props","__props","model","_useModel","selectAllItem","computed","useI18n","_openBlock","_createElementBlock","_hoisted_1","_unref","Core","_createBlock","Popup","_createVNode","Button","items","item","_a","_Fragment","_renderList","ListItem","_normalizeClass","_createElementVNode","_hoisted_2","_toDisplayString","Menu","$event","useItemsFromCompetitors","competitors","projectId","toValue","competitor","searhcerCompareKey","dummyIndex","globalRegionIndex","searchersNames","regionUndefined","searcherUndefined","regionAuto","searcherAuto","regionGlobal","getRegionAuto","getSearcherAuto","getRegionGlobal","genSearcherByKey","forFrequency","autoRegion","searchers","searcherByKey","genSearchersMapVolume","genSearchersMapCommon","onlyEnabledRegions","forceSearchersKeys","searcher","searcherI","region","regionI","searcherKey","serarcherByKey","searcherMail","findRegion","searchRegion","findedRegion","dialogSelectorRegions","useAsyncTopDialog","useSelectSearcher","mapSearchers","i18n","ref","optionBySearcherKey","res","option","getSearcherGIcon","dummyOption","compareOption","useSelectRegion","activeSearcherIndexed","regionIndex","_b","_c","optionByRegionIndex","options","regionLabel","langLabel","getLangLabel","getDeviceGIcon","watch","oldOptionByRegionIndex","newRegionIndex","regionName","regionMatchLevel","index","title","regexpDevice","regionNameCompare","regionMatchLevelI","useCompare","allRegionsIndexes","regionsIndexes","compareLoad","regionsIndexesSaved","compareSave","useSelectorRegion","selectSearcher","selectRegion","compare","newSearcherKey","regionsNewSearcher","regionsCurrentSearcher","_d","getSearcherKey","getRegionIndex","regionKey","getSearcher","modelSingle","getRegion","onClickCompare","regions","defaultKey","newModel","defaultIndex","_e","all","newSearherKey","__expose","onlySearcher","Select","addChanger","addRegionIcon","addCompare","$i18n","genTagIdExcluded","tagId","genTagIdClear","getTagById","tags","tag","genElPopupOpener","propsPopup","htmlSetterSeveral","el","TopPopupWorker","e","target","storage","isRef","elPopupOpenerRender","modelValue","renderElPopupOpener","tagsIds","unref","elTagIcon","genElTagIcon","tagsDefaults","state","id","colorId","name","emit","__emit","elName","firefoxProps","inEdit","event","turnToEdit","nextTick","editCommit","editCancel","changeSelect","toState","TopPopupListItem","disabled","canExclude","TopTagIcon","_mergeProps","editable","component","TopButton","componentSlotName","topTagSelectorTarget","TopPopupOpener","_resolveDynamicComponent","filters","styling","$attrs","mode","_renderSlot","_ctx","_directive_top_data","emitDebounce","debounce","filtersAction","genFiltersActionOptions","tagsText","shallowRef","genTargetTagState","updateTargetModel","action","tagIdExcluded","modelTagId","a","b","aIndex","bIndex","classString","addTag","tagName","onOpen","popupEvent","ui","$tags","tagsSorted","_index","elTag","tagIdA","tagIdB","tagSorted","onClose","TopTagSelectorPopupOpener","useTopButton","TopPopup","_cache","singleMode","TopTagListItem","tagsEditable","tagsMax","TopSelect","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAGRC,IAAQC,iBAAiC,GAEzCC,IAAgBC,EAAS,MAAM;AACpC,UAAIL,EAAM;AACT,eAAO;AAAA,UACN,MAAM;AAAA,UACN,OAAOM,IAAU,OAAO;AAAA,UACxB,OAAO;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,IAGZ,CAAC;sBAIAC,EAAA,GAAAC,EAuCM,OAvCNC,IAuCM;AAAA,MAtCQC,EAAAC,CAAA,EAAK,MAAM,iBAAxBC,EA2BQC,IAAA,EAAA,KAAA,EAAA,GAAA;AAAA,QA1BI,UACV,MAO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,EAAAsI,CAAA,EAAO;gBAAhD;AAAA,gBACV,MAGE;AAAA,YAHFlI,EAGEqN,IAAA;AAAA,0BAFQnC,EAAA;AAAA,4DAAAA,EAAa,QAAArK;AAAA,cACrB,SAASsK,EAAA;AAAA,YAAuB;;;;QAIXvL,EAAAsI,CAAA,EAAO,SAAI,YAAiBtI,EAAAsI,CAAA,EAAO;gBAAhD;AAAA,gBACV,MAEY;AAAA,YAFZlI,EAEYoK,GAAA,EAFD,OAAM,WAAO;AAAA,yBACvB,MAAyB;AAAA,oBAAtB/C,EAAAA,MAAM,OAAO,MAAM,GAAA,CAAA;AAAA,cAAA;;;YAGvBrH,EAWYoK,GAAA;AAAA,cAVV,gCAAOxK,EAAAoL,CAAA,EAAY,UAAA;AAAA,yBAA2BpL,EAAAsI,CAAA,EAAO,MAAM;AAAA,gBAAoC,SAAAtI,EAAAsI,CAAA,EAAO;AAAA,+BAAcgD,EAAA;AAAA,gBAA6B,SAAAtL,EAAAsI,CAAA,EAAO;AAAA,cAAA;;yBAOzJ,MAAwD;AAAA,gBAArDoF,EAAA3M,EAAAuK,EAAA,kBAA0B7D,EAAAA,MAAM,OAAM,MAAA,EAAA,IAAe,QACrD6D,EAAA,UAAa,YAAiB7D,QAAM,uBAAyB,MAChE1G,EAAGuK,YAAa,WAAgB7D,EAAAA,MAAM,OAAM,SAAA,EAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/selectorCompetitors/composables.ts","../../src/components/project/selectorRegion/utils/consts.ts","../../src/components/project/selectorRegion/utils/utils.ts","../../src/components/project/selectorRegion/composables/selectSearcher.ts","../../src/components/project/selectorRegion/composables/selectRegion.ts","../../src/components/project/selectorRegion/composables/compare.ts","../../src/components/project/selectorRegion/composables/selectorRegion.ts","../../src/components/project/selectorRegion/selectorRegion.vue","../../src/components/project/tagSelector/utils/utils.ts","../../src/components/project/tagSelector/utils/el.ts","../../src/components/project/tagSelector/tagsDefaults.ts","../../src/components/project/tagSelector/tagIcon/tagIcon.vue","../../src/components/project/tagSelector/popupListItem/tagPopupListItem.vue","../../src/components/project/tagSelector/popupOpener/popupOpener.vue","../../src/components/project/tagSelector/tagSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './types';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\nimport { useI18n } from '@/core/plugins/i18n';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: useI18n().Common.Select_all,\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>\n","import type { MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\nimport type { Competitor, Item } from '@/components/project/selectorCompetitors/types';\n\nexport const useItemsFromCompetitors = (competitors: MaybeRefOrGetter<Competitor[]>, projectId: MaybeRefOrGetter<number>) => {\n\treturn computed(() => {\n\t\tconst activeCompetitors = toValue(competitors).filter(competitor => competitor.on >= 0 || competitor.id === projectId);\n\n\t\tconst items: Item[] = activeCompetitors.map(competitor => {\n\t\t\treturn {\n\t\t\t\tvalue: competitor.id,\n\t\t\t\ttitle: competitor.url + ` [${competitor.id}]`,\n\t\t\t\ticon: competitor.id === toValue(projectId) ? '' : '',\n\t\t\t\tcontent: competitor.name,\n\t\t\t};\n\t\t});\n\n\t\treturn items;\n\t});\n};\n","import type { Region, SearcherIndexed } from '../types';\nimport { useI18n } from '@/core/plugins/i18n';\n\n/**\n * Ключ ПС - для выбора нескольких ПС или регионов\n */\nexport const searhcerCompareKey = -1;\n\n/**\n * Ключ ПС или индекса Региона, используется для ПС или Региона, не настроенных в проекте\n *\n * Также, используется для API с возможностью не указывать регион, см. `props.autoRegion`\n */\nexport const dummyIndex = -2;\n\n/**\n * Регион - без региона\n */\nexport const globalRegionIndex = -1;\n\nexport const searchersNames = {\n\t0: 'Yandex',\n\t1: 'Google',\n\t4: 'YouTube',\n\t5: 'Bing',\n\t7: 'Seznam',\n\t8: 'AppStore',\n\t9: 'GoogleStore',\n\t20: 'Yandex.com',\n\t21: 'Yandex.com.tr',\n};\n\nexport const regionUndefined: Region = {\n\tkey: dummyIndex,\n\tname: '--',\n\tindex: dummyIndex,\n};\n\nexport const searcherUndefined: SearcherIndexed = {\n\tkey: dummyIndex,\n\tname: '--',\n\tregions: [regionUndefined],\n\tregionByIndex: new Map([[dummyIndex, regionUndefined]]),\n};\n\nconst regionAuto: Region = {\n\tkey: dummyIndex,\n\tname: 'Autoselect',\n\tindex: dummyIndex,\n};\n\nconst searcherAuto: SearcherIndexed = {\n\tkey: dummyIndex,\n\tname: 'Autoselect',\n\tregions: [regionAuto],\n\tregionByIndex: new Map([[dummyIndex, regionAuto]]),\n};\n\nconst regionGlobal: Region = {\n\tcountryCode: '00',\n\tdepth: 1,\n\tdevice: 0,\n\tkey: globalRegionIndex,\n\tindex: globalRegionIndex,\n\tlang: 'ru',\n\tname: 'Without region',\n};\n\nexport const getRegionAuto = () => {\n\tregionAuto.name = useI18n().Common.Autoselect!;\n\n\treturn regionAuto;\n};\n\nexport const getSearcherAuto = () => {\n\tgetRegionAuto();\n\n\tsearcherAuto.name = useI18n().Common.Autoselect!;\n\tconsole.log(searcherAuto);\n\n\treturn searcherAuto;\n};\n\nexport const getRegionGlobal = () => {\n\tregionGlobal.name = useI18n().Keywords.Without_region!;\n\n\treturn regionGlobal;\n};\n","import type { Region, Searcher, SearcherByKey, SearcherIndexed } from '../types';\nimport { dummyIndex, getRegionGlobal, getSearcherAuto, searchersNames, searcherUndefined } from './consts';\nimport { useAsyncTopDialog } from '@/components/dialog/dialog/composables/utils';\n\n/**\n * Генерация Map ПС с Map регионов из массива searchers\n * - ключ для ПС - searcherKey\n * - ключ для региона - regionIndex\n *\n * Если поисковиков в списке нет, в список будет добавлен searcherUndefined\n *\n * Если регионов в списке нет, в список будет добавлен regionUndefined\n *\n * @param forFrequency - получить массив для просмотра частоты (или ставок)\n * @param autoRegion - добавить элемент с ключем -2, который в API заменяется на нужный ключ в зависимости от контекста\n * @param searchers - поисковики с регионами проекта, см.: get/projects_2/projects, show_searchers_and_regions = 1\n */\nexport const genSearcherByKey = (\n\tforFrequency: boolean = false,\n\tautoRegion: boolean = false,\n\tsearchers: Searcher[] = [],\n) => {\n\tlet searcherByKey: SearcherByKey;\n\n\tif (forFrequency) {\n\t\tsearcherByKey = genSearchersMapVolume(searchers);\n\t} else {\n\t\tsearcherByKey = genSearchersMapCommon(searchers);\n\t}\n\n\tif (autoRegion) searcherByKey.set(dummyIndex, getSearcherAuto());\n\tif (!searcherByKey.size) searcherByKey.set(dummyIndex, searcherUndefined);\n\n\treturn searcherByKey;\n};\n\n/**\n * Список ПС с регионами\n *\n * @param searchers\n * @param onlyEnabledRegions\n * @param forceSearchersKeys - ключи ПС, которые нееобходимо вывести в любом случае\n * @param forFrequency - для частоты будут выводиться только Яндекс, Google и Mail\n */\nconst genSearchersMapCommon = (\n\tsearchers: Searcher[],\n\tonlyEnabledRegions: boolean = true,\n\tforceSearchersKeys: Searcher['key'][] = [],\n\tforFrequency: boolean = false,\n) => {\n\tconst searcherByKey: Map<Searcher['key'], SearcherIndexed> = new Map();\n\n\t// настроенные ПС\n\tsearchers.forEach((searcher) => {\n\t\tif (!searcher.enabled) return;\n\t\tif (forFrequency && typeof searcher.key === 'number' && searcher.key > 1) return;\n\n\t\tconst searcherI = { ...searcher } as SearcherIndexed;\n\t\tsearcherI.regionByIndex = new Map();\n\n\t\tif (searcher.regions) {\n\t\t\tsearcher.regions.forEach((region: Region) => {\n\t\t\t\tif (onlyEnabledRegions && !region.enabled) return;\n\n\t\t\t\tconst regionI = { ...region };\n\t\t\t\tsearcherI.regionByIndex.set(regionI.index, regionI);\n\t\t\t});\n\t\t}\n\n\t\tif (!searcherI.regionByIndex.size && !forceSearchersKeys.length) {\n\t\t\t// searcherI.regionByIndex.set(regionUndefined.index, regionUndefined);\n\t\t}\n\n\t\tif (\n\t\t\t// режим вывода ПС без регионов\n\t\t\t!searcher.regions ||\n\n\t\t\t// есть включенные регионы\n\t\t\tsearcherI.regionByIndex.size ||\n\n\t\t\t// запрошен вывод конкретных ПС\n\t\t\tforceSearchersKeys.length\n\t\t) {\n\t\t\tif (typeof searcherI.key === 'number') searcherByKey.set(searcherI.key, searcherI);\n\t\t}\n\t});\n\n\t// дополнительные ПС\n\tforceSearchersKeys.forEach((searcherKey) => {\n\t\tif (searcherByKey.has(searcherKey)) return;\n\n\t\tconst searcherI: SearcherIndexed = {\n\t\t\tkey: searcherKey,\n\t\t\tname: searchersNames[searcherKey],\n\t\t\tregions: [],\n\t\t\tregionByIndex: new Map(),\n\t\t};\n\n\t\tsearcherByKey.set(searcherI.key, searcherI);\n\t});\n\n\treturn searcherByKey;\n};\n\n/**\n * Список ПС с регионами для проверки частоты (Яндекс, Google, Mail если добавлен в проект)\n *\n * @param searchers\n */\nconst genSearchersMapVolume = (searchers: Searcher[]) => {\n\tconst serarcherByKey = genSearchersMapCommon(searchers, false, [0, 1], true);\n\n\t// в Mail нет регионов\n\tif (serarcherByKey.has(2)) {\n\t\tconst searcherMail = serarcherByKey.get(2);\n\t\tif (searcherMail) searcherMail.regionByIndex = new Map();\n\t}\n\n\t// добавление глобального региона\n\tserarcherByKey.forEach((searcher) => {\n\t\tif (!searcher.regionByIndex) return;\n\n\t\tconst region = { ...getRegionGlobal() };\n\t\tsearcher.regionByIndex.set(region.index, region);\n\t});\n\n\treturn serarcherByKey;\n};\n\n/**\n * Поиск региона по заданному критерию из списка поисковиков проекта\n *\n * @param forFrequency - поиск региона для просмотра частоты или ставок\n * @param searchRegion - объект с параметрами региона, который следует найти\n * @param searchers\n */\nexport const findRegion = (forFrequency: boolean, searchRegion: Partial<Region>, searchers: Searcher[] = []) => {\n\tconst searcherByKey = genSearcherByKey(forFrequency, false, searchers);\n\n\tlet findedRegion: Region | undefined;\n\n\t// поиск ПС\n\tsearcherByKey.forEach((searcher) => {\n\t\tif (searchRegion.searcher_key !== undefined && searchRegion.searcher_key != searcher.key) return;\n\t\tif (!searcher.regions) return;\n\n\t\t// поиск региона\n\t\tsearcher.regions.forEach((region) => {\n\t\t\tif (findedRegion) return;\n\n\t\t\tif (searchRegion.key !== undefined && searchRegion.key != region.key) return;\n\t\t\tif (searchRegion.index !== undefined && searchRegion.index != region.index) return;\n\n\t\t\tif (!forFrequency) {\n\t\t\t\tif (searchRegion.lang !== undefined && searchRegion.lang != region.lang) return;\n\t\t\t\tif (searchRegion.device !== undefined && searchRegion.device != region.device) return;\n\t\t\t}\n\n\t\t\tregion.searcher_key = searcher.key;\n\t\t\tfindedRegion = region;\n\n\t\t\treturn false;\n\t\t});\n\n\t\tif (findedRegion) return false;\n\t});\n\n\treturn findedRegion;\n};\n\n/**\n * Открыть диалоговое окно с выбором нескольких регионов\n *\n * @see import('../dialog_selectorRegions/types').Props\n */\nexport const dialogSelectorRegions = useAsyncTopDialog(() => {\n\treturn import('@/components/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue');\n});\n","import { computed, type ComputedRef, ref } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport type { Props, SearcherByKey } from '../types';\nimport type { Option, Options } from '@/components/forms/select/types';\nimport { dummyIndex, searhcerCompareKey } from '../utils/consts';\nimport { getSearcherGIcon } from '@/core/utils/searchers';\n\n/**\n * Создание и управление реактивными переменными для выбора ПС\n *\n * @param props - входные props компонента\n * @param mapSearchers - Map ПС (реактивная)\n */\nexport const useSelectSearcher = (\n\tprops: Props,\n\tmapSearchers: ComputedRef<SearcherByKey>,\n) => {\n\tconst i18n = useI18n();\n\n\t/**\n\t * Ключ выбранной поисковой системы\n\t */\n\tconst searcherKey = ref(mapSearchers.value.keys().next().value ?? dummyIndex);\n\n\t/**\n\t * Коллекция опций для выбора ПС\n\t */\n\tconst optionBySearcherKey = computed(() => {\n\t\tconst res: Options = new Map();\n\t\tmapSearchers.value.forEach((searcher) => {\n\t\t\tlet option: Option = {\n\t\t\t\tvalue: searcher.key,\n\t\t\t\ttitle: searcher.name,\n\t\t\t};\n\n\t\t\tif (props.addSearcherIcon) option.icon = getSearcherGIcon(searcher.key);\n\n\t\t\tres.set(searcher.key, option);\n\t\t});\n\n\t\t// добавить режим сравнения, если есть хотя бы одна ПС с одним регионом\n\t\tif (props.addCompare && !res.has(dummyIndex)) {\n\t\t\tconst dummyOption: Option = {\n\t\t\t\tvalue: '',\n\t\t\t\ttitle: '--------------------',\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t\tres.set(dummyOption.value, dummyOption);\n\n\t\t\tconst compareOption: Option = {\n\t\t\t\tvalue: searhcerCompareKey,\n\t\t\t\ttitle: i18n.Common.Compare!,\n\t\t\t};\n\t\t\tres.set(compareOption.value, compareOption);\n\t\t}\n\n\t\treturn res;\n\t});\n\n\treturn {\n\t\tsearcherKey,\n\t\toptionBySearcherKey,\n\t};\n};\n","import { computed, type ComputedRef, ref, watch } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { getDeviceGIcon, getLangLabel } from '@/core/utils/searchers';\nimport type { Option } from '@/components/forms/select/types';\nimport { dummyIndex } from '../utils/consts';\nimport type { Props, Region, SearcherIndexed } from '../types';\n\n/**\n * Создание и управление реактивными переменными для выбора региона\n *\n * @param props - входные props компонента\n * @param activeSearcherIndexed - объект активной поисковой системы (реактивная)\n */\nexport const useSelectRegion = (props: Props, activeSearcherIndexed: ComputedRef<SearcherIndexed>) => {\n\tconst i18n = useI18n();\n\n\t/**\n\t * Индекс выбранного региона\n\t */\n\tconst regionIndex = ref(dummyIndex);\n\n\tif (props.modelValue.length === 1) {\n\t\tregionIndex.value = props.modelValue[0];\n\t}\n\n\tif (regionIndex.value === dummyIndex) {\n\t\tif (props.forFrequency) {\n\t\t\t// в качетсве ключа используется region.key, а не region.index\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.values().next().value?.key ?? dummyIndex;\n\t\t} else {\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.keys().next().value ?? dummyIndex;\n\t\t}\n\t}\n\n\t/**\n\t * Коллекция опций для выбора региона\n\t */\n\tconst optionByRegionIndex = computed(() => {\n\t\tconst options = new Map<number, Option>();\n\n\t\tactiveSearcherIndexed.value.regionByIndex?.forEach((region) => {\n\t\t\tlet regionLabel = region.name;\n\n\t\t\t// на частоту в текущей версии устройство и язык не влияют\n\t\t\t// обратите внимание, в качетсве ключа используется region.key, а не region.index\n\t\t\tif (props.forFrequency) {\n\t\t\t\tconst option: Option = {\n\t\t\t\t\tvalue: region.key,\n\t\t\t\t\ttitle: regionLabel,\n\t\t\t\t};\n\t\t\t\tif (!options.has(region.key)) options.set(region.key, option);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (region.device) {\n\t\t\t\tregionLabel += ' (' + i18n.Common['Device_' + region.device] + ')';\n\t\t\t}\n\n\t\t\tconst langLabel = getLangLabel(activeSearcherIndexed.value.key || 0, region.lang ?? '');\n\t\t\tif (langLabel) regionLabel += ' / ' + langLabel;\n\n\t\t\tconst option: Option = {\n\t\t\t\tvalue: region.index,\n\t\t\t\ttitle: regionLabel,\n\t\t\t\ticon: region.device ? getDeviceGIcon(region.device) : undefined,\n\t\t\t};\n\n\t\t\toptions.set(region.index, option);\n\t\t});\n\n\t\treturn options;\n\t});\n\n\t/**\n\t * Выбор максимально похожего региона в новой коллекции регионов\n\t */\n\twatch(optionByRegionIndex, (optionByRegionIndex, oldOptionByRegionIndex) => {\n\t\tif (props.onlySearcher || regionIndex.value !== undefined && optionByRegionIndex.get(regionIndex.value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet newRegionIndex = optionByRegionIndex.keys().next().value as Region['index'];\n\t\tif (regionIndex.value === dummyIndex || newRegionIndex === dummyIndex) {\n\t\t\tregionIndex.value = newRegionIndex;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionName = (oldOptionByRegionIndex?.get(regionIndex.value) as Option)?.title || '';\n\t\tlet regionMatchLevel = -1;\n\t\tfor (const [index, option] of optionByRegionIndex.entries()) {\n\t\t\tconst title = (option as Option).title;\n\n\t\t\tif (typeof title !== 'string' || typeof index === 'string') {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// полное совпадение\n\t\t\tif (title === regionName) {\n\t\t\t\tnewRegionIndex = index;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst regexpDevice = new RegExp(` \\\\((${i18n.Common['Device_1']}|${i18n.Common['Device_2']})\\\\)`);\n\t\t\tlet regionNameCompare = regionName;\n\t\t\tlet regionMatchLevelI = 3;\n\n\t\t\t// без устройства\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\t// без языка\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\t// без устройства и без языка\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\n\t\t\t\tregionNameCompare = regionNameCompare.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\n\n\t\t\t\tregionMatchLevelI--;\n\t\t\t}\n\n\t\t\tif (title.indexOf(regionNameCompare) === -1) continue;\n\t\t\tif (regionMatchLevelI <= regionMatchLevel) continue;\n\n\t\t\tregionMatchLevel = regionMatchLevelI;\n\t\t\tnewRegionIndex = index;\n\t\t}\n\n\t\tregionIndex.value = newRegionIndex;\n\t});\n\n\treturn {\n\t\tregionIndex,\n\t\toptionByRegionIndex,\n\t};\n};\n","import { type ComputedRef, ref, watch } from 'vue';\nimport type { Props, SearcherByKey } from '../types';\n\n/**\n * Создание и управление реактивными переменными для сравнения\n *\n * @param props - входные props компонента\n * @param searcherByKey - Map ПС (реактивная)\n * @param allRegionsIndexes - Все доступные индексы регионов (реактивная)\n */\nexport const useCompare = (props: Props, searcherByKey: ComputedRef<SearcherByKey>, allRegionsIndexes: ComputedRef<Set<number>>) => {\n\t/**\n\t * Индексы регионов/ПС в сравнение\n\t */\n\tconst regionsIndexes = ref<number[]>([]);\n\n\t/**\n\t * Загрузка индексов регионов для сравнения\n\t *\n\t * Если в modelValue передано несколько регионов, они будут установлены как выбранные для сравнения\n\t */\n\tconst compareLoad = () => {\n\t\tif (props.onlySearcher && searcherByKey.value) {\n\t\t\tregionsIndexes.value = Array.from(searcherByKey.value.keys());\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionsIndexesSaved: Props['modelValue'] = [];\n\n\t\tif (props.modelValue.length > 1) {\n\t\t\tregionsIndexesSaved = [...props.modelValue];\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t// загрузить индексы регионов, если они были сохранены\n\t\t\t\tregionsIndexesSaved = JSON.parse(\n\t\t\t\t\tlocalStorage.getItem('ui:project:regionSelector' + props.projectId + ':regionsIndexes') as string,\n\t\t\t\t) ?? [];\n\t\t\t} catch (e) {\n\n\t\t\t}\n\t\t}\n\n\t\t// убрать из сравнения регионы, которых нет в props.searchers\n\t\tif (regionsIndexesSaved.length) {\n\t\t\tregionsIndexesSaved = regionsIndexesSaved.filter((regionIndex) => {\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\n\t\t\t});\n\t\t}\n\n\t\t// если не сохранено ни одного региона, выбрать все регионы проекта\n\t\tif (!regionsIndexesSaved.length) {\n\t\t\tregionsIndexesSaved = Array.from(allRegionsIndexes.value);\n\t\t}\n\n\t\tregionsIndexes.value = [...regionsIndexesSaved];\n\t};\n\n\t/**\n\t * Сохранение выбранных регионов\n\t */\n\tconst compareSave = () => {\n\t\tif (regionsIndexes.value.length) {\n\t\t\tlocalStorage.setItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes', JSON.stringify(regionsIndexes.value));\n\t\t} else {\n\t\t\tlocalStorage.removeItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes');\n\t\t}\n\t};\n\n\twatch(regionsIndexes, () => {\n\t\tcompareSave();\n\t});\n\n\tif (props.addCompare) {\n\t\t// if (props.compareRegionsIndexes?.length) {\n\t\t// \tcompareRegionsIndexes.value = [...props.compareRegionsIndexes];\n\t\t// } else {\n\t\t// \tcompareLoad();\n\t\t// }\n\n\t\tcompareLoad();\n\t}\n\n\treturn {\n\t\tregionsIndexes,\n\t};\n};\n","import { computed, watch } from 'vue';\nimport { findRegion, genSearcherByKey } from '../utils/utils';\nimport { dummyIndex, globalRegionIndex, searcherUndefined, searhcerCompareKey } from '../utils/consts';\nimport type { Props, Region, SearcherIndexed } from '../types';\nimport { useSelectSearcher } from './selectSearcher';\nimport { useSelectRegion } from './selectRegion';\nimport { useCompare } from './compare';\n\n/**\n * Создание и управления рективными переменными компонента\n *\n * @param props - входные props компонента\n */\nexport const useSelectorRegion = (props: Props) => {\n\tconst searcherByKey = computed(() => {\n\t\treturn genSearcherByKey(props.forFrequency, props.autoRegion, props.searchers);\n\t});\n\n\tconst activeSearcherIndexed = computed(() => {\n\t\treturn searcherByKey.value.get(selectSearcher.searcherKey.value) || searcherUndefined;\n\t});\n\n\t/**\n\t * Все индексы регионов из searcherByKey\n\t *\n\t * Активность регионов определяется в searcherByKey\n\t */\n\tconst allRegionsIndexes = computed(() => {\n\t\tconst regionsIndexes = new Set<number>();\n\n\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\tsearcher.regionByIndex.forEach((region) => {\n\t\t\t\tif (region.index === globalRegionIndex) return;\n\t\t\t\tif (region.index === dummyIndex) return;\n\n\t\t\t\tregionsIndexes.add(region.index);\n\t\t\t});\n\t\t});\n\n\t\treturn regionsIndexes;\n\t});\n\n\tconst selectSearcher = useSelectSearcher(props, searcherByKey);\n\tconst selectRegion = useSelectRegion(props, activeSearcherIndexed);\n\tconst compare = useCompare(props, searcherByKey, allRegionsIndexes);\n\n\t// контроль за внешним изменением списка ПС\n\twatch(searcherByKey, () => {\n\t\t// возможные значения для сравнения регионов/пс\n\t\tif (props.onlySearcher) {\n\t\t\tcompare.regionsIndexes.value = Array.from(searcherByKey.value.keys());\n\t\t} else {\n\t\t\tcompare.regionsIndexes.value = compare.regionsIndexes.value.filter(regionIndex => {\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\n\t\t\t});\n\t\t}\n\n\t\tif (selectSearcher.searcherKey.value === searhcerCompareKey) return;\n\n\t\tlet newSearcherKey = searcherByKey.value.keys().next().value;\n\n\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\t// определить выбранную ПС\n\t\t\tif (props.onlySearcher && searcher.key === selectSearcher.searcherKey.value) {\n\t\t\t\tnewSearcherKey = selectSearcher.searcherKey.value;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tselectRegion.regionIndex.value &&\n\t\t\t\tsearcher.regionByIndex?.has(selectRegion.regionIndex.value)\n\t\t\t) {\n\t\t\t\tnewSearcherKey = searcher.key;\n\t\t\t}\n\n\t\t\t// выбрать первую ПС с выбранным регионом\n\t\t\tif (!props.onlySearcher) {\n\t\t\t\tlet regionsNewSearcher: SearcherIndexed['regionByIndex'] | undefined;\n\n\t\t\t\tif (newSearcherKey !== undefined) {\n\t\t\t\t\tregionsNewSearcher = searcherByKey.value.get(newSearcherKey)?.regionByIndex;\n\t\t\t\t}\n\n\t\t\t\tconst regionsCurrentSearcher = searcherByKey.value.get(searcher.key)?.regionByIndex;\n\t\t\t\tif (\n\t\t\t\t\tregionsNewSearcher?.has(dummyIndex) &&\n\t\t\t\t\t!regionsCurrentSearcher?.has(dummyIndex)\n\t\t\t\t) {\n\t\t\t\t\tnewSearcherKey = searcher.key;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// if (props.addCompare && !selectSearcher.optionBySearcherKey.value.has(dummyIndex)) {\n\t\t// \tif (!selectRegion.regionIndex.value && compare.regionsIndexes.value?.length) newSearcherKey = searhcerCompareKey;\n\t\t// }\n\n\t\t// if (props.onlySearcher && selectRegion.regionIndex.value !== dummyIndex) newSearcherKey = selectRegion.regionIndex.value;\n\n\t\tif (newSearcherKey !== undefined) {\n\t\t\tselectSearcher.searcherKey.value = newSearcherKey;\n\t\t}\n\n\t\tif (\n\t\t\tselectRegion.regionIndex.value !== undefined &&\n\t\t\t!(activeSearcherIndexed.value?.regionByIndex)?.has(selectRegion.regionIndex.value)\n\t\t) {\n\t\t\tselectRegion.regionIndex.value = activeSearcherIndexed.value?.regions?.keys().next().value as number;\n\t\t}\n\t}, { immediate: true });\n\n\tconst getSearcherKey = () => {\n\t\tif (selectSearcher.searcherKey.value === searhcerCompareKey || selectSearcher.searcherKey.value === dummyIndex) return;\n\n\t\treturn selectSearcher.searcherKey.value;\n\t};\n\n\tconst getRegionIndex = () => {\n\t\tif (props.onlySearcher) return;\n\n\t\tif (selectRegion.regionIndex.value === dummyIndex) return;\n\n\t\tlet res: Region['index'] | undefined = selectRegion.regionIndex.value;\n\n\t\t// в качестве ключа используется region.key\n\t\tif (props.forFrequency) {\n\t\t\tconst regionKey = selectRegion.regionIndex.value;\n\t\t\tconst region = findRegion(props.forFrequency, { searcher_key: getSearcherKey(), key: regionKey } as Region, props.searchers);\n\n\t\t\tres = region?.index;\n\t\t}\n\n\t\treturn res;\n\t};\n\n\t/**\n\t * Получить выбранную ПС\n\t */\n\tconst getSearcher = () => {\n\t\tconst searcherKey = getSearcherKey();\n\t\tif (searcherKey === undefined) return;\n\n\t\treturn searcherByKey.value.get(searcherKey);\n\t};\n\n\t/**\n\t * Получить выбранный регион\n\t */\n\tconst getRegion = () => {\n\t\tconst regionIndex = getRegionIndex();\n\t\tif (regionIndex === undefined) return;\n\n\t\treturn getSearcher()?.regionByIndex?.get(regionIndex);\n\t};\n\n\treturn {\n\t\tselectSearcher,\n\t\tselectRegion,\n\t\tcompare,\n\n\t\tsearcherByKey,\n\t\tallRegionsIndexes,\n\n\t\tgetSearcher,\n\t\tgetRegion,\n\t};\n};\n","<script setup lang=\"ts\">\nimport { watch } from 'vue';\nimport type { Props, Region } from './types';\nimport Select from '@/components/forms/select/select.vue';\nimport Button from '@/components/forms/button/button.vue';\nimport { useSelectorRegion } from './composables/selectorRegion';\nimport { dummyIndex, globalRegionIndex, searhcerCompareKey } from './utils/consts';\nimport { dialogSelectorRegions } from '@/components/project/selectorRegion/utils/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tsearchers: () => [],\n\t// compareRegionsIndexes: () => [],\n\taddSearcherIcon: true,\n\taddRegionIcon: true,\n\taddChanger: true,\n});\n\nconst model = defineModel<Props['modelValue']>({ required: true });\nconst modelSingle = defineModel<Props['modelValueSingle']>('modelValueSingle');\n\nconst {\n\tselectSearcher,\n\tselectRegion,\n\tcompare,\n\n\tsearcherByKey,\n\tallRegionsIndexes,\n\n\tgetSearcher,\n\tgetRegion,\n} = useSelectorRegion(props);\n\nconst onClickCompare = () => {\n\tconst regions: Region[] = [];\n\n\tsearcherByKey.value.forEach((searcher) => {\n\t\tif (!searcher.enabled) return;\n\n\t\tsearcher.regions.forEach((region) => {\n\t\t\tif (!region.enabled) return;\n\n\t\t\tregions.push(region);\n\t\t});\n\t});\n\n\tdialogSelectorRegions.open('selectorRegions', {\n\t\tregions,\n\t\tregionsIndexes: compare.regionsIndexes.value,\n\t\t'@update:regionsIndexes': (regionsIndexes: number[]) => compare.regionsIndexes.value = regionsIndexes,\n\t});\n};\n\nwatch([selectRegion.regionIndex, selectSearcher.searcherKey, compare.regionsIndexes], () => {\n\tif (selectSearcher.searcherKey.value === searhcerCompareKey && compare.regionsIndexes.value.length) {\n\t\tif (JSON.stringify(model.value) === JSON.stringify(compare.regionsIndexes.value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tmodel.value = [...compare.regionsIndexes.value];\n\t} else {\n\t\tif (props.onlySearcher) {\n\t\t\tmodel.value = [selectSearcher.searcherKey.value];\n\n\t\t\tif (selectSearcher.searcherKey.value === dummyIndex && !props.autoRegion) model.value.length = 0;\n\t\t} else {\n\t\t\tmodel.value = [selectRegion.regionIndex.value];\n\n\t\t\t// не добавлять несуществующий регион в результаты\n\t\t\tif (selectRegion.regionIndex.value === dummyIndex && !props.autoRegion) model.value.length = 0;\n\t\t}\n\t}\n\n\t// регионов нет\n\tif (!props.onlySearcher && !allRegionsIndexes.value.size) {\n\t\tselectSearcher.searcherKey.value = dummyIndex;\n\t}\n});\n\nif (modelSingle.value) {\n\twatch(modelSingle, () => {\n\t\tif (modelSingle.value) {\n\t\t\tmodel.value = [modelSingle.value];\n\t\t}\n\t}, { immediate: true });\n}\n\nwatch(model, () => {\n\tif (model.value[0]) {\n\t\tmodelSingle.value = model.value[0];\n\t}\n\n\t// проверка входных данных v-model на корректность\n\tif (props.onlySearcher) {\n\t\tif (\n\t\t\t!model.value.length ||\n\t\t\tmodel.value.length === 1 && !searcherByKey.value.has(model.value[0]) ||\n\t\t\tmodel.value.length === 1 && model.value[0] === dummyIndex && !props.autoRegion\n\t\t) {\n\t\t\tlet defaultKey: number | undefined = searcherByKey.value.keys().next().value;\n\n\t\t\t// запретить устанавливать несуществующий регион\n\t\t\tif (defaultKey === dummyIndex && !props.autoRegion) {\n\t\t\t\tdefaultKey = undefined;\n\n\t\t\t\tmodelSingle.value = dummyIndex;\n\t\t\t}\n\n\t\t\tif (defaultKey !== undefined) {\n\t\t\t\tmodel.value = [defaultKey];\n\t\t\t}else{\n\t\t\t\tmodel.value.length = 0;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tmodel.value.length > 1 &&\n\t\t\tJSON.stringify(model.value) !== JSON.stringify(compare.regionsIndexes.value)\n\t\t) {\n\t\t\tmodel.value = [...compare.regionsIndexes.value];\n\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tlet newModel = [...new Set(model.value)];\n\n\t\tlet defaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.keys().next().value;\n\t\tif (props.forFrequency) {\n\t\t\tdefaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.values().next().value?.key;\n\t\t}\n\n\t\t// запретить устанавливать несуществующий регион\n\t\tif (defaultIndex === dummyIndex && !props.autoRegion) {\n\t\t\tdefaultIndex = undefined;\n\n\t\t\tmodelSingle.value = dummyIndex;\n\t\t}\n\n\t\tif (!newModel.length) {\n\t\t\tif (defaultIndex !== undefined) {\n\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t}\n\t\t} else if (newModel.length === 1) {\n\t\t\tlet all = allRegionsIndexes.value;\n\n\t\t\tif (props.forFrequency) {\n\t\t\t\tall = new Set();\n\t\t\t\tsearcherByKey.value.forEach((searcher) => {\n\t\t\t\t\tsearcher.regionByIndex.forEach((region) => {\n\t\t\t\t\t\tif (region.index === globalRegionIndex) return;\n\t\t\t\t\t\tif (region.index === dummyIndex) return;\n\n\t\t\t\t\t\tall.add(region.key);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// убрано, так как dummyIndex запрещено выбирать в model\n\t\t\t// if (!all.has(newModel[0]) && newModel[0] !== dummyIndex) {\n\t\t\tif (!all.has(newModel[0])) {\n\t\t\t\tnewModel = [];\n\t\t\t\tif (defaultIndex !== undefined) {\n\t\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tnewModel = newModel.filter(index => allRegionsIndexes.value.has(index));\n\t\t\tif (!newModel.length && defaultIndex !== undefined) {\n\t\t\t\tnewModel.push(defaultIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (JSON.stringify(model.value) !== JSON.stringify(newModel)) {\n\t\t\tmodel.value = newModel;\n\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// входные данные v-model совпадают с внутренними значениями\n\tif (\n\t\tmodel.value.length === 1 &&\n\t\tmodel.value[0] === (props.onlySearcher ? selectSearcher.searcherKey.value : selectRegion.regionIndex.value)\n\t) {\n\t\treturn;\n\t}\n\n\t// if (\n\t// \tmodel.value.length > 1 &&\n\t// \tselectorSearcher.searcherKey.value === searhcerCompareKey &&\n\t// \tJSON.stringify(model.value) === JSON.stringify(selectorCompare.regionsIndexes.value)\n\t// ) {\n\t// \treturn;\n\t// }\n\n\t// обновление regionIndex, searcherKey, selectorCompare.regionsIndexes\n\tif (props.onlySearcher) {\n\t\t// if (!model.value.length) {\n\t\t// \tselectorSearcher.searcherKey.value = dummyIndex;\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\n\t\tif (model.value.length === 1) {\n\t\t\tselectSearcher.searcherKey.value = model.value[0];\n\n\t\t\treturn;\n\t\t}\n\n\t\tselectSearcher.searcherKey.value = searhcerCompareKey;\n\n\t\treturn;\n\t} else {\n\t\tif (!model.value.length) {\n\t\t\t// selectSearcher.searcherKey.value = dummyIndex;\n\t\t\t// selectRegion.regionIndex.value = dummyIndex;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (model.value.length === 1 && selectSearcher.searcherKey.value !== searhcerCompareKey) {\n\t\t\tselectRegion.regionIndex.value = model.value[0];\n\n\t\t\tlet newSearherKey: number | undefined;\n\t\t\tfor (const searcher of searcherByKey.value.values()) {\n\t\t\t\tfor (const region of searcher.regionByIndex.values()) {\n\t\t\t\t\tconst currentRegionIndex = props.forFrequency ? region.key : region.index;\n\t\t\t\t\tif (currentRegionIndex === selectRegion.regionIndex.value) {\n\t\t\t\t\t\tnewSearherKey = searcher.key;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (newSearherKey !== undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newSearherKey !== undefined) {\n\t\t\t\tselectSearcher.searcherKey.value = newSearherKey;\n\t\t\t}\n\t\t} else {\n\t\t\tselectSearcher.searcherKey.value = searhcerCompareKey;\n\t\t\tcompare.regionsIndexes.value = [...model.value];\n\t\t}\n\t}\n}, { immediate: true });\n\ndefineExpose({\n\tgetSearcher,\n\tgetRegion,\n});\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-selectorRegion': true,\n\t\t\t'top-selectorRegion-onlySearcher': onlySearcher,\n\t\t}\"\n\t>\n\t\t<Select\n\t\t\t:options=\"selectSearcher.optionBySearcherKey.value\"\n\t\t\tv-model=\"selectSearcher.searcherKey.value\"\n\t\t\tname=\"searcher_key\"\n\t\t\t:addChanger=\"addChanger\"\n\t\t/>\n\n\t\t<Select\n\t\t\tv-if=\"!onlySearcher && selectSearcher.searcherKey.value !== searhcerCompareKey\"\n\t\t\tclass=\"top-select-region\"\n\t\t\t:options=\"selectRegion.optionByRegionIndex.value\"\n\t\t\tv-model=\"selectRegion.regionIndex.value\"\n\t\t\t:name=\"forFrequency ? 'region_key' : 'region_index'\"\n\t\t\t:addChanger=\"addChanger\"\n\t\t\t:data-top-icon=\"addRegionIcon ? '' : undefined\"\n\t\t/>\n\n\t\t<Button\n\t\t\tv-if=\"addCompare && !onlySearcher && selectSearcher.searcherKey.value === searhcerCompareKey\"\n\t\t\tname=\"compare\"\n\t\t\t@click=\"onClickCompare\"\n\t\t\t:data-count-compare-regions-indexes=\"compare.regionsIndexes.value.length\"\n\t\t>\n\t\t\t{{ $i18n.Common.Selected_regions }}\n\t\t</Button>\n\t</div>\n</template>\n\n<style>\n@import \"./styles/searcherColors.css\";\n\n.top-selectorRegion {\n\twidth: 340px;\n\tdisplay: inline-flex;\n\tvertical-align: middle;\n}\n\n.top-selectorRegion > .top-select {\n\tflex-grow: 1;\n}\n\n.top-selectorRegion > .top-select:focus-within {\n\tz-index: 4;\n}\n\n.top-selectorRegion > .top-select > .top-select_select:hover,\n.top-selectorRegion > .top-select > .top-select_select.top-error {\n\tz-index: 1;\n}\n\n.top-selectorRegion > .top-select-searcher_key {\n\twidth: 140px;\n\tmax-width: 160px;\n\tmargin-right: -1px;\n}\n\n.top-selectorRegion > .top-select-region > select {\n\tborder-top-left-radius: 0;\n\tborder-bottom-left-radius: 0;\n}\n\n.top-selectorRegion > .top-select-region {\n\t--top-icon-size: 20px;\n\t--top-icon-color: var(--color-text-primary);\n\n\t--top-icon2-size: 20px;\n\t--top-icon2-color: var(--color-text-primary);\n}\n\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2] {\n\t--top-icon2-size: 16px;\n}\n\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2]:after {\n\ttext-indent: -4px;\n}\n\n.top-selectorRegion > [name=\"compare\"] {\n\tborder-top-left-radius: 0;\n\tborder-bottom-left-radius: 0;\n\tflex-grow: 1;\n}\n\n.top-selectorRegion > [name=\"compare\"]:after {\n\tcontent: \"(\" attr(data-count-compare-regions-indexes) \")\";\n\tmargin: 0 0 0 6px;\n}\n\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key > select {\n\tborder-top-right-radius: 0;\n\tborder-bottom-right-radius: 0;\n\tmargin-right: 0;\n}\n\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key[data-value=\"-1\"] > select {\n\tborder-right: none;\n}\n\n.top-selectorRegion-onlySearcher {\n\twidth: 140px;\n}\n</style>\n","import type { Props as TagSelectorOpenerProps } from '../popupOpener/types';\nimport type { Tag, TagIdExclude } from '../types';\n\n/**\n * Полуичить значение исключения тега tagId\n */\nexport const genTagIdExcluded = (tagId: Tag['id']): TagIdExclude => {\n\treturn '-' + tagId as TagIdExclude;\n};\n\n/**\n * Вернуть чистый tagId без exclude флага\n */\nexport const genTagIdClear = (tagId: Tag['id'] | TagIdExclude) => {\n\tif (tagId[0] === '-') return tagId.substring(1) as Tag['id'];\n\n\treturn tagId as Tag['id'];\n};\n\n/**\n * Получить инфомрацию о теге по его id\n */\nexport const getTagById = (tagId: Tag['id'] | TagIdExclude, tags: TagSelectorOpenerProps['tags']) => {\n\ttagId = genTagIdClear(tagId);\n\n\tconst tag = tags.find(tag => tag.id === tagId);\n\tif (!tag) return;\n\n\treturn tag;\n};\n","import { isRef, type Ref, ref, unref, watch } from 'vue';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { storage } from '@/core/utils/dom';\nimport TopPopupWorker from '@/components/popup/lib/worker';\nimport type { OpenerProps as PopupOpenerProps } from '@/components/popup/popup/opener/types';\nimport type { Props as TagSelectorOpenerProps, TagSelectorTarget } from '../popupOpener/types';\nimport type { Props as TagIconProps } from '../tagIcon/types';\nimport { genTagIdClear, getTagById } from './utils';\n\n/**\n * Сгенерировать элемент для открытия popup с выбором тегов\n *\n * Альтернатива TopTagSelectorPopupOpener для работы вне vue\n *\n * Требует монтирования компонента TopTagSelector\n */\nexport const genElPopupOpener = (\n\tprops: TagSelectorOpenerProps & { modelValue: TagSelectorOpenerProps['modelValue'] | Ref<TagSelectorOpenerProps['modelValue']> },\n\tpropsPopup?: Partial<PopupOpenerProps>,\n\thtmlSetterSeveral?: string,\n): HTMLElement => {\n\tif (!propsPopup) propsPopup = { id: props.id };\n\n\t// Значения по умолчанию см. в: `@/components/popup/popup/opener.vue`\n\tpropsPopup.id = props.id;\n\tpropsPopup.pos ??= '3';\n\tpropsPopup.notch ??= true;\n\tpropsPopup.posBy ??= 'fixed';\n\n\tconst el = TopPopupWorker.genElPopupOpener('div', propsPopup as PopupOpenerProps);\n\n\tel.classList.add('top-tagSelector');\n\tif (props.useTopButton) el.classList.add('top-tagSelector-useTopButton', 'top-button', 'top-color_theme', 'top-as-selector');\n\tif (!props.useTopButton) el.classList.add('top-tagSelector-custom');\n\tif (props.mode === 'filter') el.classList.add('top-tagSelector-filter');\n\tif (props.mode === 'setter' && !props.filters) el.classList.add('top-tagSelector-setter_single');\n\tif (props.mode === 'setter' && props.filters) el.classList.add('top-tagSelector-setter_several');\n\n\t// прокcи клик: lazy connect\n\tel.onclick = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tel.onclick = null;\n\n\t\tconst model = ref(props.modelValue);\n\n\t\tconst target: TagSelectorTarget = {\n\t\t\tmodel,\n\t\t\tmode: props.mode,\n\t\t\ttargetId: props.targetId,\n\t\t\tfilters: props.filters,\n\t\t\tpayload: props.payload,\n\t\t};\n\n\t\tstorage(el, 'topTagSelectorTarget', target);\n\n\t\tdelete el.dataset.topPopupDisabled;\n\n\t\tif (!isRef(props.modelValue)) {\n\t\t\twatch(model, () => {\n\t\t\t\tprops.modelValue = model.value;\n\n\t\t\t\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\t\t\t});\n\t\t}\n\n\t\t// выполнение клика\n\t\tel.click();\n\t};\n\n\tif (isRef(props.modelValue)) {\n\t\twatch(props.modelValue, () => elPopupOpenerRender(el, props, htmlSetterSeveral));\n\t} else {\n\t\tstorage(el, 'topTagSelectorRender', (modelValue: TagSelectorOpenerProps['modelValue']) => {\n\t\t\tprops.modelValue = modelValue;\n\n\t\t\tconst target = storage(el, 'topTagSelectorTarget');\n\t\t\tif (target) target.model.value = modelValue;\n\n\t\t\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\t\t});\n\t}\n\n\telPopupOpenerRender(el, props, htmlSetterSeveral);\n\n\treturn el;\n};\n\n/**\n * Вызвать перерисовку элемента, который был создан через genElPopupOpener()\n *\n * Работет только для элементов не с реактивным modelValue\n */\nexport const renderElPopupOpener = (el: HTMLElement, modelValue: TagSelectorOpenerProps['modelValue']) => {\n\tstorage(el, 'topTagSelectorRender')?.(modelValue);\n};\n\n/**\n * Отрисовать TopTagSelecorPopupOpener\n */\nconst elPopupOpenerRender = (el, props: TagSelectorOpenerProps, htmlSetterSeveral?: string) => {\n\tconst tagsIds = unref(props.modelValue);\n\n\tel.classList.toggle('top-tagSelector-selectedOne', !tagsIds.length || tagsIds.length === 1);\n\tel.classList.toggle('top-tagSelector-toTwoLine', tagsIds.length > 5);\n\n\tif (props.mode === 'setter' && props.filters) {\n\t\tel.innerHTML = `<div>${htmlSetterSeveral}</div>`;\n\n\t\treturn;\n\t}\n\n\tel.innerHTML = '';\n\n\tif (!tagsIds.length && props.mode === 'filter') {\n\t\tconst elTagIcon = genElTagIcon({\n\t\t\tid: 'all',\n\t\t\tcolorId: '',\n\t\t\tname: useI18n().Common?.All_tags ?? '',\n\t\t\tstate: '',\n\t\t});\n\n\t\tel.append(elTagIcon);\n\t}\n\n\ttagsIds.forEach(tagId => {\n\t\tconst elTagIcon = genElTagIcon({\n\t\t\tid: genTagIdClear(tagId),\n\t\t\tcolorId: getTagById(tagId, props.tags)?.color_id ?? '',\n\t\t\tname: getTagById(tagId, props.tags)?.name ?? '',\n\t\t\tstate: genTagIdClear(tagId) === tagId ? 'selected' : 'excluded',\n\t\t});\n\n\t\tel.append(elTagIcon);\n\t});\n};\n\n/**\n * Сгенерировтаь элемент для открытия popup с выбором тегов\n *\n * Альтернатива TopTagSelecorTagIcon для работы вне vue\n */\nconst genElTagIcon = (props: TagIconProps) => {\n\tconst el = document.createElement('div');\n\n\tel.classList.add('top-tagSelector_tagIcon');\n\tel.classList.toggle('top-tagSelector-active', !!props.state);\n\tel.classList.toggle('top-tagSelector-excluded', props.state === 'excluded');\n\n\tel.dataset.tag_id = props.id;\n\tel.dataset.tag_color_id = props.colorId;\n\tel.title = props.name;\n\n\treturn el;\n};\n","import type { Tag } from './types';\n\nexport default [\n\t{\n\t\tid: '1',\n\t\tname: 'Without Tag',\n\t\tcolor_id: '1',\n\t},\n\t{\n\t\tid: '2',\n\t\tname: 'Red',\n\t\tcolor_id: '2',\n\t},\n\t{\n\t\tid: '3',\n\t\tname: 'Orange',\n\t\tcolor_id: '3',\n\t},\n\t{\n\t\tid: '4',\n\t\tname: 'Yellow',\n\t\tcolor_id: '4',\n\t},\n\t{\n\t\tid: '5',\n\t\tname: 'Blue',\n\t\tcolor_id: '5',\n\t},\n\t{\n\t\tid: '6',\n\t\tname: 'Purple',\n\t\tcolor_id: '6',\n\t},\n\t{\n\t\tid: '7',\n\t\tname: 'Green',\n\t\tcolor_id: '7',\n\t},\n\t{\n\t\tid: '8',\n\t\tname: 'Magenta',\n\t\tcolor_id: '8',\n\t},\n\t{\n\t\tid: '9',\n\t\tname: 'Dark blue',\n\t\tcolor_id: '9',\n\t},\n\t{\n\t\tid: '10',\n\t\tname: 'Turquoise',\n\t\tcolor_id: '10',\n\t},\n] as Tag[];\n","<script setup lang=\"ts\">\nimport type { Props } from './types';\n\ndefineProps<Props>();\n</script>\n\n<template>\n\t<div\n\t\t:class=\"{\n\t\t\t'top-tagSelector_tagIcon': true,\n\t\t\t'top-tagSelector-active': !!state,\n\t\t\t'top-tagSelector-excluded': state === 'excluded',\n\t\t}\"\n\t\t:data-tag_id=\"id\"\n\t\t:data-tag_color_id=\"colorId\"\n\t\t:title=\"name\"\n\t></div>\n</template>\n\n<style>\n[data-tag_id] { display: inline-flex; gap: var(--top-gap-2); align-items: center; }\n\n[data-tag_id=\"\"] { border-color: #bdc3c7 !important; color: #55555F !important; }\n[data-tag_color_id=\"1\"] { border-color: var(--color-tag-1) !important; color: #55555F !important; }\n[data-tag_color_id=\"2\"] { border-color: var(--color-tag-2) !important; color: var(--color-tag-2) !important; }\n[data-tag_color_id=\"3\"] { border-color: var(--color-tag-3) !important; color: var(--color-tag-3) !important; }\n[data-tag_color_id=\"4\"] { border-color: var(--color-tag-4) !important; color: var(--color-tag-4) !important; }\n[data-tag_color_id=\"5\"] { border-color: var(--color-tag-5) !important; color: var(--color-tag-5) !important; }\n[data-tag_color_id=\"6\"] { border-color: var(--color-tag-6) !important; color: var(--color-tag-6) !important; }\n[data-tag_color_id=\"7\"] { border-color: var(--color-tag-7) !important; color: var(--color-tag-7) !important; }\n[data-tag_color_id=\"8\"] { border-color: var(--color-tag-8) !important; color: var(--color-tag-8) !important; }\n[data-tag_color_id=\"9\"] { border-color: var(--color-tag-9) !important; color: var(--color-tag-9) !important; }\n[data-tag_color_id=\"10\"] { border-color: var(--color-tag-10) !important; color: var(--color-tag-10) !important; }\n\n[data-tag_id=\"\"].top-tagSelector-active { background: #bdc3c7 !important; }\n[data-tag_color_id=\"1\"].top-tagSelector-active { background: var(--color-tag-1) !important; }\n[data-tag_color_id=\"2\"].top-tagSelector-active { background: var(--color-tag-2) !important; }\n[data-tag_color_id=\"3\"].top-tagSelector-active { background: var(--color-tag-3) !important; }\n[data-tag_color_id=\"4\"].top-tagSelector-active { background: var(--color-tag-4) !important; }\n[data-tag_color_id=\"5\"].top-tagSelector-active { background: var(--color-tag-5) !important; }\n[data-tag_color_id=\"6\"].top-tagSelector-active { background: var(--color-tag-6) !important; }\n[data-tag_color_id=\"7\"].top-tagSelector-active { background: var(--color-tag-7) !important; }\n[data-tag_color_id=\"8\"].top-tagSelector-active { background: var(--color-tag-8) !important; }\n[data-tag_color_id=\"9\"].top-tagSelector-active { background: var(--color-tag-9) !important; }\n[data-tag_color_id=\"10\"].top-tagSelector-active { background: var(--color-tag-10) !important; }\n\n[data-tag_id=\"all\"] {\n\tborder-color: transparent !important; background: none !important;\n}\n\n[data-tag_id=\"all\"]:before {\n\tcontent: \"\";\n\tcolor: var(--color-tag-all) !important;\n\tfont-size: 26px;\n\tmin-width: calc(100% + 4px);\n\theight: calc(100% + 4px);\n\tmargin-top: -18px;\n\tmargin-left: -8px;\n}\n\n/* в кнопке выбора тэгов и в popup */\n.top-tagSelector-useTopButton [data-tag_id],\n.top-tagSelector_popup [data-tag_id] {\n\t--top-tag-selector-size: 10px;\n\n\tbox-sizing: content-box;\n\tborder-radius: 100%; border: 2px solid var(--color-layout-front-1); background: var(--color-layout-front-1);\n\twidth: var(--top-tag-selector-size);\n\theight: var(--top-tag-selector-size);\n\tfont-size: calc(var(--top-tag-selector-size) + 4px);\n\t/*font-family: inherit !important;*/\n}\n\n/* исключение тегов */\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id],\n[data-tag_id].top-tagSelector-excluded { position: relative; }\n\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id]:before,\n[data-tag_id].top-tagSelector-excluded:before {\n\tcontent: \"\";\n\twidth: calc(var(--top-tag-selector-size) * 2); height: 1px; background: inherit;\n\ttransform: rotate(-45deg); filter: brightness(80%);\n\tdisplay: block;\n\tposition: absolute; top: calc(var(--top-tag-selector-size) / 2); left: calc(0px - var(--top-tag-selector-size) / 2);\n}\n.top-body-press_ctrl .top-tagSelector_tagListItem-canExclude:hover [data-tag_id]:not([data-tag_id=\"all\"]):not(.top-tagSelector-active):before { background: #AAA; }\n[data-tag_id].top-tagSelector-excluded:after,\n[data-tag_id].top-tagSelector-excluded ~ .top-tagSelector_tagListItemName { text-decoration: line-through; }\n\n/* popup */\n.top-popup_listItem.top-tagSelector-active { background: var(--top-popup-background-color-active) !important; }\n\n.top-popup_listItem:hover [data-tag_id=\"all\"]:before { border-color: var(--top-popup-background-color-hover); }\n.top-popup_listItem.top-tagSelector-active [data-tag_id=\"all\"]:before,\n.top-popup_listItem.top-active [data-tag_id=\"all\"]:before { border-color: var(--top-popup-background-color-active); }\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from 'vue';\nimport type { Emits, Props } from './types';\nimport TopTagIcon from '../tagIcon/tagIcon.vue';\nimport TopPopupListItem from '@/components/popup/popup/listItem.vue';\n\nconst props = defineProps<Props>();\nconst emit = defineEmits<Emits>();\n\nconst name = defineModel<Props['name']>('name', {\n\trequired: true,\n});\n\nconst elName = ref<HTMLElement | null>(null);\n\n/**\n * @todo Удалить через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии\n */\nconst firefoxProps = computed(() => {\n\tif (navigator.userAgent.indexOf('Firefox') != -1) {\n\n\t\treturn {\n\t\t\tcontenteditable: inEdit.value,\n\t\t\tonpaste: (event: Event) => event.preventDefault(),\n\t\t};\n\t}\n\n\treturn {};\n});\n\n/**\n * Включен режим редактирвоания\n */\nconst inEdit = ref(false);\n\n/**\n * Включить режим редактирование\n */\nconst turnToEdit = async () => {\n\tinEdit.value = true;\n\n\tawait nextTick();\n\n\telName.value?.focus();\n};\n\n/**\n * Применить редактирование\n */\nconst editCommit = () => {\n\tconst name = elName.value?.innerText;\n\tif (!name) return editCancel();\n\n\tif (elName.value) elName.value.innerText = name;\n\n\tinEdit.value = false;\n\n\temit('update:name', name);\n};\n\n/**\n * Отменить редактирование\n */\nconst editCancel = async () => {\n\tif (elName.value) elName.value.innerText = props.name;\n\n\tinEdit.value = false;\n};\n\n/**\n * Применить выбор\n */\nconst changeSelect = (e: MouseEvent) => {\n\t// в режиме редактирования выбор не применяется\n\tif (inEdit.value) return;\n\n\t// тег запрещено выбирать\n\tif (props.disabled) return;\n\n\tlet toState: Props['state'] = 'selected';\n\n\tif (props.canExclude) {\n\t\tif (e.ctrlKey || e.metaKey) {\n\t\t\ttoState = 'excluded';\n\t\t}\n\t}\n\n\tif (props.state == toState) {\n\t\ttoState = '';\n\t}\n\n\tif (toState === '') emit('unselect');\n\tif (toState === 'selected') emit('select');\n\tif (toState === 'excluded') emit('exclude');\n};\n</script>\n\n<template>\n\t<TopPopupListItem\n\t\t:class=\"{\n\t\t\t'top-tagSelector_tagListItem': true,\n\t\t\t'top-tagSelector_tagListItem-inEdit': inEdit,\n\t\t\t'top-tagSelector_tagListItem-disabled': disabled,\n\t\t\t'top-tagSelector_tagListItem-canExclude': canExclude,\n\t\t\t'top-tagSelector-active': !!state,\n\t\t\t'top-tagSelector-excluded': state === 'excluded'\n\t\t}\"\n\t\t@click.stop=\"changeSelect\"\n\t>\n\t\t<TopTagIcon\n\t\t\t:id\n\t\t\t:name\n\t\t\t:colorId\n\t\t\t:state\n\t\t/>\n\n\t\t<span\n\t\t\tref=\"elName\"\n\t\t\tclass=\"top-tagSelector_tagListItemName\"\n\t\t\t:contenteditable=\"inEdit ? 'plaintext-only' : false\"\n\t\t\t:=\"firefoxProps\"\n\t\t\t@keydown.enter.stop=\"editCommit\"\n\t\t\t@keydown.esc.stop=\"editCancel\"\n\t\t>\n\t\t\t{{ name }}\n\t\t</span>\n\n\t\t<template v-if=\"editable\">\n\t\t\t<span\n\t\t\t\tv-if=\"!inEdit\"\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\tclass=\"top-tagSelector_edit\"\n\t\t\t\t@click=\"turnToEdit\"\n\t\t\t></span>\n\n\t\t\t<span\n\t\t\t\tv-else\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\tclass=\"top-tagSelector_edit\"\n\t\t\t\t@click.stop=\"editCommit\"\n\t\t\t></span>\n\t\t</template>\n\t</TopPopupListItem>\n</template>\n\n<style>\n.top-tagSelector_tagListItem.top-popup_listItem {\n\tpadding-top: var(--top-padding-2) !important;\n\tpadding-bottom: var(--top-padding-2) !important;\n\tgap: 10px;\n}\n\n.top-tagSelector_tagListItemName {\n\tborder-radius: var(--top-radius-1);\n\twidth: 120px;\n\tpadding: 4px 2px;\n\tmargin: -4px -2px;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tflex-grow: 1;\n}\n\n/* редактирование */\n.top-tagSelector_edit {\n\t--top-icon-size: 18px;\n\t--top-icon-color: var(--color-text-3);\n\n\twidth: 20px;\n\tflex-grow: 0;\n}\n\n.top-tagSelector_edit:before {\n\tline-height: 0;\n}\n\n.top-tagSelector_edit { opacity: 0; }\n.top-tagSelector_edit:hover {\n\t--top-icon-color: var(--color-text-primary);\n}\n\n.top-tagSelector_tagListItem:hover .top-tagSelector_edit,\n.top-tagSelector_tagListItem-inEdit .top-tagSelector_edit {\n\tcursor: pointer;\n\topacity: 1;\n}\n\n.top-tagSelector_tagListItem-inEdit {\n\tbackground: var(--color-layout-front-3) !important;\n\toutline: 1px dashed var(--color-line-2);\n\toutline-offset: -1px;\n}\n\n.top-tagSelector_tagListItem-inEdit .top-tagSelector_tagListItemName {\n\tcursor: text;\n\tbackground: var(--color-layout-front-1);\n}\n\n/* disabled */\n.top-tagSelector_tagListItem-disabled {\n\tcursor: not-allowed !important;\n\topacity: 0.85;\n}\n.top-tagSelector_tagListItem-disabled:hover {\n\tbackground: inherit;\n}\n.top-tagSelector_tagListItem-disabled [data-tag_id] {\n\topacity: 0.6;\n}\n</style>\n","top-forms-focusable top-size_s top-button-withoutText top-tagSelector-useTopButton\n\n<script setup lang=\"ts\">\nimport type { Props, TagSelectorTarget } from './types';\nimport TopPopupOpener from '../../../popup/popup/opener.vue';\nimport TopButton from '@/components/forms/button/button.vue';\nimport { genTagIdClear, getTagById } from '../utils/utils';\nimport TopTagIcon from '../tagIcon/tagIcon.vue';\n\ndefineOptions({\n\tinheritAttrs: false,\n});\n\nconst props = defineProps<Props>();\n\nconst model = defineModel<Props['modelValue']>({\n\trequired: true,\n});\n\nconst component = props.useTopButton ? TopButton : 'div';\nconst componentSlotName = props.useTopButton ? 'html' : 'default';\n\nconst topTagSelectorTarget: TagSelectorTarget = {\n\tmodel,\n\tmode: props.mode,\n\ttargetId: props.targetId,\n\tfilters: props.filters,\n\tpayload: props.payload,\n};\n</script>\n\n<template>\n\t<TopPopupOpener :id>\n\t\t<component\n\t\t\t:is=\"component\"\n\t\t\t:class=\"{\n\t\t\t\t'top-tagSelector': true,\n\t\t\t\t'top-tagSelector-useTopButton': props.useTopButton,\n\t\t\t\t'top-tagSelector-custom': !props.useTopButton,\n\t\t\t\t'top-as-selector': props.useTopButton,\n\t\t\t\t'top-tagSelector-filter': props.mode === 'filter',\n\t\t\t\t'top-tagSelector-setter_single': props.mode === 'setter' && !filters,\n\t\t\t\t'top-tagSelector-setter_several': props.mode === 'setter' && filters,\n\t\t\t\t'top-tagSelector-selectedOne': !model.length || model.length === 1,\n\t\t\t\t'top-tagSelector-toTwoLine': model.length > 5,\n\t\t\t}\"\n\t\t\tcolor=\"theme\"\n\t\t\t:styling\n\t\t\tv-top-data:topTagSelectorTarget=\"topTagSelectorTarget\"\n\t\t\t:=$attrs\n\t\t>\n\t\t\t<template #[componentSlotName]>\n\t\t\t\t<TopTagIcon\n\t\t\t\t\tv-if=\"!model.length && mode === 'filter'\"\n\t\t\t\t\tid=\"all\"\n\t\t\t\t\tcolorId=\"\"\n\t\t\t\t\t:name=\"$i18n.Common.All_tags ?? ''\"\n\t\t\t\t\tstate=\"\"\n\t\t\t\t/>\n\n\t\t\t\t<!-- Массовое редактирование -->\n\t\t\t\t<div v-if=\"mode === 'setter' && filters\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Список тегов -->\n\t\t\t\t<TopTagIcon\n\t\t\t\t\tv-else\n\t\t\t\t\tv-for=\"tagId in model\"\n\t\t\t\t\t:id=\"genTagIdClear(tagId)\"\n\t\t\t\t\t:colorId=\"getTagById(tagId, tags)?.color_id ?? ''\"\n\t\t\t\t\t:name=\"getTagById(tagId, tags)?.name ?? ''\"\n\t\t\t\t\t:state=\"genTagIdClear(tagId) === tagId ? 'selected' : 'excluded'\"\n\t\t\t\t/>\n\t\t\t</template>\n\t\t</component>\n\t</TopPopupOpener>\n</template>\n\n<style>\n.top-tagSelector {\n\tcursor: pointer;\n\tmin-width: 0;\n\twhite-space: nowrap;\n\tjustify-content: left;\n}\n\n.top-tagSelector-useTopButton {\n\twidth: 112px;\n\tgap: var(--top-gap-1);\n\tvertical-align: middle;\n}\n\n.top-tagSelector.top-button.top-as-selector {\n\twidth: calc(112px + 8px);\n}\n\n/* все теги в фильтре */\n.top-tagSelector-useTopButton [data-tag_id=\"all\"]:before {\n\tmargin-right: 6px;\n}\n\n/* фильтр по одному тегу */\n.top-tagSelector-useTopButton.top-tagSelector-selectedOne [data-tag_id]:after {\n\tcontent: attr(title);\n\tmargin-left: 20px;\n\tmin-width: 74px;\n\ttext-align: left;\n\tline-height: 1.2;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.top-tagSelector-useTopButton.top-tagSelector-selectedOne [data-tag_id=\"all\"]:after {\n\tmargin-left: 0;\n}\n\n/* фильтр по многим тегам */\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine {\n\tflex-wrap: wrap;\n\talign-content: center;\n}\n\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine [data-tag_id] {\n\t--top-tag-selector-size: 8px;\n}\n\n.top-button.top-tagSelector-useTopButton.top-tagSelector-toTwoLine [data-tag_id]:nth-child(5) {\n\tmargin-right: 5px;\n}\n\n/* установка тегов */\n.top-tagSelector-useTopButton.top-tagSelector-setter_several,\n.top-tagSelector-useTopButton.top-tagSelector-setter_several.top-as-selector{\n\twidth: auto;\n}\n\n.top-tagSelector-custom {\n\tposition: relative;\n\tdisplay: flex !important; flex-direction: column; flex-wrap: wrap; align-items: stretch !important;\n}\n\n.top-tagSelector-custom [data-tag_id] {\n\twidth: auto; min-height: 20%; min-width: 50%;\n\tflex: 1 1 auto;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, reactive, ref, shallowRef, watch } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { useI18n } from '@/core/plugins/i18n';\nimport { storage } from '@/core/utils/dom';\nimport { debounce } from '@/core/utils/lodash';\n\nimport type { Option } from '@/components/forms/select/types';\nimport TopSelect from '@/components/forms/select/select.vue';\n\nimport TopButton from '@/components/forms/button/button.vue';\n\nimport type { PopupEvent } from '@/components/popup/popup/types';\nimport TopPopup from '../../popup/popup/popup.vue';\nimport TopPopupListItem from '../../popup/popup/listItem.vue';\n\nimport type { Emits, FiltersAction, Props, Tag } from './types';\nimport tagsDefaults from './tagsDefaults';\nimport { genTagIdExcluded } from './utils/utils';\n\nimport type { Props as TagListItemProps } from './popupListItem/types';\nimport TopTagListItem from './popupListItem/tagPopupListItem.vue';\n\nimport type { TagSelectorTarget } from './popupOpener/types';\nimport TopTagSelectorPopupOpener from './popupOpener/popupOpener.vue';\n\nconst i18n = useI18n();\n\nconst props = withDefaults(defineProps<Props>(), {\n\ttagsMax: 10,\n\trequiredForSetter: true,\n\temitDelay: 500,\n\tuseTopButton: true,\n});\n\n/**\n * Выбранные теги кнопки в этом компоненте\n *\n * Редактирвоание ведется только через `editTarget.model`\n */\nconst model = defineModel<Props['modelValue']>({\n\trequired: true,\n});\n\n/**\n * Список тегов\n */\nconst tags = defineModel<Tag[]>('tags', {\n\tdefault: reactive(tagsDefaults),\n});\n\nconst emit = defineEmits<Emits>();\n\nconst emitDebounce: typeof emit = debounce((name, e) => {\n\temit(name, e);\n}, props.emitDelay);\n\n// требуется сразу указать один тег\nif (props.singleMode && !model.value.length) {\n\tmodel.value = [tags.value[0].id];\n}\n\nconst id = props.id ?? 'top-popup-id-' + Math.random() + '';\n\nconst filtersAction = ref<FiltersAction>('add');\n\n/**\n * Сгенерировать опции для выбора дейсвтия массого редактирования\n */\nconst genFiltersActionOptions = () => {\n\tconst tagsText = ' ' + i18n.Common.Tags?.toLowerCase();\n\n\tconst res = new Map<FiltersAction, Option>();\n\tres.set('add', { value: 'add', title: i18n.Common.Add + tagsText });\n\tres.set('replace', { value: 'replace', title: i18n.Common.Replace + tagsText });\n\tres.set('delete', { value: 'delete', title: i18n.Common.Delete + tagsText });\n\n\treturn res;\n};\n\n/**\n * Целевой объект редактирования тегов\n *\n * Определяется кнопкой, которая открыла popup выбора тегов\n */\nlet target = shallowRef<TagSelectorTarget>({\n\tmodel,\n\tmode: 'filter',\n\ttargetId: undefined,\n\tfilters: undefined,\n\tpayload: undefined,\n});\n\nwatch(model, () => {\n\temitDebounce('selector', model.value);\n});\n\n/**\n * Можно ли выбрать еще теги\n */\nconst disabled = computed(() => {\n\tif (target.value.mode !== 'setter') return;\n\n\tif (!props.maxTagsForSetter) return;\n\n\t// массовая смена тегов, количество тегов в результате узнать невозможно\n\tif (target.value.filters) return;\n\n\treturn target.value.model.value.length >= props.maxTagsForSetter;\n});\n\nconst genTargetTagState = (tagId: Tag['id'] | 'all'): TagListItemProps['state'] => {\n\tif (tagId !== 'all') {\n\t\tif (target.value.model.value.includes(tagId)) return 'selected';\n\n\t\tif (target.value.model.value.includes(genTagIdExcluded(tagId))) return 'excluded';\n\t}\n\n\t// Все теги, ни один из тегов не выбран\n\tif (tagId === 'all' && !target.value.model.value.length) return 'selected';\n\n\treturn '';\n};\n\nconst updateTargetModel = (tagId: Tag['id'], action: 'unselect' | 'select' | 'exclude') => {\n\tconst tagIdExcluded = genTagIdExcluded(tagId);\n\n\tlet tagsIds = target.value.model.value.filter(modelTagId => modelTagId !== tagId && modelTagId !== tagIdExcluded);\n\n\tif (action === 'select') tagsIds.push(tagId);\n\tif (action === 'exclude') tagsIds.push(tagIdExcluded);\n\n\t// режим редактирвоания тегов одного объекта с требованием указать хотя бы один тег\n\tif (target.value.mode === 'setter' && target.value.targetId !== undefined && props.requiredForSetter) {\n\t\t// нельзя снимать выделение со всех тегов\n\t\tif (!tagsIds.length) {\n\t\t\ttagsIds.push('1');\n\t\t}\n\n\t\t// при первом выборе сразу снять тег \"Без тега\"\n\t\tif (tagsIds.length === 2 && target.value.model.value.length === 1 && target.value.model.value[0] === '1') {\n\t\t\ttagsIds = tagsIds.filter((tagId) => tagId !== '1');\n\t\t}\n\t}\n\n\t// режим выбора одного тега\n\tif (props.singleMode && !target.value.filters) {\n\t\t// нужно указать хотя бы один тег\n\t\tif (!tagsIds.length) {\n\t\t\ttagsIds = target.value.model.value;\n\t\t}\n\n\t\tif (tagsIds.length > 1) {\n\t\t\ttagsIds = [tagsIds[tagsIds.length - 1]];\n\t\t}\n\t}\n\n\t// всегда выводить теги в порядке, указанном в настройках tags\n\ttagsIds.sort((a, b) => {\n\t\tif (!props.tags) return 0;\n\n\t\tconst aIndex = props.tags.findIndex((tag) => tag.id === a);\n\t\tconst bIndex = props.tags.findIndex((tag) => tag.id === b);\n\n\t\treturn aIndex - bIndex;\n\t});\n\n\ttarget.value.model.value = tagsIds;\n\n\tif (target.value.mode === 'setter' && target.value.targetId !== undefined) {\n\t\temitDebounce('setter', {\n\t\t\ttagsIds: tagsIds as Tag['id'][],\n\t\t\ttargetId: target.value.targetId,\n\t\t\tpayload: target.value.payload,\n\t\t});\n\t}\n};\n\nconst classString = computed(() => {\n\tlet res = 'top-tagSelector_popup';\n\n\tif (target.value.mode === 'filter') res += ' top-tagSelector_popup-filter';\n\tif (target.value.mode === 'setter') res += ' top-tagSelector_popup-setter';\n\n\treturn res;\n});\n\n/**\n * Добавить тег\n */\nconst addTag = () => {\n\tconst tagName = prompt('', 'New tag');\n\tif (!tagName || tagName === 'New tag') return;\n\n\tconst tagId = tags.value.length + 1;\n\n\ttags.value.push({\n\t\tid: String(tagId) as Tag['id'],\n\t\tname: tagName,\n\t\tcolor_id: String((tagId - 1) % 10 + 1) as Tag['color_id'],\n\t});\n\n\temit('tagsChanged', tags.value);\n};\n\nconst onOpen = (popupEvent: PopupEvent) => {\n\t// popup открыт другой кнопкой c другим modelValue, для редактирвоания объектов\n\ttarget.value = storage(popupEvent.elPopupOpener, 'topTagSelectorTarget');\n\tif (!target.value) throw new Error('Open popup TopTagSelector required v-data:topTagSelectorTarget');\n\n\t// при начале массовой установки тегов сбросить состояние формы\n\tif (target.value.filters) {\n\t\tfiltersAction.value = 'add';\n\t\ttarget.value.model.value = [];\n\t}\n\n\tif (!Core.$?.ui['sortable']) {\n\t\tconsole.info('Для работы сортировки требуется глобальная загрузка jQuery UI Sortable');\n\n\t\treturn;\n\t}\n\n\tif (!Core.state.isMobile && !Core.state.isMobileUA && tags.value) {\n\t\t$(popupEvent.elPopup).sortable({\n\t\t\titems: 'li:has([data-tag_id]:not([data-tag_id=\"all\"]))',\n\n\t\t\t/**\n\t\t\t * @todo Удалить `[contenteditable=\"true\"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии\n\t\t\t */\n\t\t\tcancel: '[contenteditable=\"plaintext-only\"], [contenteditable=\"true\"]',\n\n\t\t\tdistance: 10,\n\t\t\tstop: function (_e, ui) {\n\t\t\t\tif (!tags.value) return;\n\n\t\t\t\tconst $tags = $(ui.item).parent().find('[data-tag_id]');\n\n\t\t\t\tconst tagsSorted: Tag['id'][] = [];\n\t\t\t\t$tags.each((_index, elTag) => {\n\t\t\t\t\tif (!tags.value) return;\n\n\t\t\t\t\tconst tagId = $(elTag).attr('data-tag_id') as Tag['id'];\n\t\t\t\t\ttagsSorted.push(tagId);\n\t\t\t\t});\n\n\t\t\t\ttags.value.sort((tagIdA, tagIdB) => {\n\t\t\t\t\tconst a = tagsSorted.findIndex(tagSorted => tagSorted === tagIdA.id);\n\t\t\t\t\tconst b = tagsSorted.findIndex(tagSorted => tagSorted === tagIdB.id);\n\n\t\t\t\t\treturn a - b;\n\t\t\t\t});\n\n\t\t\t\temitDebounce('tagsChanged', tags.value);\n\t\t\t},\n\t\t});\n\t}\n};\n\nconst onClose = (popupEvent: PopupEvent) => {\n\tif (!Core.$?.ui['sortable']) return;\n\n\tif ($(popupEvent.elPopup).data('ui-sortable')) {\n\t\t$(popupEvent.elPopup).sortable('destroy');\n\t}\n};\n</script>\n\n<template>\n\t<TopTagSelectorPopupOpener\n\t\tv-model=\"model\"\n\t\t:id\n\t\t:tags\n\t\t:styling\n\t\tmode=\"filter\"\n\t\t:useTopButton\n\t/>\n\n\t<TopPopup\n\t\t:id\n\t\t:class=\"classString\"\n\t\t@open=\"onOpen($event)\"\n\t\t@close=\"onClose($event)\"\n\t\t:transition-duration=\"50\"\n\t>\n\t\t<!-- Массовое редактирование-->\n\t\t<template #header v-if=\"target.mode === 'setter' && target.filters\">\n\t\t\t<TopSelect\n\t\t\t\tv-model=\"filtersAction\"\n\t\t\t\t:options=\"genFiltersActionOptions()\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template #footer v-if=\"target.mode === 'setter' && target.filters\">\n\t\t\t<TopButton color=\"theme\">\n\t\t\t\t{{ $i18n.Common.Cancel }}\n\t\t\t</TopButton>\n\n\t\t\t<TopButton\n\t\t\t\t@click=\"emitDebounce('setter', {\n\t\t\t\t\ttagsIds: target.model.value as Tag['id'][],\n\t\t\t\t\tfilters: target.filters,\n\t\t\t\t\tfiltersAction,\n\t\t\t\t\tpayload: target.payload,\n\t\t\t\t})\"\n\t\t\t>\n\t\t\t\t{{ filtersAction === 'add' ? $i18n.Common['Add'] : '' }}\n\t\t\t\t{{ filtersAction === 'replace' ? $i18n.Common['Replace'] : '' }}\n\t\t\t\t{{ filtersAction === 'delete' ? $i18n.Common['Delete'] : '' }}\n\t\t\t</TopButton>\n\t\t</template>\n\n\t\t<template #contentList>\n\t\t\t<TopTagListItem\n\t\t\t\tv-if=\"target.mode === 'filter' && !singleMode\"\n\t\t\t\tid=\"all\"\n\t\t\t\tcolorId=\"\"\n\t\t\t\t:name=\"$i18n.Common.All_tags ?? ''\"\n\t\t\t\t:state=\"target.model.value.length ? '' : 'selected'\"\n\t\t\t\t@select=\"target.model.value = []\"\n\t\t\t/>\n\n\t\t\t<TopTagListItem\n\t\t\t\tv-for=\"tag in tags\"\n\t\t\t\t:key=\"tag.id\"\n\t\t\t\t:id=\"tag.id\"\n\t\t\t\t:colorId=\"tag.color_id\"\n\t\t\t\t:name=\"tag.name\"\n\t\t\t\t:state=\"genTargetTagState(tag.id)\"\n\t\t\t\t:canExclude=\"target.mode === 'filter' && !singleMode\"\n\t\t\t\t:editable=\"tagsEditable\"\n\t\t\t\t:disabled=\"disabled && genTargetTagState(tag.id) === ''\"\n\t\t\t\t@unselect=\"updateTargetModel(tag.id, 'unselect')\"\n\t\t\t\t@select=\"updateTargetModel(tag.id, 'select')\"\n\t\t\t\t@exclude=\"updateTargetModel(tag.id, 'exclude')\"\n\t\t\t\t@update:name=\"tag.name = $event as string, emitDebounce('tagsChanged', tags);\"\n\t\t\t/>\n\n\t\t\t<TopPopupListItem\n\t\t\t\tv-if=\"tagsEditable && tags.length < tagsMax && tags.length < 20\"\n\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t@click.stop=\"addTag\"\n\t\t\t>\n\t\t\t\t{{ $i18n.Common.Add }}\n\t\t\t</TopPopupListItem>\n\t\t</template>\n\t</TopPopup>\n</template>\n\n<style>\n.top-tagSelector_popup .top-popup {\n\tuser-select: none;\n\tmin-width: 220px !important;\n\ttext-align: left;\n}\n\n.top-tagSelector_popup .top-popup_header .top-select{\n\tflex-grow: 1;\n}\n</style>\n"],"names":["props","__props","model","_useModel","selectAllItem","computed","useI18n","_openBlock","_createElementBlock","_hoisted_1","_unref","Core","_createBlock","Popup","_createVNode","Button","items","item","_a","_Fragment","_renderList","ListItem","_normalizeClass","_createElementVNode","_hoisted_2","_toDisplayString","Menu","$event","useItemsFromCompetitors","competitors","projectId","toValue","competitor","searhcerCompareKey","dummyIndex","globalRegionIndex","searchersNames","regionUndefined","searcherUndefined","regionAuto","searcherAuto","regionGlobal","getRegionAuto","getSearcherAuto","getRegionGlobal","genSearcherByKey","forFrequency","autoRegion","searchers","searcherByKey","genSearchersMapVolume","genSearchersMapCommon","onlyEnabledRegions","forceSearchersKeys","searcher","searcherI","region","regionI","searcherKey","serarcherByKey","searcherMail","findRegion","searchRegion","findedRegion","dialogSelectorRegions","useAsyncTopDialog","useSelectSearcher","mapSearchers","i18n","ref","optionBySearcherKey","res","option","getSearcherGIcon","dummyOption","compareOption","useSelectRegion","activeSearcherIndexed","regionIndex","_b","_c","optionByRegionIndex","options","regionLabel","langLabel","getLangLabel","getDeviceGIcon","watch","oldOptionByRegionIndex","newRegionIndex","regionName","regionMatchLevel","index","title","regexpDevice","regionNameCompare","regionMatchLevelI","useCompare","allRegionsIndexes","regionsIndexes","compareLoad","regionsIndexesSaved","compareSave","useSelectorRegion","selectSearcher","selectRegion","compare","newSearcherKey","regionsNewSearcher","regionsCurrentSearcher","_d","getSearcherKey","getRegionIndex","regionKey","getSearcher","modelSingle","getRegion","onClickCompare","regions","defaultKey","newModel","defaultIndex","_e","all","newSearherKey","__expose","onlySearcher","Select","addChanger","addRegionIcon","addCompare","$i18n","genTagIdExcluded","tagId","genTagIdClear","getTagById","tags","tag","genElPopupOpener","propsPopup","htmlSetterSeveral","el","TopPopupWorker","e","target","storage","isRef","elPopupOpenerRender","modelValue","renderElPopupOpener","tagsIds","unref","elTagIcon","genElTagIcon","tagsDefaults","state","id","colorId","name","emit","__emit","elName","firefoxProps","inEdit","event","turnToEdit","nextTick","editCommit","editCancel","changeSelect","toState","TopPopupListItem","disabled","canExclude","TopTagIcon","_mergeProps","editable","component","TopButton","componentSlotName","topTagSelectorTarget","TopPopupOpener","_resolveDynamicComponent","filters","styling","$attrs","mode","_renderSlot","_ctx","_directive_top_data","emitDebounce","debounce","filtersAction","genFiltersActionOptions","tagsText","shallowRef","genTargetTagState","updateTargetModel","action","tagIdExcluded","modelTagId","a","b","aIndex","bIndex","classString","addTag","tagName","onOpen","popupEvent","ui","$tags","tagsSorted","_index","elTag","tagIdA","tagIdB","tagSorted","onClose","TopTagSelectorPopupOpener","useTopButton","TopPopup","_cache","singleMode","TopTagListItem","tagsEditable","tagsMax","TopSelect","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAGRC,IAAQC,iBAAiC,GAEzCC,IAAgBC,EAAS,MAAM;AACpC,UAAIL,EAAM;AACT,eAAO;AAAA,UACN,MAAM;AAAA,UACN,OAAOM,IAAU,OAAO;AAAA,UACxB,OAAO;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,IAGZ,CAAC;sBAIAC,EAAA,GAAAC,EAuCM,OAvCNC,IAuCM;AAAA,MAtCQC,EAAAC,CAAA,EAAK,MAAM,iBAAxBC,EA2BQC,IAAA,EAAA,KAAA,EAAA,GAAA;AAAA,QA1BI,UACV,MAOS;AAAA,UAPTC,EAOSC,GAAA;AAAA,YANR,OAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAK;AAAA,YACL,OAAM;AAAA,UAAA;uBAEN,MAAA;;AAA8D;AAAA,qBAA3DC,IAAAA,EAAAA,MAAM,KAAI,CAAEC,MAAA;;AAAS,yBAAAA,EAAK,YAAUC,IAAAhB,EAAA,UAAA,gBAAAgB,EAAK;AAAA,iBAAA,MAAzCF,gBAAAA,EAAiD,OAAO,GAAA,CAAA;AAAA,cAAA;AAAA;;;;QAIlD,eAET,MAAuB;AAAA,kBADxBR,EAYWW,GAAA,MAAAC,GAXOJ,EAAAA,OAAK,CAAdC,MAAI;;wBADbL,EAYWS,IAAA;AAAA,cAVT,OAAKC,EAAA;AAAA,gBAAwB,eAAAJ,IAAAhB,EAAA,UAAA,gBAAAgB,EAAO,SAASD,EAAK;AAAA,cAAK;cAGvD,iBAAeA,EAAK;AAAA,cACpB,OAAOA,EAAK;AAAA,cACZ,SAAK,MAAQf,EAAA,QAAK,CAAIe,EAAK,KAAK;AAAA,YAAA;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oF,EAAA3M,EAAAuK,EAAA,kBAA0B7D,EAAAA,MAAM,OAAM,MAAA,EAAA,IAAe,QACrD6D,EAAA,UAAa,YAAiB7D,QAAM,uBAAyB,MAChE1G,EAAGuK,YAAa,WAAgB7D,EAAAA,MAAM,OAAM,SAAA,EAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { components as FetchStyleComponents } from 'topvisor-openapi/src/ts/FetchStyle';
1
+ import { components as FetchStyleComponents } from 'topvisor-openapi/src/ts/Selector/Types/FetchStyle';
2
2
  import { components as FieldDirectionComponents } from 'topvisor-openapi/src/ts/FieldDirection';
3
3
  import { components as FieldFilterComponents } from 'topvisor-openapi/src/ts/FieldFilter';
4
4
  import { components as FieldOperatorComponents } from 'topvisor-openapi/src/ts/FieldOperator';
@@ -43,7 +43,7 @@ declare global {
43
43
  */
44
44
  Fields: readonly string[];
45
45
  } & {
46
- FetchStyle: Extract<FetchStyleComponents['schemas']['FetchStyle'], keyof Api.ResultByModelFetchStyle<any, any>>;
46
+ FetchStyle: Extract<FetchStyleComponents['schemas']['Selector.Types.FetchStyle'], keyof Api.ResultByModelFetchStyle<any, any>>;
47
47
  } & FieldDirectionComponents['schemas'] & FieldFilterComponents['schemas'] & FieldOperatorComponents['schemas'] & FieldOrderComponents['schemas'] & ResponseErrorComponents['schemas'] & ResponseSuccessComponents['schemas'] & PaginationComponents['schemas'];
48
48
  }
49
49
  }
@@ -28,6 +28,12 @@ export interface Props {
28
28
  isSubmit?: boolean;
29
29
  isActive?: boolean;
30
30
  isProgress?: boolean;
31
+ /**
32
+ * Автоматическая ширина по содержимому
33
+ *
34
+ * Отключает min-width и устанавливает ширину по контенту
35
+ */
36
+ autoWidth?: boolean;
31
37
  }
32
38
  export interface Slots {
33
39
  /**
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
9
9
  rootEl: any;
10
10
  };
11
11
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
12
+ declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
13
13
  "update:modelValue": (value: string) => any;
14
14
  }, string, PublicProps, Readonly<Props> & Readonly<{
15
15
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
@@ -16,7 +16,7 @@ export interface Props {
16
16
  captionType?: CaptionType;
17
17
  }
18
18
  export interface Emits {
19
- (e: 'update:modelValue', value: string): void;
19
+ 'update:modelValue': [value: string];
20
20
  }
21
21
  export type Styling = '' | 'light' | 'soft' | 'transparent';
22
22
  export type CaptionType = '' | 'slide' | 'top';
@@ -1,6 +1,6 @@
1
1
  import { Props } from './types';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- declare const _default: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4
4
  "update:modelValue": (value: string) => any;
5
5
  }, string, PublicProps, Readonly<Props> & Readonly<{
6
6
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;