@topvisor/ui 1.0.21-pinia-1 → 1.0.22-dev.12

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 (174) hide show
  1. package/.chunks/core-Dxu5q2pq.es.js +196 -0
  2. package/.chunks/core-Dxu5q2pq.es.js.map +1 -0
  3. package/.chunks/core-VAPdmxul.amd.js +2 -0
  4. package/.chunks/core-VAPdmxul.amd.js.map +1 -0
  5. package/.chunks/{datepicker-BC31NE5M.es.js → datepicker-B8BEVYYv.es.js} +2 -2
  6. package/.chunks/datepicker-B8BEVYYv.es.js.map +1 -0
  7. package/.chunks/{datepicker-CVoT5EME.amd.js → datepicker-np32OBIB.amd.js} +2 -2
  8. package/.chunks/datepicker-np32OBIB.amd.js.map +1 -0
  9. package/.chunks/dialog_selectorRegions-eupaC53Q.es.js +140 -0
  10. package/.chunks/dialog_selectorRegions-eupaC53Q.es.js.map +1 -0
  11. package/.chunks/dialog_selectorRegions-vtydbe7k.amd.js +2 -0
  12. package/.chunks/dialog_selectorRegions-vtydbe7k.amd.js.map +1 -0
  13. package/.chunks/{utils-C5sf4bZh.es.js → dialogs.vue_vue_type_script_setup_true_lang-BEjw0nsH.es.js} +72 -144
  14. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BEjw0nsH.es.js.map +1 -0
  15. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CKz2r_HQ.amd.js +2 -0
  16. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CKz2r_HQ.amd.js.map +1 -0
  17. package/.chunks/{forms-CxYSHZLL.amd.js → forms-B4wnA2qg.amd.js} +3 -3
  18. package/.chunks/forms-B4wnA2qg.amd.js.map +1 -0
  19. package/.chunks/{forms-CipZtprq.es.js → forms-BEOYaG5x.es.js} +28 -28
  20. package/.chunks/forms-BEOYaG5x.es.js.map +1 -0
  21. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-uNNJJ4S0.es.js → listItem.vue_vue_type_script_setup_true_lang-BzHSHzgd.es.js} +7 -7
  22. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-BzHSHzgd.es.js.map +1 -0
  23. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-CT6O_7Qy.amd.js → listItem.vue_vue_type_script_setup_true_lang-Yoht7Zz1.amd.js} +2 -2
  24. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-Yoht7Zz1.amd.js.map +1 -0
  25. package/.chunks/{menu.vue_vue_type_style_index_0_lang-fU3LbpR7.es.js → menu.vue_vue_type_style_index_0_lang-D38vuK6Z.es.js} +5 -5
  26. package/.chunks/menu.vue_vue_type_style_index_0_lang-D38vuK6Z.es.js.map +1 -0
  27. package/.chunks/{menu.vue_vue_type_style_index_0_lang-DAI_WcXI.amd.js → menu.vue_vue_type_style_index_0_lang-DpQWqw0S.amd.js} +2 -2
  28. package/.chunks/menu.vue_vue_type_style_index_0_lang-DpQWqw0S.amd.js.map +1 -0
  29. package/.chunks/{notice-cCZZtLLu.es.js → notice-BFubg4q7.es.js} +2 -2
  30. package/.chunks/notice-BFubg4q7.es.js.map +1 -0
  31. package/.chunks/{notice-uzdQ-t3s.amd.js → notice-BMEqHHl7.amd.js} +2 -2
  32. package/.chunks/notice-BMEqHHl7.amd.js.map +1 -0
  33. package/.chunks/page.vue_vue_type_script_setup_true_lang-DOfSX4G2.amd.js +2 -0
  34. package/.chunks/page.vue_vue_type_script_setup_true_lang-DOfSX4G2.amd.js.map +1 -0
  35. package/.chunks/page.vue_vue_type_script_setup_true_lang-DkVrf3fD.es.js +143 -0
  36. package/.chunks/page.vue_vue_type_script_setup_true_lang-DkVrf3fD.es.js.map +1 -0
  37. package/.chunks/{popup-BvhY5oAD.es.js → popup-KzrqppGt.es.js} +2 -2
  38. package/.chunks/popup-KzrqppGt.es.js.map +1 -0
  39. package/.chunks/{popup-Bwknq6xI.amd.js → popup-RsYK2WNs.amd.js} +2 -2
  40. package/.chunks/popup-RsYK2WNs.amd.js.map +1 -0
  41. package/.chunks/store-CX_6ZXhO.es.js.map +1 -1
  42. package/.chunks/store-esTid5oI.amd.js.map +1 -1
  43. package/.chunks/utils-C-3nlmxS.amd.js +2 -0
  44. package/.chunks/utils-C-3nlmxS.amd.js.map +1 -0
  45. package/.chunks/utils-CwjZqLi4.amd.js +2 -0
  46. package/.chunks/utils-CwjZqLi4.amd.js.map +1 -0
  47. package/.chunks/{utils-C2OmmJkw.es.js → utils-DkTeAU_D.es.js} +3 -3
  48. package/.chunks/utils-DkTeAU_D.es.js.map +1 -0
  49. package/.chunks/utils-Lh80NiyA.es.js +79 -0
  50. package/.chunks/utils-Lh80NiyA.es.js.map +1 -0
  51. package/README.md +82 -82
  52. package/assets/core.css +1 -1
  53. package/assets/dialog_selectorRegions.css +1 -0
  54. package/assets/forms.css +1 -1
  55. package/assets/formsExt.css +1 -1
  56. package/charts/charts.amd.js +1 -1
  57. package/charts/charts.amd.js.map +1 -1
  58. package/charts/charts.js +1 -1
  59. package/charts/charts.js.map +1 -1
  60. package/components/project/project.d.ts +1 -1
  61. package/components/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts +4 -0
  62. package/components/project/selectorRegion/dialog_selectorRegions/types.d.ts +26 -0
  63. package/components/project/selectorRegion/selectorRegion.d.ts +2 -12
  64. package/components/project/selectorRegion/selectorRegion.vue.d.ts +1 -3
  65. package/components/project/selectorRegion/utils/consts.d.ts +13 -0
  66. package/components/project/selectorRegion/utils/utils.d.ts +9 -0
  67. package/core/app.amd.js +1 -1
  68. package/core/app.amd.js.map +1 -1
  69. package/core/app.js +122 -310
  70. package/core/app.js.map +1 -1
  71. package/core/utils/string.d.ts +3 -1
  72. package/dialog/dialog.amd.js +1 -1
  73. package/dialog/dialog.amd.js.map +1 -1
  74. package/dialog/dialog.js +22 -155
  75. package/dialog/dialog.js.map +1 -1
  76. package/forms/forms.amd.js +1 -1
  77. package/forms/forms.js +1 -1
  78. package/forms/helpers.amd.js.map +1 -1
  79. package/forms/helpers.js.map +1 -1
  80. package/formsExt/formsExt.amd.js +1 -1
  81. package/formsExt/formsExt.amd.js.map +1 -1
  82. package/formsExt/formsExt.js +220 -213
  83. package/formsExt/formsExt.js.map +1 -1
  84. package/icomoon/Read Me.txt +7 -7
  85. package/icomoon/Topvisor icons.json +6259 -6259
  86. package/icomoon/demo-files/demo.css +158 -158
  87. package/icomoon/demo-files/demo.js +30 -30
  88. package/icomoon/demo.html +3558 -3558
  89. package/icomoon/fonts/Topvisor-2.svg +276 -276
  90. package/icomoon/style.css +780 -780
  91. package/jquery-ui.min.css +5 -5
  92. package/layout/layout.amd.js +1 -1
  93. package/layout/layout.amd.js.map +1 -1
  94. package/layout/layout.js +1 -1
  95. package/layout/layout.js.map +1 -1
  96. package/package.json +33 -33
  97. package/popup/popup.amd.js +1 -1
  98. package/popup/popup.amd.js.map +1 -1
  99. package/popup/popup.js +2 -2
  100. package/popup/popup.js.map +1 -1
  101. package/popup/worker.amd.js +1 -1
  102. package/popup/worker.amd.js.map +1 -1
  103. package/popup/worker.js +2 -2
  104. package/popup/worker.js.map +1 -1
  105. package/project/project.amd.js +1 -1
  106. package/project/project.amd.js.map +1 -1
  107. package/project/project.js +568 -567
  108. package/project/project.js.map +1 -1
  109. package/require/css.amd.js +12 -12
  110. package/tabs/tabs.amd.js.map +1 -1
  111. package/tabs/tabs.js.map +1 -1
  112. package/tabsView/tabsView.amd.js +1 -1
  113. package/tabsView/tabsView.amd.js.map +1 -1
  114. package/tabsView/tabsView.js +1 -1
  115. package/tabsView/tabsView.js.map +1 -1
  116. package/utils/check.amd.js.map +1 -1
  117. package/utils/check.js.map +1 -1
  118. package/utils/clipboard.amd.js +1 -1
  119. package/utils/clipboard.amd.js.map +1 -1
  120. package/utils/clipboard.js +1 -1
  121. package/utils/clipboard.js.map +1 -1
  122. package/utils/date.amd.js +1 -1
  123. package/utils/date.js +2 -2
  124. package/utils/device.amd.js +1 -1
  125. package/utils/device.js +4 -4
  126. package/utils/dom.amd.js.map +1 -1
  127. package/utils/dom.js.map +1 -1
  128. package/utils/image.amd.js.map +1 -1
  129. package/utils/image.js.map +1 -1
  130. package/utils/keyboard.amd.js.map +1 -1
  131. package/utils/keyboard.js.map +1 -1
  132. package/utils/lodash.amd.js +1 -1
  133. package/utils/lodash.js +3 -3
  134. package/utils/number.amd.js.map +1 -1
  135. package/utils/number.js.map +1 -1
  136. package/utils/price.amd.js +1 -1
  137. package/utils/price.amd.js.map +1 -1
  138. package/utils/price.js +4 -4
  139. package/utils/price.js.map +1 -1
  140. package/utils/route.amd.js.map +1 -1
  141. package/utils/route.js.map +1 -1
  142. package/utils/scroll.amd.js.map +1 -1
  143. package/utils/scroll.js.map +1 -1
  144. package/utils/searchers.amd.js +1 -1
  145. package/utils/searchers.amd.js.map +1 -1
  146. package/utils/searchers.js +16 -12
  147. package/utils/searchers.js.map +1 -1
  148. package/utils/string.amd.js +1 -1
  149. package/utils/string.amd.js.map +1 -1
  150. package/utils/string.js +1 -1
  151. package/utils/string.js.map +1 -1
  152. package/utils/system.amd.js.map +1 -1
  153. package/utils/system.js.map +1 -1
  154. package/utils/url.amd.js.map +1 -1
  155. package/utils/url.js.map +1 -1
  156. package/web-types.json +130 -130
  157. package/.chunks/datepicker-BC31NE5M.es.js.map +0 -1
  158. package/.chunks/datepicker-CVoT5EME.amd.js.map +0 -1
  159. package/.chunks/forms-CipZtprq.es.js.map +0 -1
  160. package/.chunks/forms-CxYSHZLL.amd.js.map +0 -1
  161. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CT6O_7Qy.amd.js.map +0 -1
  162. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-uNNJJ4S0.es.js.map +0 -1
  163. package/.chunks/menu.vue_vue_type_style_index_0_lang-DAI_WcXI.amd.js.map +0 -1
  164. package/.chunks/menu.vue_vue_type_style_index_0_lang-fU3LbpR7.es.js.map +0 -1
  165. package/.chunks/notice-cCZZtLLu.es.js.map +0 -1
  166. package/.chunks/notice-uzdQ-t3s.amd.js.map +0 -1
  167. package/.chunks/popup-BvhY5oAD.es.js.map +0 -1
  168. package/.chunks/popup-Bwknq6xI.amd.js.map +0 -1
  169. package/.chunks/utils-BfdO2xlC.amd.js +0 -2
  170. package/.chunks/utils-BfdO2xlC.amd.js.map +0 -1
  171. package/.chunks/utils-C2OmmJkw.es.js.map +0 -1
  172. package/.chunks/utils-C3dsXIj9.amd.js +0 -2
  173. package/.chunks/utils-C3dsXIj9.amd.js.map +0 -1
  174. package/.chunks/utils-C5sf4bZh.es.js.map +0 -1
@@ -1,16 +1,17 @@
1
- import { Core as Te } from "../core/app.js";
2
- import { defineComponent as P, mergeModels as O, useModel as D, computed as M, createElementBlock as w, openBlock as x, createBlock as B, unref as h, withCtx as b, Fragment as W, renderList as ie, normalizeClass as Q, createElementVNode as ye, toDisplayString as K, createVNode as A, createTextVNode as z, ref as F, watch as L, createCommentVNode as q, withModifiers as j, mergeProps as pe, withKeys as de, nextTick as be, resolveDirective as Be, withDirectives as Ve, resolveDynamicComponent as we, renderSlot as Me, shallowRef as $e, createSlots as Ee, reactive as Ke, toValue as ue, isRef as ce } from "vue";
3
- import { a as R, C as J, _ as Y, x as re, s as Le } from "../.chunks/forms-CipZtprq.es.js";
4
- import { _ as he, a as se, b as Ae } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-uNNJJ4S0.es.js";
5
- import { _ as Oe } from "../.chunks/menu.vue_vue_type_style_index_0_lang-fU3LbpR7.es.js";
6
- import { getSearcherGIcon as Re, getLangLabel as Ne, getDeviceGIcon as De } from "../utils/searchers.js";
7
- import { storage as G } from "../utils/dom.js";
8
- import { TopPopupWorker as Fe } from "../popup/worker.js";
9
- const _e = ["../assets/project.css"].map((e) => import.meta.resolve(e));
10
- Te.insertCSSLinkToPage(_e, !0);
11
- const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }, Ue = /* @__PURE__ */ P({
1
+ import { Core as be } from "../core/app.js";
2
+ import { defineComponent as P, mergeModels as N, useModel as D, computed as E, createElementBlock as B, openBlock as k, createBlock as b, unref as y, withCtx as _, Fragment as Y, renderList as de, normalizeClass as X, createElementVNode as he, toDisplayString as M, createVNode as A, createTextVNode as G, ref as F, watch as w, createCommentVNode as q, withModifiers as J, mergeProps as Se, withKeys as ce, nextTick as Ve, resolveDirective as Ee, withDirectives as Ke, resolveDynamicComponent as Me, renderSlot as $e, shallowRef as we, createSlots as Le, reactive as Ae, toValue as ge, isRef as me } from "vue";
3
+ import { u as R, C as z, _ as H, x as se, d as Re } from "../.chunks/forms-BEOYaG5x.es.js";
4
+ import { _ as Ie, a as ue, b as Oe } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-BzHSHzgd.es.js";
5
+ import { _ as Ne } from "../.chunks/menu.vue_vue_type_style_index_0_lang-D38vuK6Z.es.js";
6
+ import { u as De } from "../.chunks/utils-Lh80NiyA.es.js";
7
+ import { getSearcherGIcon as Fe, getLangLabel as qe, getDeviceGIcon as Pe } from "../utils/searchers.js";
8
+ import { storage as W } from "../utils/dom.js";
9
+ import { TopPopupWorker as Ue } from "../popup/worker.js";
10
+ const Be = ["../assets/project.css"].map((t) => import.meta.resolve(t));
11
+ be.insertCSSLinkToPage(Be, !0);
12
+ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }, ze = /* @__PURE__ */ P({
12
13
  __name: "selectorCompetitors",
13
- props: /* @__PURE__ */ O({
14
+ props: /* @__PURE__ */ N({
14
15
  modelValue: {},
15
16
  items: {},
16
17
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -19,9 +20,9 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
19
20
  modelModifiers: {}
20
21
  }),
21
22
  emits: ["update:modelValue"],
22
- setup(e) {
23
- const a = e, i = D(e, "modelValue"), t = M(() => {
24
- if (a.showSelectAllItem)
23
+ setup(t) {
24
+ const o = t, n = D(t, "modelValue"), e = E(() => {
25
+ if (o.showSelectAllItem)
25
26
  return {
26
27
  icon: "",
27
28
  title: R().Common.Select_all,
@@ -29,59 +30,59 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
29
30
  content: ""
30
31
  };
31
32
  });
32
- return (l, o) => (x(), w("div", qe, [
33
- h(J).state.isMobile ? (x(), B(he, { key: 0 }, {
34
- opener: b(() => [
35
- A(Y, {
33
+ return (i, a) => (k(), B("div", je, [
34
+ y(z).state.isMobile ? (k(), b(Ie, { key: 0 }, {
35
+ opener: _(() => [
36
+ A(H, {
36
37
  class: "top-selectorCompetitors_opener",
37
38
  color: "theme",
38
39
  icon: "",
39
40
  icon2: ""
40
41
  }, {
41
- default: b(() => {
42
- var n;
42
+ default: _(() => {
43
+ var l;
43
44
  return [
44
- z(K((n = l.items.find((d) => {
45
- var g;
46
- return d.value === ((g = i.value) == null ? void 0 : g[0]);
47
- })) == null ? void 0 : n.content), 1)
45
+ G(M((l = i.items.find((d) => {
46
+ var f;
47
+ return d.value === ((f = n.value) == null ? void 0 : f[0]);
48
+ })) == null ? void 0 : l.content), 1)
48
49
  ];
49
50
  }),
50
51
  _: 1
51
52
  })
52
53
  ]),
53
- contentList: b(() => [
54
- (x(!0), w(W, null, ie(l.items, (n, d) => {
55
- var g;
56
- return x(), B(se, {
57
- class: Q({
58
- "top-active": (g = i.value) == null ? void 0 : g.includes(n.value)
54
+ contentList: _(() => [
55
+ (k(!0), B(Y, null, de(i.items, (l, d) => {
56
+ var f;
57
+ return k(), b(ue, {
58
+ class: X({
59
+ "top-active": (f = n.value) == null ? void 0 : f.includes(l.value)
59
60
  }),
60
- "data-top-icon": n.icon,
61
- title: n.title,
62
- onClick: () => i.value = [n.value]
61
+ "data-top-icon": l.icon,
62
+ title: l.title,
63
+ onClick: () => n.value = [l.value]
63
64
  }, {
64
- default: b(() => [
65
- ye("span", Pe, K(n.content), 1)
65
+ default: _(() => [
66
+ he("span", Je, M(l.content), 1)
66
67
  ]),
67
68
  _: 2
68
69
  }, 1032, ["class", "data-top-icon", "title", "onClick"]);
69
70
  }), 256))
70
71
  ]),
71
72
  _: 1
72
- })) : (x(), B(Oe, {
73
+ })) : (k(), b(Ne, {
73
74
  key: 1,
74
- modelValue: i.value,
75
- "onUpdate:modelValue": o[0] || (o[0] = (n) => i.value = n),
76
- items: l.items,
75
+ modelValue: n.value,
76
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l),
77
+ items: i.items,
77
78
  isMultiple: !0,
78
79
  styling: "bar",
79
80
  canBeEmptyMultiple: !1,
80
- selectAllItem: t.value
81
+ selectAllItem: e.value
81
82
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
82
83
  ]));
83
84
  }
84
- }), I = -2, je = {
85
+ }), K = -1, p = -2, te = -1, Ge = {
85
86
  0: "Yandex",
86
87
  1: "Google",
87
88
  4: "YouTube",
@@ -91,245 +92,244 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
91
92
  9: "GoogleStore",
92
93
  20: "Yandex.com",
93
94
  21: "Yandex.com.tr"
94
- }, ee = {
95
- key: I,
95
+ }, ae = {
96
+ key: p,
96
97
  name: "--",
97
- index: I
98
- }, Se = {
99
- key: I,
98
+ index: p
99
+ }, xe = {
100
+ key: p,
100
101
  name: "--",
101
- regions: [ee],
102
- regionByIndex: /* @__PURE__ */ new Map([[I, ee]])
103
- }, te = {
104
- key: I,
102
+ regions: [ae],
103
+ regionByIndex: /* @__PURE__ */ new Map([[p, ae]])
104
+ }, oe = {
105
+ key: p,
105
106
  name: "Autoselect",
106
- index: I
107
- }, ne = {
108
- key: I,
107
+ index: p
108
+ }, ie = {
109
+ key: p,
109
110
  name: "Autoselect",
110
- regions: [te],
111
- regionByIndex: /* @__PURE__ */ new Map([[I, te]])
112
- }, me = {
111
+ regions: [oe],
112
+ regionByIndex: /* @__PURE__ */ new Map([[p, oe]])
113
+ }, fe = {
113
114
  countryCode: "00",
114
115
  depth: 1,
115
116
  device: 0,
116
- key: -1,
117
- index: -1,
117
+ key: te,
118
+ index: te,
118
119
  lang: "ru",
119
120
  name: "Without region"
120
- }, Je = () => (te.name = R().Common.Autoselect, te), ze = () => (Je(), ne.name = R().Common.Autoselect, console.log(ne), ne), Ge = () => (me.name = R().Keywords.Without_region, me), Ie = (e = !1, a = !1, i = []) => {
121
- let t;
122
- return e ? t = We(i) : t = xe(i), a && t.set(I, ze()), t.size || t.set(I, Se), t;
123
- }, xe = (e, a = !0, i = [], t = !1) => {
124
- const l = /* @__PURE__ */ new Map();
125
- return e.forEach((o) => {
126
- if (!o.enabled || t && typeof o.key == "number" && o.key > 1) return;
127
- const n = { ...o };
128
- n.regionByIndex = /* @__PURE__ */ new Map(), o.regions && o.regions.forEach((d) => {
129
- if (a && !d.enabled) return;
130
- const g = { ...d };
131
- n.regionByIndex && n.regionByIndex.set(g.index, g);
132
- }), !n.regionByIndex.size && !i.length && n.regionByIndex.set(ee.index, ee), typeof n.key == "number" && l.set(n.key, n);
133
- }), i.forEach((o) => {
134
- if (l.has(o)) return;
135
- const n = {
136
- key: o,
137
- name: je[o],
121
+ }, We = () => (oe.name = R().Common.Autoselect, oe), Ye = () => (We(), ie.name = R().Common.Autoselect, console.log(ie), ie), He = () => (fe.name = R().Keywords.Without_region, fe), ke = (t = !1, o = !1, n = []) => {
122
+ let e;
123
+ return t ? e = Qe(n) : e = Ce(n), o && e.set(p, Ye()), e.size || e.set(p, xe), e;
124
+ }, Ce = (t, o = !0, n = [], e = !1) => {
125
+ const i = /* @__PURE__ */ new Map();
126
+ return t.forEach((a) => {
127
+ if (!a.enabled || e && typeof a.key == "number" && a.key > 1) return;
128
+ const l = { ...a };
129
+ l.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((d) => {
130
+ if (o && !d.enabled) return;
131
+ const f = { ...d };
132
+ l.regionByIndex.set(f.index, f);
133
+ }), !l.regionByIndex.size && !n.length && l.regionByIndex.set(ae.index, ae), typeof l.key == "number" && i.set(l.key, l);
134
+ }), n.forEach((a) => {
135
+ if (i.has(a)) return;
136
+ const l = {
137
+ key: a,
138
+ name: Ge[a],
138
139
  regions: [],
139
140
  regionByIndex: /* @__PURE__ */ new Map()
140
141
  };
141
- l.set(n.key, n);
142
- }), l;
143
- }, We = (e) => {
144
- const a = xe(e, !1, [0, 1], !0);
145
- if (a.has(2)) {
146
- const i = a.get(2);
147
- i && (i.regionByIndex = /* @__PURE__ */ new Map());
142
+ i.set(l.key, l);
143
+ }), i;
144
+ }, Qe = (t) => {
145
+ const o = Ce(t, !1, [0, 1], !0);
146
+ if (o.has(2)) {
147
+ const n = o.get(2);
148
+ n && (n.regionByIndex = /* @__PURE__ */ new Map());
148
149
  }
149
- return a.forEach((i) => {
150
- if (!i.regionByIndex) return;
151
- const t = { ...Ge() };
152
- i.regionByIndex.set(t.index, t);
153
- }), a;
154
- }, Ye = (e, a, i = []) => {
155
- const t = Ie(e, !1, i);
156
- let l;
157
- return t.forEach((o) => {
158
- if (!(a.searcher_key !== void 0 && a.searcher_key != o.key) && o.regions && (o.regions.forEach((n) => {
159
- if (!l && !(a.key !== void 0 && a.key != n.key) && !(a.index !== void 0 && a.index != n.index) && !(!e && (a.lang !== void 0 && a.lang != n.lang || a.device !== void 0 && a.device != n.device)))
160
- return n.searcher_key = o.key, l = n, !1;
161
- }), l))
150
+ return o.forEach((n) => {
151
+ if (!n.regionByIndex) return;
152
+ const e = { ...He() };
153
+ n.regionByIndex.set(e.index, e);
154
+ }), o;
155
+ }, Xe = (t, o, n = []) => {
156
+ const e = ke(t, !1, n);
157
+ let i;
158
+ return e.forEach((a) => {
159
+ if (!(o.searcher_key !== void 0 && o.searcher_key != a.key) && a.regions && (a.regions.forEach((l) => {
160
+ if (!i && !(o.key !== void 0 && o.key != l.key) && !(o.index !== void 0 && o.index != l.index) && !(!t && (o.lang !== void 0 && o.lang != l.lang || o.device !== void 0 && o.device != l.device)))
161
+ return l.searcher_key = a.key, i = l, !1;
162
+ }), i))
162
163
  return !1;
163
- }), l;
164
- }, He = (e, a) => {
165
- const i = R(), t = F(a.value.keys().next().value ?? I), l = M(() => {
166
- const o = /* @__PURE__ */ new Map();
167
- if (a.value.forEach((n) => {
164
+ }), i;
165
+ }, Ze = De(() => import("../.chunks/dialog_selectorRegions-eupaC53Q.es.js")), et = (t, o) => {
166
+ const n = R(), e = F(o.value.keys().next().value ?? p), i = E(() => {
167
+ const a = /* @__PURE__ */ new Map();
168
+ if (o.value.forEach((l) => {
168
169
  let d = {
169
- value: n.key,
170
- title: n.name
170
+ value: l.key,
171
+ title: l.name
171
172
  };
172
- e.addSearcherIcon && (d.icon = Re(n.key)), o.set(n.key, d);
173
- }), e.addCompare && !o.has(I)) {
174
- const n = {
173
+ t.addSearcherIcon && (d.icon = Fe(l.key)), a.set(l.key, d);
174
+ }), t.addCompare && !a.has(p)) {
175
+ const l = {
175
176
  value: "",
176
177
  title: "--------------------",
177
178
  disabled: !0
178
179
  };
179
- o.set(n.value, n);
180
+ a.set(l.value, l);
180
181
  const d = {
181
- value: -1,
182
- title: i.Common.Compare
182
+ value: K,
183
+ title: n.Common.Compare
183
184
  };
184
- o.set(d.value, d);
185
+ a.set(d.value, d);
185
186
  }
186
- return o;
187
+ return a;
187
188
  });
188
189
  return {
189
- searcherKey: t,
190
- optionBySearcherKey: l
190
+ searcherKey: e,
191
+ optionBySearcherKey: i
191
192
  };
192
- }, Qe = (e, a) => {
193
- var o, n, d;
194
- const i = R(), t = F(I);
195
- e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === I && (e.forFrequency ? t.value = ((n = (o = a.value) == null ? void 0 : o.regionByIndex.values().next().value) == null ? void 0 : n.key) ?? I : t.value = ((d = a.value) == null ? void 0 : d.regionByIndex.keys().next().value) ?? I);
196
- const l = M(() => {
197
- var f;
198
- const g = /* @__PURE__ */ new Map();
199
- return (f = a.value.regionByIndex) == null || f.forEach((v) => {
200
- let r = v.name;
201
- if (e.forFrequency) {
202
- const C = {
203
- value: v.key,
193
+ }, tt = (t, o) => {
194
+ var a, l, d;
195
+ const n = R(), e = F(p);
196
+ t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === p && (t.forFrequency ? e.value = ((l = (a = o.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : l.key) ?? p : e.value = ((d = o.value) == null ? void 0 : d.regionByIndex.keys().next().value) ?? p);
197
+ const i = E(() => {
198
+ var h;
199
+ const f = /* @__PURE__ */ new Map();
200
+ return (h = o.value.regionByIndex) == null || h.forEach((S) => {
201
+ let r = S.name;
202
+ if (t.forFrequency) {
203
+ const x = {
204
+ value: S.key,
204
205
  title: r
205
206
  };
206
- g.has(v.key) || g.set(v.key, C);
207
+ f.has(S.key) || f.set(S.key, x);
207
208
  return;
208
209
  }
209
- v.device && (r += " (" + i.Common["Device_" + v.device] + ")");
210
- const m = Ne(a.value.key || 0, v.lang ?? "");
211
- m && (r += " / " + m);
212
- const y = {
213
- value: v.index,
210
+ S.device && (r += " (" + n.Common["Device_" + S.device] + ")");
211
+ const g = qe(o.value.key || 0, S.lang ?? "");
212
+ g && (r += " / " + g);
213
+ const u = {
214
+ value: S.index,
214
215
  title: r,
215
- icon: v.device ? De(v.device) : void 0
216
+ icon: S.device ? Pe(S.device) : void 0
216
217
  };
217
- g.set(v.index, y);
218
- }), g;
218
+ f.set(S.index, u);
219
+ }), f;
219
220
  });
220
- return L(l, (g, f) => {
221
- var y;
222
- if (e.onlySearcher || t.value !== void 0 && g.get(t.value))
221
+ return w(i, (f, h) => {
222
+ var u;
223
+ if (t.onlySearcher || e.value !== void 0 && f.get(e.value))
223
224
  return;
224
- let v = g.keys().next().value;
225
- if (t.value === I || v === I) {
226
- t.value = v;
225
+ let S = f.keys().next().value;
226
+ if (e.value === p || S === p) {
227
+ e.value = S;
227
228
  return;
228
229
  }
229
- let r = ((y = f == null ? void 0 : f.get(t.value)) == null ? void 0 : y.title) || "", m = -1;
230
- for (const [C, k] of g.entries()) {
231
- const S = k.title;
232
- if (typeof S != "string" || typeof C == "string")
230
+ let r = ((u = h == null ? void 0 : h.get(e.value)) == null ? void 0 : u.title) || "", g = -1;
231
+ for (const [x, T] of f.entries()) {
232
+ const C = T.title;
233
+ if (typeof C != "string" || typeof x == "string")
233
234
  break;
234
- if (S === r) {
235
- v = C;
235
+ if (C === r) {
236
+ S = x;
236
237
  break;
237
238
  }
238
- const _ = new RegExp(` \\((${i.Common.Device_1}|${i.Common.Device_2})\\)`);
239
- let T = r, u = 3;
240
- S.indexOf(T) === -1 && (T = r.replace(/^[^a-zа-я]/i, "").replace(_, ""), u--), S.indexOf(T) === -1 && (T = r.replace(/ \/.*/, ""), u--), S.indexOf(T) === -1 && (T = r.replace(/ \/.*/, ""), T = T.replace(/^[^a-zа-я]/i, "").replace(_, ""), u--), S.indexOf(T) !== -1 && (u <= m || (m = u, v = C));
239
+ const V = new RegExp(` \\((${n.Common.Device_1}|${n.Common.Device_2})\\)`);
240
+ let m = r, s = 3;
241
+ C.indexOf(m) === -1 && (m = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), s--), C.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), m = m.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(m) !== -1 && (s <= g || (g = s, S = x));
241
242
  }
242
- t.value = v;
243
+ e.value = S;
243
244
  }), {
244
- regionIndex: t,
245
- optionByRegionIndex: l
245
+ regionIndex: e,
246
+ optionByRegionIndex: i
246
247
  };
247
- }, Xe = (e, a, i) => {
248
- const t = F([]), l = () => {
249
- if (e.onlySearcher && a.value) {
250
- t.value = Array.from(a.value.keys());
248
+ }, at = (t, o, n) => {
249
+ const e = F([]), i = () => {
250
+ if (t.onlySearcher && o.value) {
251
+ e.value = Array.from(o.value.keys());
251
252
  return;
252
253
  }
253
- let n = [];
254
- if (e.modelValue.length > 1)
255
- n = [...e.modelValue];
254
+ let l = [];
255
+ if (t.modelValue.length > 1)
256
+ l = [...t.modelValue];
256
257
  else
257
258
  try {
258
- n = JSON.parse(
259
- localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
259
+ l = JSON.parse(
260
+ localStorage.getItem("ui:project:regionSelector" + t.projectId + ":regionsIndexes")
260
261
  ) ?? [];
261
262
  } catch {
262
263
  }
263
- n.length && (n = n.filter((d) => i.value.has(d))), n.length || (n = Array.from(i.value)), t.value = [...n];
264
- }, o = () => {
265
- t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
264
+ l.length && (l = l.filter((d) => n.value.has(d))), l.length || (l = Array.from(n.value)), e.value = [...l];
265
+ }, a = () => {
266
+ e.value.length ? localStorage.setItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes", JSON.stringify(e.value)) : localStorage.removeItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes");
266
267
  };
267
- return L(t, () => {
268
- o();
269
- }), e.addCompare && l(), {
270
- regionsIndexes: t
268
+ return w(e, () => {
269
+ a();
270
+ }), t.addCompare && i(), {
271
+ regionsIndexes: e
271
272
  };
272
- }, Ze = (e) => {
273
- const a = M(() => Ie(e.forFrequency, e.autoRegion, e.searchers)), i = M(() => a.value.get(l.searcherKey.value) || Se), t = M(() => {
273
+ }, ot = (t) => {
274
+ const o = E(() => ke(t.forFrequency, t.autoRegion, t.searchers)), n = E(() => o.value.get(i.searcherKey.value) || xe), e = E(() => {
274
275
  const r = /* @__PURE__ */ new Set();
275
- return a.value.forEach((m) => {
276
- var y;
277
- (y = m.regions) == null || y.forEach((C) => {
278
- C.index !== -1 && C.index !== I && r.add(C.index);
276
+ return o.value.forEach((g) => {
277
+ g.regionByIndex.forEach((u) => {
278
+ u.index !== te && u.index !== p && r.add(u.index);
279
279
  });
280
280
  }), r;
281
- }), l = He(e, a), o = Qe(e, i), n = Xe(e, a, t);
282
- L(a, () => {
283
- var m, y, C, k;
284
- if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((S) => t.value.has(S)), l.searcherKey.value === -1) return;
285
- let r = a.value.keys().next().value;
286
- a.value.forEach((S) => {
287
- var _, T, u;
288
- if (e.onlySearcher && S.key === l.searcherKey.value) {
289
- r = l.searcherKey.value;
281
+ }), i = et(t, o), a = tt(t, n), l = at(t, o, e);
282
+ w(o, () => {
283
+ var g, u, x, T;
284
+ if (t.onlySearcher ? l.regionsIndexes.value = Array.from(o.value.keys()) : l.regionsIndexes.value = l.regionsIndexes.value.filter((C) => e.value.has(C)), i.searcherKey.value === K) return;
285
+ let r = o.value.keys().next().value;
286
+ o.value.forEach((C) => {
287
+ var V, m, s;
288
+ if (t.onlySearcher && C.key === i.searcherKey.value) {
289
+ r = i.searcherKey.value;
290
290
  return;
291
291
  }
292
- if (o.regionIndex.value && ((_ = S.regionByIndex) != null && _.has(o.regionIndex.value)) && (r = S.key), !e.onlySearcher) {
293
- let s;
294
- r !== void 0 && (s = (T = a.value.get(r)) == null ? void 0 : T.regionByIndex);
295
- const c = (u = a.value.get(S.key)) == null ? void 0 : u.regionByIndex;
296
- s != null && s.has(I) && !(c != null && c.has(I)) && (r = S.key);
292
+ if (a.regionIndex.value && ((V = C.regionByIndex) != null && V.has(a.regionIndex.value)) && (r = C.key), !t.onlySearcher) {
293
+ let c;
294
+ r !== void 0 && (c = (m = o.value.get(r)) == null ? void 0 : m.regionByIndex);
295
+ const v = (s = o.value.get(C.key)) == null ? void 0 : s.regionByIndex;
296
+ c != null && c.has(p) && !(v != null && v.has(p)) && (r = C.key);
297
297
  }
298
- }), r !== void 0 && (l.searcherKey.value = r), o.regionIndex.value !== void 0 && !((y = (m = i.value) == null ? void 0 : m.regionByIndex) != null && y.has(o.regionIndex.value)) && (o.regionIndex.value = (k = (C = i.value) == null ? void 0 : C.regions) == null ? void 0 : k.keys().next().value);
298
+ }), r !== void 0 && (i.searcherKey.value = r), a.regionIndex.value !== void 0 && !((u = (g = n.value) == null ? void 0 : g.regionByIndex) != null && u.has(a.regionIndex.value)) && (a.regionIndex.value = (T = (x = n.value) == null ? void 0 : x.regions) == null ? void 0 : T.keys().next().value);
299
299
  }, { immediate: !0 });
300
300
  const d = () => {
301
- if (!(l.searcherKey.value === -1 || l.searcherKey.value === I))
302
- return l.searcherKey.value;
303
- }, g = () => {
304
- if (e.onlySearcher || o.regionIndex.value === I) return;
305
- let r = o.regionIndex.value;
306
- if (e.forFrequency) {
307
- const m = o.regionIndex.value, y = Ye(e.forFrequency, { searcher_key: d(), key: m }, e.searchers);
308
- r = y == null ? void 0 : y.index;
301
+ if (!(i.searcherKey.value === K || i.searcherKey.value === p))
302
+ return i.searcherKey.value;
303
+ }, f = () => {
304
+ if (t.onlySearcher || a.regionIndex.value === p) return;
305
+ let r = a.regionIndex.value;
306
+ if (t.forFrequency) {
307
+ const g = a.regionIndex.value, u = Xe(t.forFrequency, { searcher_key: d(), key: g }, t.searchers);
308
+ r = u == null ? void 0 : u.index;
309
309
  }
310
310
  return r;
311
- }, f = () => {
311
+ }, h = () => {
312
312
  const r = d();
313
313
  if (r !== void 0)
314
- return a.value.get(r);
314
+ return o.value.get(r);
315
315
  };
316
316
  return {
317
- selectSearcher: l,
318
- selectRegion: o,
319
- compare: n,
320
- searcherByKey: a,
321
- allRegionsIndexes: t,
322
- getSearcher: f,
317
+ selectSearcher: i,
318
+ selectRegion: a,
319
+ compare: l,
320
+ searcherByKey: o,
321
+ allRegionsIndexes: e,
322
+ getSearcher: h,
323
323
  getRegion: () => {
324
- var m, y;
325
- const r = g();
324
+ var g, u;
325
+ const r = f();
326
326
  if (r !== void 0)
327
- return (y = (m = f()) == null ? void 0 : m.regionByIndex) == null ? void 0 : y.get(r);
327
+ return (u = (g = h()) == null ? void 0 : g.regionByIndex) == null ? void 0 : u.get(r);
328
328
  }
329
329
  };
330
- }, et = /* @__PURE__ */ P({
330
+ }, lt = /* @__PURE__ */ P({
331
331
  __name: "selectorRegion",
332
- props: /* @__PURE__ */ O({
332
+ props: /* @__PURE__ */ N({
333
333
  projectId: {},
334
334
  searchers: { default: () => [] },
335
335
  modelValue: {},
@@ -347,131 +347,131 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
347
347
  modelValueSingle: {},
348
348
  modelValueSingleModifiers: {}
349
349
  }),
350
- emits: /* @__PURE__ */ O(["compareRegions"], ["update:modelValue", "update:modelValueSingle"]),
351
- setup(e, { expose: a, emit: i }) {
352
- const t = e, l = D(e, "modelValue"), o = D(e, "modelValueSingle"), n = i, {
353
- selectSearcher: d,
354
- selectRegion: g,
355
- compare: f,
356
- searcherByKey: v,
357
- allRegionsIndexes: r,
358
- getSearcher: m,
359
- getRegion: y
360
- } = Ze(t), C = () => {
361
- var k;
362
- if (window.fieldTemplates && ((k = window.fieldTemplates) != null && k.openSelectorRegions)) {
363
- window.fieldTemplates.openSelectorRegions(
364
- v.value,
365
- f.regionsIndexes.value,
366
- (S) => f.regionsIndexes.value = S
367
- );
368
- return;
369
- }
370
- n("compareRegions", v.value);
350
+ emits: ["update:modelValue", "update:modelValueSingle"],
351
+ setup(t, { expose: o }) {
352
+ const n = t, e = D(t, "modelValue"), i = D(t, "modelValueSingle"), {
353
+ selectSearcher: a,
354
+ selectRegion: l,
355
+ compare: d,
356
+ searcherByKey: f,
357
+ allRegionsIndexes: h,
358
+ getSearcher: S,
359
+ getRegion: r
360
+ } = ot(n), g = () => {
361
+ const u = [];
362
+ f.value.forEach((x) => {
363
+ x.enabled && x.regions.forEach((T) => {
364
+ T.enabled && u.push(T);
365
+ });
366
+ }), Ze.open("selectorRegions", {
367
+ regions: u,
368
+ regionsIndexes: d.regionsIndexes.value,
369
+ "@update:regionsIndexes": (x) => d.regionsIndexes.value = x
370
+ });
371
371
  };
372
- return L([g.regionIndex, d.searcherKey, f.regionsIndexes], () => {
373
- if (d.searcherKey.value === -1 && f.regionsIndexes.value.length) {
374
- if (JSON.stringify(l.value) === JSON.stringify(f.regionsIndexes.value))
372
+ return w([l.regionIndex, a.searcherKey, d.regionsIndexes], () => {
373
+ if (a.searcherKey.value === K && d.regionsIndexes.value.length) {
374
+ if (JSON.stringify(e.value) === JSON.stringify(d.regionsIndexes.value))
375
375
  return;
376
- l.value = [...f.regionsIndexes.value];
376
+ e.value = [...d.regionsIndexes.value];
377
377
  } else
378
- l.value = [t.onlySearcher ? d.searcherKey.value : g.regionIndex.value];
379
- !t.onlySearcher && !r.value.size && (d.searcherKey.value = I);
380
- }), o.value && L(o, () => {
381
- l.value = [o.value];
382
- }, { immediate: !0 }), L(l, () => {
383
- var k, S, _, T, u;
384
- if (l.value[0] && (o.value = l.value[0]), t.onlySearcher) {
385
- if (!l.value.length || l.value.length === 1 && !v.value.has(l.value[0])) {
386
- let s = v.value.keys().next().value;
387
- s !== void 0 && (l.value = [s]);
378
+ n.onlySearcher ? (e.value = [a.searcherKey.value], a.searcherKey.value === p && !n.autoRegion && (e.value = [])) : (e.value = [l.regionIndex.value], l.regionIndex.value === p && !n.autoRegion && (e.value = []));
379
+ !n.onlySearcher && !h.value.size && (a.searcherKey.value = p);
380
+ }), i.value && w(i, () => {
381
+ i.value && (e.value = [i.value]);
382
+ }, { immediate: !0 }), w(e, () => {
383
+ var u, x, T, C, V;
384
+ if (e.value[0] && (i.value = e.value[0]), n.onlySearcher) {
385
+ if (!e.value.length || e.value.length === 1 && !f.value.has(e.value[0])) {
386
+ let m = f.value.keys().next().value;
387
+ m === p && !n.autoRegion && (m = void 0, i.value = p), m !== void 0 && (e.value = [m]);
388
388
  return;
389
389
  }
390
- if (l.value.length > 1 && JSON.stringify(l.value) !== JSON.stringify(f.regionsIndexes.value)) {
391
- l.value = [...f.regionsIndexes.value];
390
+ if (e.value.length > 1 && JSON.stringify(e.value) !== JSON.stringify(d.regionsIndexes.value)) {
391
+ e.value = [...d.regionsIndexes.value];
392
392
  return;
393
393
  }
394
394
  } else {
395
- let s = [...new Set(l.value)], c = (S = (k = v.value.values().next().value) == null ? void 0 : k.regionByIndex) == null ? void 0 : S.keys().next().value;
396
- if (t.forFrequency && (c = (u = (T = (_ = v.value.values().next().value) == null ? void 0 : _.regionByIndex) == null ? void 0 : T.values().next().value) == null ? void 0 : u.key), !s.length)
397
- c !== void 0 && s.push(c);
398
- else if (s.length === 1) {
399
- let p = r.value;
400
- t.forFrequency && (p = /* @__PURE__ */ new Set(), v.value.forEach((V) => {
401
- V.regionByIndex.forEach((E) => {
402
- E.index !== -1 && E.index !== I && p.add(E.key);
395
+ let m = [...new Set(e.value)], s = (x = (u = f.value.values().next().value) == null ? void 0 : u.regionByIndex) == null ? void 0 : x.keys().next().value;
396
+ if (n.forFrequency && (s = (V = (C = (T = f.value.values().next().value) == null ? void 0 : T.regionByIndex) == null ? void 0 : C.values().next().value) == null ? void 0 : V.key), s === p && !n.autoRegion && (s = void 0, i.value = p), !m.length)
397
+ s !== void 0 && m.push(s);
398
+ else if (m.length === 1) {
399
+ let c = h.value;
400
+ n.forFrequency && (c = /* @__PURE__ */ new Set(), f.value.forEach((v) => {
401
+ v.regionByIndex.forEach((I) => {
402
+ I.index !== te && I.index !== p && c.add(I.key);
403
403
  });
404
- })), !p.has(s[0]) && s[0] !== -2 && (s = [], c !== void 0 && s.push(c));
404
+ })), !c.has(m[0]) && m[0] !== p && (m = [], s !== void 0 && m.push(s));
405
405
  } else
406
- s = s.filter((p) => r.value.has(p)), !s.length && c !== void 0 && s.push(c);
407
- if (JSON.stringify(l.value) !== JSON.stringify(s)) {
408
- l.value = s;
406
+ m = m.filter((c) => h.value.has(c)), !m.length && s !== void 0 && m.push(s);
407
+ if (JSON.stringify(e.value) !== JSON.stringify(m)) {
408
+ e.value = m;
409
409
  return;
410
410
  }
411
411
  }
412
- if (!(l.value.length === 1 && l.value[0] === (t.onlySearcher ? d.searcherKey.value : g.regionIndex.value)))
413
- if (t.onlySearcher) {
414
- if (l.value.length === 1) {
415
- d.searcherKey.value = l.value[0];
412
+ if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : l.regionIndex.value)))
413
+ if (n.onlySearcher) {
414
+ if (e.value.length === 1) {
415
+ a.searcherKey.value = e.value[0];
416
416
  return;
417
417
  }
418
- d.searcherKey.value = -1;
418
+ a.searcherKey.value = K;
419
419
  return;
420
- } else if (l.value.length === 1 && d.searcherKey.value !== -1) {
421
- g.regionIndex.value = l.value[0];
422
- let s;
423
- for (const c of v.value.values()) {
424
- for (const p of c.regionByIndex.values())
425
- if ((t.forFrequency ? p.key : p.index) === g.regionIndex.value) {
426
- s = c.key;
420
+ } else if (e.value.length === 1 && a.searcherKey.value !== K) {
421
+ l.regionIndex.value = e.value[0];
422
+ let m;
423
+ for (const s of f.value.values()) {
424
+ for (const c of s.regionByIndex.values())
425
+ if ((n.forFrequency ? c.key : c.index) === l.regionIndex.value) {
426
+ m = s.key;
427
427
  break;
428
428
  }
429
- if (s !== void 0)
429
+ if (m !== void 0)
430
430
  break;
431
431
  }
432
- s !== void 0 && (d.searcherKey.value = s);
432
+ m !== void 0 && (a.searcherKey.value = m);
433
433
  } else
434
- d.searcherKey.value = -1, f.regionsIndexes.value = [...l.value];
435
- }, { immediate: !0 }), a({
436
- getSearcher: m,
437
- getRegion: y
438
- }), (k, S) => (x(), w("div", {
439
- class: Q({
434
+ a.searcherKey.value = K, d.regionsIndexes.value = [...e.value];
435
+ }, { immediate: !0 }), o({
436
+ getSearcher: S,
437
+ getRegion: r
438
+ }), (u, x) => (k(), B("div", {
439
+ class: X({
440
440
  "top-selectorRegion": !0,
441
- "top-selectorRegion-onlySearcher": k.onlySearcher
441
+ "top-selectorRegion-onlySearcher": u.onlySearcher
442
442
  })
443
443
  }, [
444
- A(re, {
445
- options: h(d).optionBySearcherKey.value,
446
- modelValue: h(d).searcherKey.value,
447
- "onUpdate:modelValue": S[0] || (S[0] = (_) => h(d).searcherKey.value = _),
444
+ A(se, {
445
+ options: y(a).optionBySearcherKey.value,
446
+ modelValue: y(a).searcherKey.value,
447
+ "onUpdate:modelValue": x[0] || (x[0] = (T) => y(a).searcherKey.value = T),
448
448
  name: "searcher_key",
449
- addChanger: k.addChanger
449
+ addChanger: u.addChanger
450
450
  }, null, 8, ["options", "modelValue", "addChanger"]),
451
- !k.onlySearcher && h(d).searcherKey.value !== -1 ? (x(), B(re, {
451
+ !u.onlySearcher && y(a).searcherKey.value !== y(K) ? (k(), b(se, {
452
452
  key: 0,
453
453
  class: "top-select-region",
454
- options: h(g).optionByRegionIndex.value,
455
- modelValue: h(g).regionIndex.value,
456
- "onUpdate:modelValue": S[1] || (S[1] = (_) => h(g).regionIndex.value = _),
457
- name: k.forFrequency ? "region_key" : "region_index",
458
- addChanger: k.addChanger,
459
- "data-top-icon": k.addRegionIcon ? "" : void 0
454
+ options: y(l).optionByRegionIndex.value,
455
+ modelValue: y(l).regionIndex.value,
456
+ "onUpdate:modelValue": x[1] || (x[1] = (T) => y(l).regionIndex.value = T),
457
+ name: u.forFrequency ? "region_key" : "region_index",
458
+ addChanger: u.addChanger,
459
+ "data-top-icon": u.addRegionIcon ? "" : void 0
460
460
  }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : q("", !0),
461
- k.addCompare && !k.onlySearcher && h(d).searcherKey.value === -1 ? (x(), B(Y, {
461
+ u.addCompare && !u.onlySearcher && y(a).searcherKey.value === y(K) ? (k(), b(H, {
462
462
  key: 1,
463
463
  name: "compare",
464
- onClick: C,
465
- "data-count-compare-regions-indexes": h(f).regionsIndexes.value.length
464
+ onClick: g,
465
+ "data-count-compare-regions-indexes": y(d).regionsIndexes.value.length
466
466
  }, {
467
- default: b(() => [
468
- z(K(k.$i18n.Common.Selected_regions), 1)
467
+ default: _(() => [
468
+ G(M(u.$i18n.Common.Selected_regions), 1)
469
469
  ]),
470
470
  _: 1
471
471
  }, 8, ["data-count-compare-regions-indexes"])) : q("", !0)
472
472
  ], 2));
473
473
  }
474
- }), tt = [
474
+ }), nt = [
475
475
  {
476
476
  id: "1",
477
477
  name: "Without Tag",
@@ -522,12 +522,12 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
522
522
  name: "Turquoise",
523
523
  color_id: "10"
524
524
  }
525
- ], ge = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ae = (e, a) => {
526
- e = H(e);
527
- const i = a.find((t) => t.id === e);
528
- if (i)
529
- return i;
530
- }, at = ["data-tag_id", "data-tag_color_id", "title"], le = /* @__PURE__ */ P({
525
+ ], ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, le = (t, o) => {
526
+ t = Q(t);
527
+ const n = o.find((e) => e.id === t);
528
+ if (n)
529
+ return n;
530
+ }, rt = ["data-tag_id", "data-tag_color_id", "title"], ne = /* @__PURE__ */ P({
531
531
  __name: "tagIcon",
532
532
  props: {
533
533
  id: {},
@@ -535,21 +535,21 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
535
535
  name: {},
536
536
  state: {}
537
537
  },
538
- setup(e) {
539
- return (a, i) => (x(), w("div", {
540
- class: Q({
538
+ setup(t) {
539
+ return (o, n) => (k(), B("div", {
540
+ class: X({
541
541
  "top-tagSelector_tagIcon": !0,
542
- "top-tagSelector-active": !!a.state,
543
- "top-tagSelector-excluded": a.state === "excluded"
542
+ "top-tagSelector-active": !!o.state,
543
+ "top-tagSelector-excluded": o.state === "excluded"
544
544
  }),
545
- "data-tag_id": a.id,
546
- "data-tag_color_id": a.colorId,
547
- title: a.name
548
- }, null, 10, at));
545
+ "data-tag_id": o.id,
546
+ "data-tag_color_id": o.colorId,
547
+ title: o.name
548
+ }, null, 10, rt));
549
549
  }
550
- }), lt = ["contenteditable", "onKeydown"], fe = /* @__PURE__ */ P({
550
+ }), it = ["contenteditable", "onKeydown"], ye = /* @__PURE__ */ P({
551
551
  __name: "tagPopupListItem",
552
- props: /* @__PURE__ */ O({
552
+ props: /* @__PURE__ */ N({
553
553
  editable: { type: Boolean },
554
554
  disabled: { type: Boolean },
555
555
  canExclude: { type: Boolean },
@@ -563,76 +563,76 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
563
563
  },
564
564
  nameModifiers: {}
565
565
  }),
566
- emits: /* @__PURE__ */ O(["update:name", "unselect", "exclude", "select"], ["update:name"]),
567
- setup(e, { emit: a }) {
568
- const i = e, t = a, l = D(e, "name"), o = F(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
566
+ emits: /* @__PURE__ */ N(["update:name", "unselect", "exclude", "select"], ["update:name"]),
567
+ setup(t, { emit: o }) {
568
+ const n = t, e = o, i = D(t, "name"), a = F(null), l = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
569
569
  contenteditable: d.value,
570
- onpaste: (m) => m.preventDefault()
571
- } : {}), d = F(!1), g = async () => {
572
- var m;
573
- d.value = !0, await be(), (m = o.value) == null || m.focus();
574
- }, f = () => {
575
- var y;
576
- const m = (y = o.value) == null ? void 0 : y.innerText;
577
- if (!m) return v();
578
- o.value && (o.value.innerText = m), d.value = !1, t("update:name", m);
579
- }, v = async () => {
580
- o.value && (o.value.innerText = i.name), d.value = !1;
581
- }, r = (m) => {
582
- if (d.value || i.disabled) return;
583
- let y = "selected";
584
- i.canExclude && (m.ctrlKey || m.metaKey) && (y = "excluded"), i.state == y && (y = ""), y === "" && t("unselect"), y === "selected" && t("select"), y === "excluded" && t("exclude");
570
+ onpaste: (g) => g.preventDefault()
571
+ } : {}), d = F(!1), f = async () => {
572
+ var g;
573
+ d.value = !0, await Ve(), (g = a.value) == null || g.focus();
574
+ }, h = () => {
575
+ var u;
576
+ const g = (u = a.value) == null ? void 0 : u.innerText;
577
+ if (!g) return S();
578
+ a.value && (a.value.innerText = g), d.value = !1, e("update:name", g);
579
+ }, S = async () => {
580
+ a.value && (a.value.innerText = n.name), d.value = !1;
581
+ }, r = (g) => {
582
+ if (d.value || n.disabled) return;
583
+ let u = "selected";
584
+ n.canExclude && (g.ctrlKey || g.metaKey) && (u = "excluded"), n.state == u && (u = ""), u === "" && e("unselect"), u === "selected" && e("select"), u === "excluded" && e("exclude");
585
585
  };
586
- return (m, y) => (x(), B(se, {
587
- class: Q({
586
+ return (g, u) => (k(), b(ue, {
587
+ class: X({
588
588
  "top-tagSelector_tagListItem": !0,
589
589
  "top-tagSelector_tagListItem-inEdit": d.value,
590
- "top-tagSelector_tagListItem-disabled": m.disabled,
591
- "top-tagSelector_tagListItem-canExclude": m.canExclude,
592
- "top-tagSelector-active": !!m.state,
593
- "top-tagSelector-excluded": m.state === "excluded"
590
+ "top-tagSelector_tagListItem-disabled": g.disabled,
591
+ "top-tagSelector_tagListItem-canExclude": g.canExclude,
592
+ "top-tagSelector-active": !!g.state,
593
+ "top-tagSelector-excluded": g.state === "excluded"
594
594
  }),
595
- onClick: j(r, ["stop"])
595
+ onClick: J(r, ["stop"])
596
596
  }, {
597
- default: b(() => [
598
- A(le, {
599
- id: m.id,
600
- name: l.value,
601
- colorId: m.colorId,
602
- state: m.state
597
+ default: _(() => [
598
+ A(ne, {
599
+ id: g.id,
600
+ name: i.value,
601
+ colorId: g.colorId,
602
+ state: g.state
603
603
  }, null, 8, ["id", "name", "colorId", "state"]),
604
- ye("span", pe({
604
+ he("span", Se({
605
605
  ref_key: "elName",
606
- ref: o,
606
+ ref: a,
607
607
  class: "top-tagSelector_tagListItemName",
608
608
  contenteditable: d.value ? "plaintext-only" : !1
609
- }, n.value, {
609
+ }, l.value, {
610
610
  onKeydown: [
611
- de(j(f, ["stop"]), ["enter"]),
612
- de(j(v, ["stop"]), ["esc"])
611
+ ce(J(h, ["stop"]), ["enter"]),
612
+ ce(J(S, ["stop"]), ["esc"])
613
613
  ]
614
- }), K(l.value), 17, lt),
615
- m.editable ? (x(), w(W, { key: 0 }, [
616
- d.value ? (x(), w("span", {
614
+ }), M(i.value), 17, it),
615
+ g.editable ? (k(), B(Y, { key: 0 }, [
616
+ d.value ? (k(), B("span", {
617
617
  key: 1,
618
618
  "data-top-icon": "",
619
619
  class: "top-tagSelector_edit",
620
- onClick: j(f, ["stop"])
621
- })) : (x(), w("span", {
620
+ onClick: J(h, ["stop"])
621
+ })) : (k(), B("span", {
622
622
  key: 0,
623
623
  "data-top-icon": "",
624
624
  class: "top-tagSelector_edit",
625
- onClick: g
625
+ onClick: f
626
626
  }))
627
627
  ], 64)) : q("", !0)
628
628
  ]),
629
629
  _: 1
630
630
  }, 8, ["class"]));
631
631
  }
632
- }), ot = { key: 1 }, ke = /* @__PURE__ */ P({
632
+ }), st = { key: 1 }, Te = /* @__PURE__ */ P({
633
633
  inheritAttrs: !1,
634
634
  __name: "popupOpener",
635
- props: /* @__PURE__ */ O({
635
+ props: /* @__PURE__ */ N({
636
636
  modelValue: {},
637
637
  id: {},
638
638
  tags: {},
@@ -648,62 +648,62 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
648
648
  modelModifiers: {}
649
649
  }),
650
650
  emits: ["update:modelValue"],
651
- setup(e) {
652
- const a = e, i = D(e, "modelValue"), t = a.useTopButton ? Y : "div", l = a.useTopButton ? "html" : "default", o = {
653
- model: i,
654
- mode: a.mode,
655
- targetId: a.targetId,
656
- filters: a.filters,
657
- payload: a.payload
651
+ setup(t) {
652
+ const o = t, n = D(t, "modelValue"), e = o.useTopButton ? H : "div", i = o.useTopButton ? "html" : "default", a = {
653
+ model: n,
654
+ mode: o.mode,
655
+ targetId: o.targetId,
656
+ filters: o.filters,
657
+ payload: o.payload
658
658
  };
659
- return (n, d) => {
660
- const g = Be("top-data");
661
- return x(), B(Ae, { id: n.id }, {
662
- default: b(() => [
663
- Ve((x(), B(we(h(t)), pe({
659
+ return (l, d) => {
660
+ const f = Ee("top-data");
661
+ return k(), b(Oe, { id: l.id }, {
662
+ default: _(() => [
663
+ Ke((k(), b(Me(y(e)), Se({
664
664
  class: {
665
665
  "top-tagSelector": !0,
666
- "top-tagSelector-filter": a.mode === "filter",
667
- "top-tagSelector-setter_single": a.mode === "setter" && !n.filters,
668
- "top-tagSelector-setter_several": a.mode === "setter" && n.filters,
669
- "top-tagSelector-selectedOne": !i.value.length || i.value.length === 1,
670
- "top-tagSelector-toTwoLine": i.value.length > 5
666
+ "top-tagSelector-filter": o.mode === "filter",
667
+ "top-tagSelector-setter_single": o.mode === "setter" && !l.filters,
668
+ "top-tagSelector-setter_several": o.mode === "setter" && l.filters,
669
+ "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
670
+ "top-tagSelector-toTwoLine": n.value.length > 5
671
671
  },
672
672
  color: "theme",
673
673
  styling: ""
674
- }, n.$attrs), {
675
- [h(l)]: b(() => [
676
- !i.value.length && n.mode === "filter" ? (x(), B(le, {
674
+ }, l.$attrs), {
675
+ [y(i)]: _(() => [
676
+ !n.value.length && l.mode === "filter" ? (k(), b(ne, {
677
677
  key: 0,
678
678
  id: "all",
679
679
  colorId: "",
680
- name: n.$i18n.Common.All_tags ?? "",
680
+ name: l.$i18n.Common.All_tags ?? "",
681
681
  state: ""
682
682
  }, null, 8, ["name"])) : q("", !0),
683
- n.mode === "setter" && n.filters ? (x(), w("div", ot, [
684
- Me(n.$slots, "default")
685
- ])) : (x(!0), w(W, { key: 2 }, ie(i.value, (f) => {
686
- var v, r;
687
- return x(), B(le, {
688
- id: h(H)(f),
689
- colorId: ((v = h(ae)(f, n.tags)) == null ? void 0 : v.color_id) ?? "",
690
- name: ((r = h(ae)(f, n.tags)) == null ? void 0 : r.name) ?? "",
691
- state: h(H)(f) === f ? "selected" : "excluded"
683
+ l.mode === "setter" && l.filters ? (k(), B("div", st, [
684
+ $e(l.$slots, "default")
685
+ ])) : (k(!0), B(Y, { key: 2 }, de(n.value, (h) => {
686
+ var S, r;
687
+ return k(), b(ne, {
688
+ id: y(Q)(h),
689
+ colorId: ((S = y(le)(h, l.tags)) == null ? void 0 : S.color_id) ?? "",
690
+ name: ((r = y(le)(h, l.tags)) == null ? void 0 : r.name) ?? "",
691
+ state: y(Q)(h) === h ? "selected" : "excluded"
692
692
  }, null, 8, ["id", "colorId", "name", "state"]);
693
693
  }), 256))
694
694
  ]),
695
695
  _: 2
696
696
  }, 1040, ["class"])), [
697
- [g, o, "topTagSelectorTarget"]
697
+ [f, a, "topTagSelectorTarget"]
698
698
  ])
699
699
  ]),
700
700
  _: 3
701
701
  }, 8, ["id"]);
702
702
  };
703
703
  }
704
- }), nt = /* @__PURE__ */ P({
704
+ }), dt = /* @__PURE__ */ P({
705
705
  __name: "tagSelector",
706
- props: /* @__PURE__ */ O({
706
+ props: /* @__PURE__ */ N({
707
707
  modelValue: {},
708
708
  tags: {},
709
709
  tagsEditable: { type: Boolean },
@@ -719,180 +719,180 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
719
719
  },
720
720
  modelModifiers: {},
721
721
  tags: {
722
- default: Ke(tt)
722
+ default: Ae(nt)
723
723
  },
724
724
  tagsModifiers: {}
725
725
  }),
726
- emits: /* @__PURE__ */ O(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
727
- setup(e, { emit: a }) {
728
- const i = R(), t = e, l = D(e, "modelValue"), o = D(e, "tags"), n = a, d = Le((u, s) => {
729
- n(u, s);
730
- }, t.emitDelay);
731
- t.singleMode && !l.value.length && (l.value = [o.value[0].id]);
732
- const g = t.id ?? "top-popup-id-" + Math.random(), f = F("add"), v = () => {
733
- var c;
734
- const u = " " + ((c = i.Common.Tags) == null ? void 0 : c.toLowerCase()), s = /* @__PURE__ */ new Map();
735
- return s.set("add", { value: "add", title: i.Common.Add + u }), s.set("replace", { value: "replace", title: i.Common.Replace + u }), s.set("delete", { value: "delete", title: i.Common.Delete + u }), s;
726
+ emits: /* @__PURE__ */ N(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
727
+ setup(t, { emit: o }) {
728
+ const n = R(), e = t, i = D(t, "modelValue"), a = D(t, "tags"), l = o, d = Re((s, c) => {
729
+ l(s, c);
730
+ }, e.emitDelay);
731
+ e.singleMode && !i.value.length && (i.value = [a.value[0].id]);
732
+ const f = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
733
+ var v;
734
+ const s = " " + ((v = n.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
735
+ return c.set("add", { value: "add", title: n.Common.Add + s }), c.set("replace", { value: "replace", title: n.Common.Replace + s }), c.set("delete", { value: "delete", title: n.Common.Delete + s }), c;
736
736
  };
737
- let r = $e({
738
- model: l,
737
+ let r = we({
738
+ model: i,
739
739
  mode: "filter",
740
740
  targetId: void 0,
741
741
  filters: void 0,
742
742
  payload: void 0
743
743
  });
744
- L(l, () => {
745
- d("selector", l.value);
744
+ w(i, () => {
745
+ d("selector", i.value);
746
746
  });
747
- const m = M(() => {
748
- if (r.value.mode === "setter" && t.maxTagsForSetter && !r.value.filters)
749
- return r.value.model.value.length >= t.maxTagsForSetter;
750
- }), y = (u) => {
751
- if (u !== "all") {
752
- if (r.value.model.value.includes(u)) return "selected";
753
- if (r.value.model.value.includes(ge(u))) return "excluded";
747
+ const g = E(() => {
748
+ if (r.value.mode === "setter" && e.maxTagsForSetter && !r.value.filters)
749
+ return r.value.model.value.length >= e.maxTagsForSetter;
750
+ }), u = (s) => {
751
+ if (s !== "all") {
752
+ if (r.value.model.value.includes(s)) return "selected";
753
+ if (r.value.model.value.includes(ve(s))) return "excluded";
754
754
  }
755
- return u === "all" && !r.value.model.value.length ? "selected" : "";
756
- }, C = (u, s) => {
757
- const c = ge(u);
758
- let p = r.value.model.value.filter((V) => V !== u && V !== c);
759
- s === "select" && p.push(u), s === "exclude" && p.push(c), r.value.mode === "setter" && r.value.targetId !== void 0 && t.requiredForSetter && (p.length || p.push("1"), p.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (p = p.filter((V) => V !== "1"))), t.singleMode && !r.value.filters && (p.length || (p = r.value.model.value), p.length > 1 && (p = [p[p.length - 1]])), p.sort((V, E) => {
760
- if (!t.tags) return 0;
761
- const X = t.tags.findIndex((N) => N.id === V), U = t.tags.findIndex((N) => N.id === E);
762
- return X - U;
763
- }), r.value.model.value = p, r.value.mode === "setter" && r.value.targetId !== void 0 && d("setter", {
764
- tagsIds: p,
755
+ return s === "all" && !r.value.model.value.length ? "selected" : "";
756
+ }, x = (s, c) => {
757
+ const v = ve(s);
758
+ let I = r.value.model.value.filter((L) => L !== s && L !== v);
759
+ c === "select" && I.push(s), c === "exclude" && I.push(v), r.value.mode === "setter" && r.value.targetId !== void 0 && e.requiredForSetter && (I.length || I.push("1"), I.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (I = I.filter((L) => L !== "1"))), e.singleMode && !r.value.filters && (I.length || (I = r.value.model.value), I.length > 1 && (I = [I[I.length - 1]])), I.sort((L, U) => {
760
+ if (!e.tags) return 0;
761
+ const Z = e.tags.findIndex((O) => O.id === L), j = e.tags.findIndex((O) => O.id === U);
762
+ return Z - j;
763
+ }), r.value.model.value = I, r.value.mode === "setter" && r.value.targetId !== void 0 && d("setter", {
764
+ tagsIds: I,
765
765
  targetId: r.value.targetId,
766
766
  payload: r.value.payload
767
767
  });
768
- }, k = M(() => {
769
- let u = "top-tagSelector_popup";
770
- return r.value.mode === "filter" && (u += " top-tagSelector_popup-filter"), r.value.mode === "setter" && (u += " top-tagSelector_popup-setter"), u;
771
- }), S = () => {
772
- const u = prompt("", "New tag");
773
- if (!u || u === "New tag") return;
774
- const s = o.value.length + 1;
775
- o.value.push({
776
- id: String(s),
777
- name: u,
778
- color_id: String((s - 1) % 10 + 1)
779
- }), n("tagsChanged", o.value);
780
- }, _ = (u) => {
781
- var s;
782
- if (r.value = G(u.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
783
- if (r.value.filters && (f.value = "add", r.value.model.value = []), !((s = J.$) != null && s.ui.sortable)) {
768
+ }, T = E(() => {
769
+ let s = "top-tagSelector_popup";
770
+ return r.value.mode === "filter" && (s += " top-tagSelector_popup-filter"), r.value.mode === "setter" && (s += " top-tagSelector_popup-setter"), s;
771
+ }), C = () => {
772
+ const s = prompt("", "New tag");
773
+ if (!s || s === "New tag") return;
774
+ const c = a.value.length + 1;
775
+ a.value.push({
776
+ id: String(c),
777
+ name: s,
778
+ color_id: String((c - 1) % 10 + 1)
779
+ }), l("tagsChanged", a.value);
780
+ }, V = (s) => {
781
+ var c;
782
+ if (r.value = W(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
783
+ if (r.value.filters && (h.value = "add", r.value.model.value = []), !((c = z.$) != null && c.ui.sortable)) {
784
784
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
785
785
  return;
786
786
  }
787
- !J.state.isMobile && !J.state.isMobileUA && o.value && $(u.elPopup).sortable({
787
+ !z.state.isMobile && !z.state.isMobileUA && a.value && $(s.elPopup).sortable({
788
788
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
789
789
  /**
790
790
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
791
791
  */
792
792
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
793
793
  distance: 10,
794
- stop: function(c, p) {
795
- if (!o.value) return;
796
- const V = $(p.item).parent().find("[data-tag_id]"), E = [];
797
- V.each((X, U) => {
798
- if (!o.value) return;
799
- const N = $(U).attr("data-tag_id");
800
- E.push(N);
801
- }), o.value.sort((X, U) => {
802
- const N = E.findIndex((oe) => oe === X.id), Ce = E.findIndex((oe) => oe === U.id);
803
- return N - Ce;
804
- }), d("tagsChanged", o.value);
794
+ stop: function(v, I) {
795
+ if (!a.value) return;
796
+ const L = $(I.item).parent().find("[data-tag_id]"), U = [];
797
+ L.each((Z, j) => {
798
+ if (!a.value) return;
799
+ const O = $(j).attr("data-tag_id");
800
+ U.push(O);
801
+ }), a.value.sort((Z, j) => {
802
+ const O = U.findIndex((re) => re === Z.id), _e = U.findIndex((re) => re === j.id);
803
+ return O - _e;
804
+ }), d("tagsChanged", a.value);
805
805
  }
806
806
  });
807
- }, T = (u) => {
808
- var s;
809
- (s = J.$) != null && s.ui.sortable && $(u.elPopup).data("ui-sortable") && $(u.elPopup).sortable("destroy");
807
+ }, m = (s) => {
808
+ var c;
809
+ (c = z.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
810
810
  };
811
- return (u, s) => (x(), w(W, null, [
812
- A(ke, {
811
+ return (s, c) => (k(), B(Y, null, [
812
+ A(Te, {
813
813
  class: "top-select_arrow",
814
- modelValue: l.value,
815
- "onUpdate:modelValue": s[0] || (s[0] = (c) => l.value = c),
816
- id: h(g),
817
- tags: o.value,
814
+ modelValue: i.value,
815
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => i.value = v),
816
+ id: y(f),
817
+ tags: a.value,
818
818
  mode: "filter",
819
819
  useTopButton: ""
820
820
  }, null, 8, ["modelValue", "id", "tags"]),
821
- A(he, {
822
- id: h(g),
823
- class: Q(k.value),
824
- onOpen: s[4] || (s[4] = (c) => _(c)),
825
- onClose: s[5] || (s[5] = (c) => T(c)),
821
+ A(Ie, {
822
+ id: y(f),
823
+ class: X(T.value),
824
+ onOpen: c[4] || (c[4] = (v) => V(v)),
825
+ onClose: c[5] || (c[5] = (v) => m(v)),
826
826
  "transition-duration": 50
827
- }, Ee({
828
- contentList: b(() => [
829
- h(r).mode === "filter" && !u.singleMode ? (x(), B(fe, {
827
+ }, Le({
828
+ contentList: _(() => [
829
+ y(r).mode === "filter" && !s.singleMode ? (k(), b(ye, {
830
830
  key: 0,
831
831
  id: "all",
832
832
  colorId: "",
833
- name: u.$i18n.Common.All_tags ?? "",
834
- state: h(r).model.value.length ? "" : "selected",
835
- onSelect: s[3] || (s[3] = (c) => h(r).model.value = [])
833
+ name: s.$i18n.Common.All_tags ?? "",
834
+ state: y(r).model.value.length ? "" : "selected",
835
+ onSelect: c[3] || (c[3] = (v) => y(r).model.value = [])
836
836
  }, null, 8, ["name", "state"])) : q("", !0),
837
- (x(!0), w(W, null, ie(o.value, (c) => (x(), B(fe, {
838
- key: c.id,
839
- id: c.id,
840
- colorId: c.color_id,
841
- name: c.name,
842
- state: y(c.id),
843
- canExclude: h(r).mode === "filter" && !u.singleMode,
844
- editable: u.tagsEditable,
845
- disabled: m.value && y(c.id) === "",
846
- onUnselect: (p) => C(c.id, "unselect"),
847
- onSelect: (p) => C(c.id, "select"),
848
- onExclude: (p) => C(c.id, "exclude"),
849
- "onUpdate:name": (p) => {
850
- c.name = p, h(d)("tagsChanged", o.value);
837
+ (k(!0), B(Y, null, de(a.value, (v) => (k(), b(ye, {
838
+ key: v.id,
839
+ id: v.id,
840
+ colorId: v.color_id,
841
+ name: v.name,
842
+ state: u(v.id),
843
+ canExclude: y(r).mode === "filter" && !s.singleMode,
844
+ editable: s.tagsEditable,
845
+ disabled: g.value && u(v.id) === "",
846
+ onUnselect: (I) => x(v.id, "unselect"),
847
+ onSelect: (I) => x(v.id, "select"),
848
+ onExclude: (I) => x(v.id, "exclude"),
849
+ "onUpdate:name": (I) => {
850
+ v.name = I, y(d)("tagsChanged", a.value);
851
851
  }
852
852
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
853
- u.tagsEditable && o.value.length < u.tagsMax && o.value.length < 20 ? (x(), B(se, {
853
+ s.tagsEditable && a.value.length < s.tagsMax && a.value.length < 20 ? (k(), b(ue, {
854
854
  key: 1,
855
855
  "data-top-icon": "",
856
- onClick: j(S, ["stop"])
856
+ onClick: J(C, ["stop"])
857
857
  }, {
858
- default: b(() => [
859
- z(K(u.$i18n.Common.Add), 1)
858
+ default: _(() => [
859
+ G(M(s.$i18n.Common.Add), 1)
860
860
  ]),
861
861
  _: 1
862
862
  })) : q("", !0)
863
863
  ]),
864
864
  _: 2
865
865
  }, [
866
- h(r).mode === "setter" && h(r).filters ? {
866
+ y(r).mode === "setter" && y(r).filters ? {
867
867
  name: "header",
868
- fn: b(() => [
869
- A(re, {
870
- modelValue: f.value,
871
- "onUpdate:modelValue": s[1] || (s[1] = (c) => f.value = c),
872
- options: v()
868
+ fn: _(() => [
869
+ A(se, {
870
+ modelValue: h.value,
871
+ "onUpdate:modelValue": c[1] || (c[1] = (v) => h.value = v),
872
+ options: S()
873
873
  }, null, 8, ["modelValue", "options"])
874
874
  ]),
875
875
  key: "0"
876
876
  } : void 0,
877
- h(r).mode === "setter" && h(r).filters ? {
877
+ y(r).mode === "setter" && y(r).filters ? {
878
878
  name: "footer",
879
- fn: b(() => [
880
- A(Y, { color: "theme" }, {
881
- default: b(() => [
882
- z(K(u.$i18n.Common.Cancel), 1)
879
+ fn: _(() => [
880
+ A(H, { color: "theme" }, {
881
+ default: _(() => [
882
+ G(M(s.$i18n.Common.Cancel), 1)
883
883
  ]),
884
884
  _: 1
885
885
  }),
886
- A(Y, {
887
- onClick: s[2] || (s[2] = (c) => h(d)("setter", {
888
- tagsIds: h(r).model.value,
889
- filters: h(r).filters,
890
- filtersAction: f.value,
891
- payload: h(r).payload
886
+ A(H, {
887
+ onClick: c[2] || (c[2] = (v) => y(d)("setter", {
888
+ tagsIds: y(r).model.value,
889
+ filters: y(r).filters,
890
+ filtersAction: h.value,
891
+ payload: y(r).payload
892
892
  }))
893
893
  }, {
894
- default: b(() => [
895
- z(K(f.value === "add" ? u.$i18n.Common.Add : "") + " " + K(f.value === "replace" ? u.$i18n.Common.Replace : "") + " " + K(f.value === "delete" ? u.$i18n.Common.Remove : ""), 1)
894
+ default: _(() => [
895
+ G(M(h.value === "add" ? s.$i18n.Common.Add : "") + " " + M(h.value === "replace" ? s.$i18n.Common.Replace : "") + " " + M(h.value === "delete" ? s.$i18n.Common.Remove : ""), 1)
896
896
  ]),
897
897
  _: 1
898
898
  })
@@ -902,74 +902,75 @@ const qe = { class: "top-selectorCompetitors" }, Pe = { class: "top-ellipsis1" }
902
902
  ]), 1032, ["id", "class"])
903
903
  ], 64));
904
904
  }
905
- }), ft = (e, a) => M(() => ue(e).filter((l) => l.on >= 0 || l.id === a).map((l) => ({
906
- value: l.id,
907
- title: l.url + ` [${l.id}]`,
908
- icon: l.id === ue(a) ? "" : "",
909
- content: l.name
910
- }))), vt = (e, a, i) => {
911
- a || (a = { id: e.id }), a.id = e.id;
912
- const t = Fe.genElPopupOpener("div", a);
913
- return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-button", "top-color_theme"), e.mode === "filter" && t.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && t.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && t.classList.add("top-tagSelector-setter_several"), t.onclick = (l) => {
914
- l.preventDefault(), l.stopPropagation(), t.onclick = null;
915
- const o = F(e.modelValue), n = {
916
- model: o,
917
- mode: e.mode,
918
- targetId: e.targetId,
919
- filters: e.filters,
920
- payload: e.payload
905
+ }), St = (t, o) => E(() => ge(t).filter((i) => i.on >= 0 || i.id === o).map((i) => ({
906
+ value: i.id,
907
+ title: i.url + ` [${i.id}]`,
908
+ icon: i.id === ge(o) ? "" : "",
909
+ content: i.name
910
+ }))), It = (t, o, n) => {
911
+ o || (o = { id: t.id }), o.id = t.id;
912
+ const e = Ue.genElPopupOpener("div", o);
913
+ return e.classList.add("top-tagSelector"), t.useTopButton && e.classList.add("top-button", "top-color_theme"), t.mode === "filter" && e.classList.add("top-tagSelector-filter"), t.mode === "setter" && !t.filters && e.classList.add("top-tagSelector-setter_single"), t.mode === "setter" && t.filters && e.classList.add("top-tagSelector-setter_several"), e.onclick = (i) => {
914
+ i.preventDefault(), i.stopPropagation(), e.onclick = null;
915
+ const a = F(t.modelValue), l = {
916
+ model: a,
917
+ mode: t.mode,
918
+ targetId: t.targetId,
919
+ filters: t.filters,
920
+ payload: t.payload
921
921
  };
922
- G(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, ce(e.modelValue) || L(o, () => {
923
- e.modelValue = o.value, Z(t, e, i);
924
- }), t.click();
925
- }, ce(e.modelValue) ? L(e.modelValue, () => Z(t, e, i)) : G(t, "topTagSelectorRender", (l) => {
926
- e.modelValue = l;
927
- const o = G(t, "topTagSelectorTarget");
928
- o && (o.model.value = l), Z(t, e, i);
929
- }), Z(t, e, i), t;
930
- }, yt = (e, a) => {
922
+ W(e, "topTagSelectorTarget", l), delete e.dataset.topPopupDisabled, me(t.modelValue) || w(a, () => {
923
+ t.modelValue = a.value, ee(e, t, n);
924
+ }), e.click();
925
+ }, me(t.modelValue) ? w(t.modelValue, () => ee(e, t, n)) : W(e, "topTagSelectorRender", (i) => {
926
+ t.modelValue = i;
927
+ const a = W(e, "topTagSelectorTarget");
928
+ a && (a.model.value = i), ee(e, t, n);
929
+ }), ee(e, t, n), e;
930
+ }, xt = (t, o) => {
931
+ var n;
932
+ (n = W(t, "topTagSelectorRender")) == null || n(o);
933
+ }, ee = (t, o, n) => {
931
934
  var i;
932
- (i = G(e, "topTagSelectorRender")) == null || i(a);
933
- }, Z = (e, a, i) => {
934
- var l;
935
- const t = h(a.modelValue);
936
- if (e.classList.toggle("top-tagSelector-selectedOne", !t.length || t.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", t.length > 5), a.mode === "setter" && a.filters) {
937
- e.innerHTML = `<div>${i}</div>`;
935
+ const e = y(o.modelValue);
936
+ if (t.classList.toggle("top-tagSelector-selectedOne", !e.length || e.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", e.length > 5), o.mode === "setter" && o.filters) {
937
+ t.innerHTML = `<div>${n}</div>`;
938
938
  return;
939
939
  }
940
- if (e.innerHTML = "", !t.length && a.mode === "filter") {
941
- const o = ve({
940
+ if (t.innerHTML = "", !e.length && o.mode === "filter") {
941
+ const a = pe({
942
942
  id: "all",
943
943
  colorId: "",
944
- name: ((l = R().Common) == null ? void 0 : l.All_tags) ?? "",
944
+ name: ((i = R().Common) == null ? void 0 : i.All_tags) ?? "",
945
945
  state: ""
946
946
  });
947
- e.append(o);
947
+ t.append(a);
948
948
  }
949
- t.forEach((o) => {
950
- var d, g;
951
- const n = ve({
952
- id: H(o),
953
- colorId: ((d = ae(o, a.tags)) == null ? void 0 : d.color_id) ?? "",
954
- name: ((g = ae(o, a.tags)) == null ? void 0 : g.name) ?? "",
955
- state: H(o) === o ? "selected" : "excluded"
949
+ e.forEach((a) => {
950
+ var d, f;
951
+ const l = pe({
952
+ id: Q(a),
953
+ colorId: ((d = le(a, o.tags)) == null ? void 0 : d.color_id) ?? "",
954
+ name: ((f = le(a, o.tags)) == null ? void 0 : f.name) ?? "",
955
+ state: Q(a) === a ? "selected" : "excluded"
956
956
  });
957
- e.append(n);
957
+ t.append(l);
958
958
  });
959
- }, ve = (e) => {
960
- const a = document.createElement("div");
961
- return a.classList.add("top-tagSelector_tagIcon"), a.classList.toggle("top-tagSelector-active", !!e.state), a.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), a.dataset.tag_id = e.id, a.dataset.tag_color_id = e.colorId, a.title = e.name, a;
962
- }, pt = Ue, ht = et, St = nt, It = ke, xt = le;
959
+ }, pe = (t) => {
960
+ const o = document.createElement("div");
961
+ return o.classList.add("top-tagSelector_tagIcon"), o.classList.toggle("top-tagSelector-active", !!t.state), o.classList.toggle("top-tagSelector-excluded", t.state === "excluded"), o.dataset.tag_id = t.id, o.dataset.tag_color_id = t.colorId, o.title = t.name, o;
962
+ }, kt = ze, Ct = lt, Tt = dt, _t = Te, bt = ne;
963
963
  export {
964
- pt as TopSelectorCompetitors,
965
- ht as TopSelectorRegion,
966
- St as TopTagSelector,
967
- It as TopTagSelectorPopupOpener,
968
- xt as TopTagSelectorTagIcon,
969
- Ye as findRegion,
970
- vt as genElTopTagSelectorPopupOpener,
971
- Ie as genSearcherByKey,
972
- yt as renderElTopTagSelectorPopupOpener,
973
- ft as useItemsFromCompetitors
964
+ kt as TopSelectorCompetitors,
965
+ Ct as TopSelectorRegion,
966
+ Tt as TopTagSelector,
967
+ _t as TopTagSelectorPopupOpener,
968
+ bt as TopTagSelectorTagIcon,
969
+ Ze as dialogSelectorRegions,
970
+ Xe as findRegion,
971
+ It as genElTopTagSelectorPopupOpener,
972
+ ke as genSearcherByKey,
973
+ xt as renderElTopTagSelectorPopupOpener,
974
+ St as useItemsFromCompetitors
974
975
  };
975
976
  //# sourceMappingURL=project.js.map