@topvisor/ui 1.4.0-TopGroupSelector.7 → 1.4.0-TopGroupSelector.9

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 (96) hide show
  1. package/.chunks/{core-DVQVVUiP.es.js → core-BL-38XF7.es.js} +4 -4
  2. package/.chunks/{core-DVQVVUiP.es.js.map → core-BL-38XF7.es.js.map} +1 -1
  3. package/.chunks/{core-B9TwJi3h.amd.js → core-BsPx05H9.amd.js} +2 -2
  4. package/.chunks/{core-B9TwJi3h.amd.js.map → core-BsPx05H9.amd.js.map} +1 -1
  5. package/.chunks/{datepicker-bidhcksv.amd.js → datepicker-3coUsFW2.amd.js} +2 -2
  6. package/.chunks/{datepicker-bidhcksv.amd.js.map → datepicker-3coUsFW2.amd.js.map} +1 -1
  7. package/.chunks/{datepicker-CrASsJeF.es.js → datepicker-D1Hw3a3o.es.js} +2 -2
  8. package/.chunks/{datepicker-CrASsJeF.es.js.map → datepicker-D1Hw3a3o.es.js.map} +1 -1
  9. package/.chunks/{dialog_regionSelectorRegions-DJu5Y1WK.es.js → dialog_regionSelectorRegions-1UVhgK2f.es.js} +4 -4
  10. package/.chunks/{dialog_regionSelectorRegions-DJu5Y1WK.es.js.map → dialog_regionSelectorRegions-1UVhgK2f.es.js.map} +1 -1
  11. package/.chunks/{dialog_regionSelectorRegions-Dc-YGZ0l.amd.js → dialog_regionSelectorRegions-CZ8IX7la.amd.js} +2 -2
  12. package/.chunks/{dialog_regionSelectorRegions-Dc-YGZ0l.amd.js.map → dialog_regionSelectorRegions-CZ8IX7la.amd.js.map} +1 -1
  13. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js} +2 -2
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js.map} +1 -1
  15. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js → dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js} +2 -2
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js.map} +1 -1
  17. package/.chunks/{forms-Cwv0JCi5.es.js → forms-BseC3Ftz.es.js} +5 -5
  18. package/.chunks/{forms-Cwv0JCi5.es.js.map → forms-BseC3Ftz.es.js.map} +1 -1
  19. package/.chunks/{forms--2-YQeWM.amd.js → forms-CUSCBQu3.amd.js} +3 -3
  20. package/.chunks/{forms--2-YQeWM.amd.js.map → forms-CUSCBQu3.amd.js.map} +1 -1
  21. package/.chunks/{notice-BCHrf2v6.es.js → notice-Cl3ZgiHm.es.js} +2 -2
  22. package/.chunks/{notice-BCHrf2v6.es.js.map → notice-Cl3ZgiHm.es.js.map} +1 -1
  23. package/.chunks/{notice-D1KO_E3H.amd.js → notice-DwjipV21.amd.js} +2 -2
  24. package/.chunks/{notice-D1KO_E3H.amd.js.map → notice-DwjipV21.amd.js.map} +1 -1
  25. package/.chunks/{page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js → page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js} +2 -2
  26. package/.chunks/{page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js.map → page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js.map} +1 -1
  27. package/.chunks/{page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js → page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js} +4 -4
  28. package/.chunks/{page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js.map → page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js.map} +1 -1
  29. package/.chunks/{policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js → policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js} +4 -4
  30. package/.chunks/{policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js.map → policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js.map} +1 -1
  31. package/.chunks/{policy.vue_vue_type_style_index_0_lang-BfL6Mj6K.amd.js → policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js} +2 -2
  32. package/.chunks/{policy.vue_vue_type_style_index_0_lang-BfL6Mj6K.amd.js.map → policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js.map} +1 -1
  33. package/.chunks/{popup-c8qgGOCv.amd.js → popup-DRuyYFGB.amd.js} +2 -2
  34. package/.chunks/popup-DRuyYFGB.amd.js.map +1 -0
  35. package/.chunks/{popup-DJMBWRtl.es.js → popup-Jw_Yyg3U.es.js} +99 -97
  36. package/.chunks/popup-Jw_Yyg3U.es.js.map +1 -0
  37. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js → popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js} +2 -2
  38. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js.map → popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js.map} +1 -1
  39. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js → popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js} +2 -2
  40. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js.map → popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js.map} +1 -1
  41. package/.chunks/{utils-C6nWu0aQ.amd.js → utils-CzHUG_xz.amd.js} +2 -2
  42. package/.chunks/{utils-C6nWu0aQ.amd.js.map → utils-CzHUG_xz.amd.js.map} +1 -1
  43. package/.chunks/{utils-DHyy_M2n.amd.js → utils-D9nYQabE.amd.js} +2 -2
  44. package/.chunks/{utils-DHyy_M2n.amd.js.map → utils-D9nYQabE.amd.js.map} +1 -1
  45. package/.chunks/{utils-Bu-TI6uw.es.js → utils-Q69SXlnV.es.js} +3 -3
  46. package/.chunks/{utils-Bu-TI6uw.es.js.map → utils-Q69SXlnV.es.js.map} +1 -1
  47. package/.chunks/{utils-cls72V1c.es.js → utils-YrUExsH7.es.js} +2 -2
  48. package/.chunks/{utils-cls72V1c.es.js.map → utils-YrUExsH7.es.js.map} +1 -1
  49. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js} +2 -2
  50. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js.map} +1 -1
  51. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js} +2 -2
  52. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js.map} +1 -1
  53. package/charts/charts.amd.js +1 -1
  54. package/charts/charts.js +1 -1
  55. package/core/app.amd.js +1 -1
  56. package/core/app.js +5 -5
  57. package/dialog/dialog.amd.js +1 -1
  58. package/dialog/dialog.js +2 -2
  59. package/forms/forms.amd.js +1 -1
  60. package/forms/forms.js +1 -1
  61. package/formsExt/formsExt.amd.js +1 -1
  62. package/formsExt/formsExt.js +2 -2
  63. package/layout/layout.amd.js +1 -1
  64. package/layout/layout.js +1 -1
  65. package/package.json +1 -1
  66. package/popup/popup.amd.js +1 -1
  67. package/popup/popup.js +4 -4
  68. package/popup/worker.amd.js +1 -1
  69. package/popup/worker.js +2 -2
  70. package/project/project.amd.js +1 -1
  71. package/project/project.amd.js.map +1 -1
  72. package/project/project.js +367 -353
  73. package/project/project.js.map +1 -1
  74. package/src/components/popup/lib/popup.d.ts +1 -1
  75. package/src/components/project/groupSelector/groups/groups.vue.d.ts +1 -0
  76. package/src/components/project/groupSelector/groups/types.d.ts +1 -0
  77. package/src/components/project/groupSelector/groups/utils.d.ts +1 -1
  78. package/src/components/project/groupSelector/types.d.ts +2 -2
  79. package/tabsView/tabsView.amd.js +1 -1
  80. package/tabsView/tabsView.js +2 -2
  81. package/utils/clipboard.amd.js +1 -1
  82. package/utils/clipboard.js +1 -1
  83. package/utils/date.amd.js +1 -1
  84. package/utils/date.js +1 -1
  85. package/utils/device.amd.js +1 -1
  86. package/utils/device.js +1 -1
  87. package/utils/lodash.amd.js +1 -1
  88. package/utils/lodash.js +1 -1
  89. package/utils/price.amd.js +1 -1
  90. package/utils/price.js +1 -1
  91. package/utils/searchers.amd.js +1 -1
  92. package/utils/searchers.js +3 -3
  93. package/utils/string.amd.js +1 -1
  94. package/utils/string.js +1 -1
  95. package/.chunks/popup-DJMBWRtl.es.js.map +0 -1
  96. package/.chunks/popup-c8qgGOCv.amd.js.map +0 -1
@@ -3,18 +3,18 @@
3
3
  const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
4
4
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
5
5
 
6
- import { defineComponent as L, mergeModels as M, useModel as A, computed as E, createElementBlock as b, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as fe, normalizeClass as X, createElementVNode as oe, toDisplayString as V, createVNode as R, createTextVNode as z, toValue as ve, ref as G, watch as T, createCommentVNode as O, reactive as Te, isRef as pe, withModifiers as F, mergeProps as Ae, withKeys as ye, nextTick as Re, resolveDirective as Ne, withDirectives as Pe, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Ue, createSlots as Fe } from "vue";
7
- import { u as w, C as _, e as H, p as se, d as _e } from "../.chunks/forms-Cwv0JCi5.es.js";
8
- import { _ as be, b as me, a as ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js";
9
- import { a as Je, _ as Ve, b as Me, c as we, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js";
10
- import { u as We } from "../.chunks/utils-cls72V1c.es.js";
11
- import { getSearcherGIcon as Ye, getLangLabel as He, getDeviceGIcon as Qe } from "../utils/searchers.js";
12
- import "../.chunks/core-DVQVVUiP.es.js";
13
- import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js";
14
- import { g as Xe } from "../.chunks/field-CyyFzM-Y.es.js";
6
+ import { defineComponent as R, mergeModels as M, useModel as T, computed as E, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as me, normalizeClass as X, createElementVNode as oe, toDisplayString as b, createVNode as N, createTextVNode as z, toValue as ye, ref as G, watch as V, createCommentVNode as L, reactive as be, isRef as he, withModifiers as U, mergeProps as Ve, withKeys as Ie, nextTick as Ne, resolveDirective as Pe, withDirectives as De, resolveDynamicComponent as Fe, renderSlot as qe, shallowRef as Ue, createSlots as _e } from "vue";
7
+ import { u as w, C as _, e as Q, p as se, d as ze } from "../.chunks/forms-BseC3Ftz.es.js";
8
+ import { _ as Me, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js";
9
+ import { a as We, _ as we, b as Ee, c as $e, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js";
10
+ import { u as Ye } from "../.chunks/utils-YrUExsH7.es.js";
11
+ import { getSearcherGIcon as Qe, getLangLabel as He, getDeviceGIcon as Xe } from "../utils/searchers.js";
12
+ import "../.chunks/core-BL-38XF7.es.js";
13
+ import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js";
14
+ import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
15
15
  import { storage as J } from "../utils/dom.js";
16
16
  import { TopPopupWorker as Ze } from "../popup/worker.js";
17
- const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" }, Nt = /* @__PURE__ */ L({
17
+ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" }, Nt = /* @__PURE__ */ R({
18
18
  __name: "competitorSelector",
19
19
  props: /* @__PURE__ */ M({
20
20
  modelValue: {},
@@ -26,7 +26,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
26
26
  }),
27
27
  emits: ["update:modelValue"],
28
28
  setup(e) {
29
- const a = e, o = A(e, "modelValue"), t = E(() => {
29
+ const a = e, o = T(e, "modelValue"), t = E(() => {
30
30
  if (a.showSelectAllItem)
31
31
  return {
32
32
  icon: "",
@@ -35,23 +35,23 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
35
35
  content: ""
36
36
  };
37
37
  });
38
- return (r, l) => (h(), b("div", et, [
39
- v(_).state.isMobile ? (h(), C(be, { key: 0 }, {
38
+ return (r, l) => (h(), A("div", et, [
39
+ v(_).state.isMobile ? (h(), C(Me, { key: 0 }, {
40
40
  opener: B(() => [
41
- R(H, {
41
+ N(Q, {
42
42
  class: "top-competitorSelector_opener",
43
43
  color: "theme",
44
44
  icon: "",
45
45
  icon2: ""
46
46
  }, {
47
47
  default: B(() => [
48
- z(V(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
48
+ z(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
49
49
  ]),
50
50
  _: 1
51
51
  })
52
52
  ]),
53
53
  contentList: B(() => [
54
- (h(!0), b(Y, null, fe(e.items, (n) => (h(), C(me, {
54
+ (h(!0), A(Y, null, me(e.items, (n) => (h(), C(ve, {
55
55
  class: X({
56
56
  "top-active": o.value?.includes(n.value)
57
57
  }),
@@ -60,13 +60,13 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
60
60
  onClick: () => o.value = [n.value]
61
61
  }, {
62
62
  default: B(() => [
63
- oe("span", tt, V(n.content), 1)
63
+ oe("span", tt, b(n.content), 1)
64
64
  ]),
65
65
  _: 2
66
66
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
67
67
  ]),
68
68
  _: 1
69
- })) : (h(), C(Je, {
69
+ })) : (h(), C(We, {
70
70
  key: 1,
71
71
  modelValue: o.value,
72
72
  "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
@@ -78,10 +78,10 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
78
78
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
79
79
  ]));
80
80
  }
81
- }), Pt = (e, a) => E(() => ve(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
81
+ }), Pt = (e, a) => E(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
82
82
  value: r.id,
83
83
  title: r.url + ` [${r.id}]`,
84
- icon: r.id === ve(a) ? "" : "",
84
+ icon: r.id === ye(a) ? "" : "",
85
85
  content: r.name
86
86
  }))), j = -1, y = -2, le = -1, ot = {
87
87
  0: "Yandex",
@@ -93,15 +93,15 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
93
93
  9: "GoogleStore",
94
94
  20: "Yandex.com",
95
95
  21: "Yandex.com.tr"
96
- }, he = {
96
+ }, xe = {
97
97
  key: y,
98
98
  name: "--",
99
99
  index: y
100
- }, $e = {
100
+ }, Ge = {
101
101
  key: y,
102
102
  name: "--",
103
- regions: [he],
104
- regionByIndex: /* @__PURE__ */ new Map([[y, he]])
103
+ regions: [xe],
104
+ regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
105
105
  }, ae = {
106
106
  key: y,
107
107
  name: "Autoselect",
@@ -111,7 +111,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
111
111
  name: "Autoselect",
112
112
  regions: [ae],
113
113
  regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
114
- }, Ie = {
114
+ }, ke = {
115
115
  countryCode: "00",
116
116
  depth: 1,
117
117
  device: 0,
@@ -119,18 +119,18 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
119
119
  index: le,
120
120
  lang: "ru",
121
121
  name: "Without region"
122
- }, lt = () => (ae.name = w().Common.Autoselect, ae), at = () => (lt(), ue.name = w().Common.Autoselect, console.log(ue), ue), nt = () => (Ie.name = w().Keywords.Without_region, Ie), Ee = (e = !1, a = !1, o = []) => {
122
+ }, lt = () => (ae.name = w().Common.Autoselect, ae), at = () => (lt(), ue.name = w().Common.Autoselect, console.log(ue), ue), nt = () => (ke.name = w().Keywords.Without_region, ke), Ke = (e = !1, a = !1, o = []) => {
123
123
  let t;
124
- return e ? t = rt(o) : t = Ge(o), a && t.set(y, at()), t.size || t.set(y, $e), t;
125
- }, Ge = (e, a = !0, o = [], t = !1) => {
124
+ return e ? t = rt(o) : t = Oe(o), a && t.set(y, at()), t.size || t.set(y, Ge), t;
125
+ }, Oe = (e, a = !0, o = [], t = !1) => {
126
126
  const r = /* @__PURE__ */ new Map();
127
127
  return e.forEach((l) => {
128
128
  if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
129
129
  const n = { ...l };
130
- n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((d) => {
131
- if (a && !d.enabled) return;
132
- const c = { ...d };
133
- n.regionByIndex.set(c.index, c);
130
+ n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((u) => {
131
+ if (a && !u.enabled) return;
132
+ const f = { ...u };
133
+ n.regionByIndex.set(f.index, f);
134
134
  }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
135
135
  (!l.regions || // есть включенные регионы
136
136
  n.regionByIndex.size || // запрошен вывод конкретных ПС
@@ -146,7 +146,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
146
146
  r.set(n.key, n);
147
147
  }), r;
148
148
  }, rt = (e) => {
149
- const a = Ge(e, !1, [0, 1], !0);
149
+ const a = Oe(e, !1, [0, 1], !0);
150
150
  if (a.has(2)) {
151
151
  const o = a.get(2);
152
152
  o && (o.regionByIndex = /* @__PURE__ */ new Map());
@@ -157,7 +157,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
157
157
  o.regionByIndex.set(t.index, t);
158
158
  }), a;
159
159
  }, it = (e, a, o = []) => {
160
- const t = Ee(e, !1, o);
160
+ const t = Ke(e, !1, o);
161
161
  let r;
162
162
  return t.forEach((l) => {
163
163
  if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
@@ -166,15 +166,15 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
166
166
  }), r))
167
167
  return !1;
168
168
  }), r;
169
- }, dt = We(() => import("../.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js")), ut = (e, a) => {
169
+ }, dt = Ye(() => import("../.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js")), ut = (e, a) => {
170
170
  const o = w(), t = G(a.value.keys().next().value ?? y), r = E(() => {
171
171
  const l = /* @__PURE__ */ new Map();
172
172
  if (a.value.forEach((n) => {
173
- let d = {
173
+ let u = {
174
174
  value: n.key,
175
175
  title: n.name
176
176
  };
177
- e.addSearcherIcon && (d.icon = Ye(n.key)), l.set(n.key, d);
177
+ e.addSearcherIcon && (u.icon = Qe(n.key)), l.set(n.key, u);
178
178
  }), e.addCompare && !l.has(y)) {
179
179
  const n = {
180
180
  value: "",
@@ -182,11 +182,11 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
182
182
  disabled: !0
183
183
  };
184
184
  l.set(n.value, n);
185
- const d = {
185
+ const u = {
186
186
  value: j,
187
187
  title: o.Common.Compare
188
188
  };
189
- l.set(d.value, d);
189
+ l.set(u.value, u);
190
190
  }
191
191
  return l;
192
192
  });
@@ -200,48 +200,48 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
200
200
  const r = E(() => {
201
201
  const l = /* @__PURE__ */ new Map();
202
202
  return a.value.regionByIndex?.forEach((n) => {
203
- let d = n.name;
203
+ let u = n.name;
204
204
  if (e.forFrequency) {
205
- const I = {
205
+ const x = {
206
206
  value: n.key,
207
- title: d
207
+ title: u
208
208
  };
209
- l.has(n.key) || l.set(n.key, I);
209
+ l.has(n.key) || l.set(n.key, x);
210
210
  return;
211
211
  }
212
- n.device && (d += " (" + o.Common["Device_" + n.device] + ")");
213
- const c = He(a.value.key || 0, n.lang ?? "");
214
- c && (d += " / " + c);
215
- const f = {
212
+ n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
213
+ const f = He(a.value.key || 0, n.lang ?? "");
214
+ f && (u += " / " + f);
215
+ const c = {
216
216
  value: n.index,
217
- title: d,
218
- icon: n.device ? Qe(n.device) : void 0
217
+ title: u,
218
+ icon: n.device ? Xe(n.device) : void 0
219
219
  };
220
- l.set(n.index, f);
220
+ l.set(n.index, c);
221
221
  }), l;
222
222
  });
223
- return T(r, (l, n) => {
223
+ return V(r, (l, n) => {
224
224
  if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
225
225
  return;
226
- let d = l.keys().next().value;
227
- if (t.value === y || d === y) {
228
- t.value = d;
226
+ let u = l.keys().next().value;
227
+ if (t.value === y || u === y) {
228
+ t.value = u;
229
229
  return;
230
230
  }
231
- let c = n?.get(t.value)?.title || "", f = -1;
232
- for (const [I, i] of l.entries()) {
231
+ let f = n?.get(t.value)?.title || "", c = -1;
232
+ for (const [x, i] of l.entries()) {
233
233
  const m = i.title;
234
- if (typeof m != "string" || typeof I == "string")
234
+ if (typeof m != "string" || typeof x == "string")
235
235
  break;
236
- if (m === c) {
237
- d = I;
236
+ if (m === f) {
237
+ u = x;
238
238
  break;
239
239
  }
240
- const u = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
241
- let s = c, g = 3;
242
- m.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(u, ""), g--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), g--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(u, ""), g--), m.indexOf(s) !== -1 && (g <= f || (f = g, d = I));
240
+ const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
241
+ let s = f, g = 3;
242
+ m.indexOf(s) === -1 && (s = f.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) !== -1 && (g <= c || (c = g, u = x));
243
243
  }
244
- t.value = d;
244
+ t.value = u;
245
245
  }), {
246
246
  regionIndex: t,
247
247
  optionByRegionIndex: r
@@ -262,25 +262,25 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
262
262
  ) ?? [];
263
263
  } catch {
264
264
  }
265
- n.length && (n = n.filter((d) => o.value.has(d))), n.length || (n = Array.from(o.value)), t.value = [...n];
265
+ n.length && (n = n.filter((u) => o.value.has(u))), n.length || (n = Array.from(o.value)), t.value = [...n];
266
266
  }, l = () => {
267
267
  t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
268
268
  };
269
- return T(t, () => {
269
+ return V(t, () => {
270
270
  l();
271
271
  }), e.addCompare && r(), {
272
272
  regionsIndexes: t
273
273
  };
274
274
  }, gt = (e) => {
275
- const a = E(() => Ee(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => a.value.get(r.searcherKey.value) || $e), t = E(() => {
275
+ const a = E(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => a.value.get(r.searcherKey.value) || Ge), t = E(() => {
276
276
  const i = /* @__PURE__ */ new Set();
277
277
  return a.value.forEach((m) => {
278
- m.regionByIndex.forEach((u) => {
279
- u.index !== le && u.index !== y && i.add(u.index);
278
+ m.regionByIndex.forEach((d) => {
279
+ d.index !== le && d.index !== y && i.add(d.index);
280
280
  });
281
281
  }), i;
282
282
  }), r = ut(e, a), l = st(e, o), n = ct(e, a, t);
283
- T(a, () => {
283
+ V(a, () => {
284
284
  if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === j) return;
285
285
  let i = a.value.keys().next().value;
286
286
  a.value.forEach((m) => {
@@ -289,26 +289,26 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
289
289
  return;
290
290
  }
291
291
  if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
292
- let u;
293
- i !== void 0 && (u = a.value.get(i)?.regionByIndex);
292
+ let d;
293
+ i !== void 0 && (d = a.value.get(i)?.regionByIndex);
294
294
  const s = a.value.get(m.key)?.regionByIndex;
295
- u?.has(y) && !s?.has(y) && (i = m.key);
295
+ d?.has(y) && !s?.has(y) && (i = m.key);
296
296
  }
297
297
  }), i !== void 0 && (r.searcherKey.value = i), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
298
298
  }, { immediate: !0 });
299
- const d = () => {
299
+ const u = () => {
300
300
  if (!(r.searcherKey.value === j || r.searcherKey.value === y))
301
301
  return r.searcherKey.value;
302
- }, c = () => {
302
+ }, f = () => {
303
303
  if (e.onlySearcher || l.regionIndex.value === y) return;
304
304
  let i = l.regionIndex.value;
305
305
  if (e.forFrequency) {
306
306
  const m = l.regionIndex.value;
307
- i = it(e.forFrequency, { searcher_key: d(), key: m }, e.searchers)?.index;
307
+ i = it(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
308
308
  }
309
309
  return i;
310
- }, f = () => {
311
- const i = d();
310
+ }, c = () => {
311
+ const i = u();
312
312
  if (i !== void 0)
313
313
  return a.value.get(i);
314
314
  };
@@ -318,14 +318,14 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
318
318
  compare: n,
319
319
  searcherByKey: a,
320
320
  allRegionsIndexes: t,
321
- getSearcher: f,
321
+ getSearcher: c,
322
322
  getRegion: () => {
323
- const i = c();
323
+ const i = f();
324
324
  if (i !== void 0)
325
- return f()?.regionByIndex?.get(i);
325
+ return c()?.regionByIndex?.get(i);
326
326
  }
327
327
  };
328
- }, Dt = /* @__PURE__ */ L({
328
+ }, Dt = /* @__PURE__ */ R({
329
329
  __name: "regionSelector",
330
330
  props: /* @__PURE__ */ M({
331
331
  projectId: {},
@@ -347,62 +347,62 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
347
347
  }),
348
348
  emits: ["update:modelValue", "update:modelValueSingle"],
349
349
  setup(e, { expose: a }) {
350
- const o = e, t = A(e, "modelValue"), r = A(e, "modelValueSingle"), {
350
+ const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
351
351
  selectSearcher: l,
352
352
  selectRegion: n,
353
- compare: d,
354
- searcherByKey: c,
355
- allRegionsIndexes: f,
356
- getSearcher: I,
353
+ compare: u,
354
+ searcherByKey: f,
355
+ allRegionsIndexes: c,
356
+ getSearcher: x,
357
357
  getRegion: i
358
358
  } = gt(o), m = () => {
359
- const u = [];
360
- c.value.forEach((s) => {
359
+ const d = [];
360
+ f.value.forEach((s) => {
361
361
  s.enabled && s.regions.forEach((g) => {
362
- g.enabled && u.push(g);
362
+ g.enabled && d.push(g);
363
363
  });
364
364
  }), dt.open("regions", {
365
- regions: u,
366
- regionsIndexes: d.regionsIndexes.value,
367
- "@update:regionsIndexes": (s) => d.regionsIndexes.value = s
365
+ regions: d,
366
+ regionsIndexes: u.regionsIndexes.value,
367
+ "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
368
368
  });
369
369
  };
370
- return T([n.regionIndex, l.searcherKey, d.regionsIndexes], () => {
371
- if (l.searcherKey.value === j && d.regionsIndexes.value.length) {
372
- if (JSON.stringify(t.value) === JSON.stringify(d.regionsIndexes.value))
370
+ return V([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
371
+ if (l.searcherKey.value === j && u.regionsIndexes.value.length) {
372
+ if (JSON.stringify(t.value) === JSON.stringify(u.regionsIndexes.value))
373
373
  return;
374
- t.value = [...d.regionsIndexes.value];
374
+ t.value = [...u.regionsIndexes.value];
375
375
  } else
376
376
  o.onlySearcher ? (t.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (t.value.length = 0)) : (t.value = [n.regionIndex.value], n.regionIndex.value === y && !o.autoRegion && (t.value.length = 0));
377
- !o.onlySearcher && !f.value.size && (l.searcherKey.value = y);
378
- }), r.value && T(r, () => {
377
+ !o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
378
+ }), r.value && V(r, () => {
379
379
  r.value && (t.value = [r.value]);
380
- }, { immediate: !0 }), T(t, () => {
380
+ }, { immediate: !0 }), V(t, () => {
381
381
  if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
382
- if (!t.value.length || t.value.length === 1 && !c.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
383
- let u = c.value.keys().next().value;
384
- u === y && !o.autoRegion && (u = void 0, r.value = y), u !== void 0 ? t.value = [u] : t.value.length = 0;
382
+ if (!t.value.length || t.value.length === 1 && !f.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
383
+ let d = f.value.keys().next().value;
384
+ d === y && !o.autoRegion && (d = void 0, r.value = y), d !== void 0 ? t.value = [d] : t.value.length = 0;
385
385
  return;
386
386
  }
387
- if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(d.regionsIndexes.value)) {
388
- t.value = [...d.regionsIndexes.value];
387
+ if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
388
+ t.value = [...u.regionsIndexes.value];
389
389
  return;
390
390
  }
391
391
  } else {
392
- let u = [...new Set(t.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
393
- if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !u.length)
394
- s !== void 0 && u.push(s);
395
- else if (u.length === 1) {
396
- let g = f.value;
397
- o.forFrequency && (g = /* @__PURE__ */ new Set(), c.value.forEach((Z) => {
392
+ let d = [...new Set(t.value)], s = f.value.values().next().value?.regionByIndex?.keys().next().value;
393
+ if (o.forFrequency && (s = f.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !d.length)
394
+ s !== void 0 && d.push(s);
395
+ else if (d.length === 1) {
396
+ let g = c.value;
397
+ o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
398
398
  Z.regionByIndex.forEach((P) => {
399
399
  P.index !== le && P.index !== y && g.add(P.key);
400
400
  });
401
- })), g.has(u[0]) || (u = [], s !== void 0 && u.push(s));
401
+ })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
402
402
  } else
403
- u = u.filter((g) => f.value.has(g)), !u.length && s !== void 0 && u.push(s);
404
- if (JSON.stringify(t.value) !== JSON.stringify(u)) {
405
- t.value = u;
403
+ d = d.filter((g) => c.value.has(g)), !d.length && s !== void 0 && d.push(s);
404
+ if (JSON.stringify(t.value) !== JSON.stringify(d)) {
405
+ t.value = d;
406
406
  return;
407
407
  }
408
408
  }
@@ -419,30 +419,30 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
419
419
  return;
420
420
  if (t.value.length === 1 && l.searcherKey.value !== j) {
421
421
  n.regionIndex.value = t.value[0];
422
- let u;
423
- for (const s of c.value.values()) {
422
+ let d;
423
+ for (const s of f.value.values()) {
424
424
  for (const g of s.regionByIndex.values())
425
425
  if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
426
- u = s.key;
426
+ d = s.key;
427
427
  break;
428
428
  }
429
- if (u !== void 0)
429
+ if (d !== void 0)
430
430
  break;
431
431
  }
432
- u !== void 0 && (l.searcherKey.value = u);
432
+ d !== void 0 && (l.searcherKey.value = d);
433
433
  } else
434
- l.searcherKey.value = j, d.regionsIndexes.value = [...t.value];
434
+ l.searcherKey.value = j, u.regionsIndexes.value = [...t.value];
435
435
  }
436
436
  }, { immediate: !0 }), a({
437
- getSearcher: I,
437
+ getSearcher: x,
438
438
  getRegion: i
439
- }), (u, s) => (h(), b("div", {
439
+ }), (d, s) => (h(), A("div", {
440
440
  class: X({
441
441
  "top-selectorRegion": !0,
442
442
  "top-selectorRegion-onlySearcher": e.onlySearcher
443
443
  })
444
444
  }, [
445
- R(se, {
445
+ N(se, {
446
446
  options: v(l).optionBySearcherKey.value,
447
447
  modelValue: v(l).searcherKey.value,
448
448
  "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
@@ -458,36 +458,52 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
458
458
  name: e.forFrequency ? "region_key" : "region_index",
459
459
  addChanger: e.addChanger,
460
460
  "data-top-icon": e.addRegionIcon ? "" : void 0
461
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
462
- e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(j) ? (h(), C(H, {
461
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : L("", !0),
462
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(j) ? (h(), C(Q, {
463
463
  key: 1,
464
464
  name: "compare",
465
465
  onClick: m,
466
- "data-count-compare-regions-indexes": v(d).regionsIndexes.value.length
466
+ "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
467
467
  }, {
468
468
  default: B(() => [
469
- z(V(u.$i18n.Common.Selected_regions), 1)
469
+ z(b(d.$i18n.Common.Selected_regions), 1)
470
470
  ]),
471
471
  _: 1
472
- }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
472
+ }, 8, ["data-count-compare-regions-indexes"])) : L("", !0)
473
473
  ], 2));
474
474
  }
475
- }), N = {
475
+ }), O = {
476
476
  id: 0,
477
477
  name: "/",
478
478
  path: "/"
479
479
  }, ft = (e, a) => {
480
- let o = e?.root[0] ?? N;
481
- return o = { ...o }, o.name = Ke(a), o;
480
+ let o = e?.root[0] ?? O;
481
+ return o = { ...o }, o.name = Le(a), o;
482
482
  };
483
- function Ke(e) {
483
+ function Le(e) {
484
484
  return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
485
485
  }
486
- const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (t.childsIds = [], t.id && (t.countAllGroupsActive = t.count_groups_active), e[t.id] && e[t.id].forEach((l) => {
487
- l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = Ke(a));
486
+ const pe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (t.childsIds = [], t.id && (t.countAllGroupsActive = t.count_groups_active), e[t.id] && e[t.id].forEach((l) => {
487
+ l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = Le(a));
488
488
  const n = r > 1 ? "-".repeat(r - 1) + " " : "";
489
- n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), Oe(e, a, o, l, r + 1), t.childsIds = t.childsIds.concat(l.childsIds), t.id && l.count_groups_active && (t.countAllGroupsActive += l.count_groups_active);
490
- }), o), mt = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 }), vt = /* @__PURE__ */ L({
489
+ n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), pe(e, a, o, l, r + 1), t.childsIds = t.childsIds.concat(l.childsIds), t.id && l.count_groups_active && (t.countAllGroupsActive += l.count_groups_active);
490
+ }), o), mt = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
491
+ function ce(e, a, o) {
492
+ const t = Object.keys(e), r = t.map((l) => e[l]);
493
+ return V(r, (l, n, u) => {
494
+ const f = {};
495
+ l.forEach((c, x) => {
496
+ if (!Object.is(c, n[x])) {
497
+ const i = t[x];
498
+ f[i] = {
499
+ old: n[x],
500
+ new: c
501
+ };
502
+ }
503
+ }), Object.keys(f).length && a(f, u);
504
+ }, o);
505
+ }
506
+ const vt = /* @__PURE__ */ R({
491
507
  __name: "folders",
492
508
  props: /* @__PURE__ */ M({
493
509
  folderId: {},
@@ -501,73 +517,68 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
501
517
  }, {
502
518
  folderId: { required: !0 },
503
519
  folderIdModifiers: {},
504
- folder: { default: N },
520
+ folder: { default: O },
505
521
  folderModifiers: {}
506
522
  }),
507
523
  emits: ["update:folderId", "update:folder"],
508
524
  setup(e) {
509
- const a = e, o = A(e, "folderId"), t = A(e, "folder"), r = a.client && !a.folders ? mt(a.client) : void 0, l = G(null);
510
- T(() => a.projectId, () => {
525
+ const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? mt(a.client) : void 0, l = G(null);
526
+ V(() => a.projectId, () => {
511
527
  r?.changeParams({
512
528
  project_id: a.projectId
513
529
  }), r?.setOptions({
514
530
  checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
515
531
  }), l.value?.resetCache();
516
532
  }, { immediate: !0 });
517
- const n = E(() => Oe(a.folders ?? { root: [N] }, a.canSelectAll));
518
- return T(o, () => {
519
- a.folders && (n.value.get(a.folderId) || (o.value = 0));
520
- }, { immediate: !0 }), T(o, () => {
521
- const d = n.value.get(a.folderId);
522
- d && (t.value = d);
523
- }), T(t, () => {
533
+ const n = E(() => pe(a.folders ?? { root: [O] }, a.canSelectAll));
534
+ return ce({
535
+ modelFolder: t,
536
+ modelFolderId: o
537
+ }, async (u) => {
538
+ if (o.value === t.value.id)
539
+ return;
540
+ if (u.modelFolder && !u.modelFolderId) {
541
+ o.value = t.value.id;
542
+ return;
543
+ }
544
+ if (u.modelFolderId) {
545
+ const c = n.value.get(a.folderId);
546
+ c && (t.value = c, t.value = c);
547
+ }
548
+ let f = n.value.get(a.folderId);
549
+ f || (f = O), t.value = f, o.value = f.id;
550
+ }, { immediate: !0 }), V(t, () => {
524
551
  o.value = t.value.id;
525
- }), (d, c) => (h(), C(Ve, {
552
+ }), (u, f) => (h(), C(we, {
526
553
  class: "top-groupSelector_folder",
527
554
  modelValue: t.value,
528
- "onUpdate:modelValue": c[0] || (c[0] = (f) => t.value = f),
555
+ "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
529
556
  items: e.folders ? [...n.value.values()] : void 0,
530
557
  "search-type": "inline",
531
558
  icon: e.addIcon ? "" : void 0,
532
559
  api: e.folders ? void 0 : v(r),
533
- apiSetSearchParams: (...f) => v(Me)(...f, "name"),
560
+ apiSetSearchParams: (...c) => v(Ee)(...c, "name"),
534
561
  addChanger: e.addChanger,
535
562
  useCache: ""
536
563
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
537
564
  }
538
- });
539
- function Se(e, a, o) {
540
- const t = Object.keys(e), r = t.map((l) => e[l]);
541
- return T(r, (l, n, d) => {
542
- const c = {};
543
- l.forEach((f, I) => {
544
- if (!Object.is(f, n[I])) {
545
- const i = t[I];
546
- c[i] = {
547
- old: n[I],
548
- new: f
549
- };
550
- }
551
- }), Object.keys(c).length && a(c, d);
552
- }, o);
553
- }
554
- const ce = {
565
+ }), ge = {
555
566
  id: -1,
556
567
  name: "--",
557
- folder_id: N.id,
558
- folder_path: N.path
568
+ folder_id: O.id,
569
+ folder_path: O.path
559
570
  }, ne = {
560
- id: we,
571
+ id: $e,
561
572
  name: "All groups",
562
- folder_id: N.id,
563
- folder_path: N.path
564
- }, W = () => (ne.name = w()?.Common.All_groups, ne), je = () => (ne.name = w()?.Keywords.Choose_group, ne), pt = (e, a) => (e = [...e], a && a.id && a.childsIds && (e = e.filter((o) => o.folder_id === a.id || a.childsIds.includes(o.folder_id))), e), xe = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), yt = (e) => e.gen("/add/keywords_2/groups/"), ht = { class: "top-groupSelector_groupItem" }, It = {
573
+ folder_id: O.id,
574
+ folder_path: O.path
575
+ }, W = () => (ne.name = w()?.Common.All_groups, ne), je = () => (ne.name = w()?.Keywords.Choose_group, ne), pt = (e, a, o) => (e = [...e], a !== void 0 && (e = e.filter((t) => t.on == Number(a))), o && o.id && o.childsIds && (e = e.filter((t) => t.folder_id === o.id || o.childsIds.includes(t.folder_id))), e), Ce = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), yt = (e) => e.gen("/add/keywords_2/groups/"), ht = { class: "top-groupSelector_groupItem" }, It = {
565
576
  key: 0,
566
577
  class: "top-comment"
567
578
  }, St = {
568
579
  key: 1,
569
580
  class: "top-groupSelector_groupItemFolderPath"
570
- }, xt = /* @__PURE__ */ L({
581
+ }, xt = /* @__PURE__ */ R({
571
582
  __name: "groups",
572
583
  props: /* @__PURE__ */ M({
573
584
  groupId: {},
@@ -575,6 +586,7 @@ const ce = {
575
586
  projectId: {},
576
587
  folder: {},
577
588
  groups: {},
589
+ on: { type: Boolean, default: void 0 },
578
590
  canAdd: { type: [String, Boolean] },
579
591
  canSelectAll: { type: [Boolean, String] },
580
592
  autoselect: { default: "first" },
@@ -589,56 +601,56 @@ const ce = {
589
601
  }),
590
602
  emits: /* @__PURE__ */ M(["addGroup"], ["update:groupId", "update:group"]),
591
603
  setup(e, { emit: a }) {
592
- const o = e, t = a, r = A(e, "groupId"), l = A(e, "group"), n = o.client && !o.groups ? xe(o.client) : void 0, d = o.client ? yt(o.client) : void 0, c = G(null), f = G(void 0), I = Xe("folder_id", "EQUALS", [o.folder?.id ?? 0]);
604
+ const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? yt(o.client) : void 0, f = G(null), c = G(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
593
605
  n?.changeParams({
594
606
  project_id: o.projectId,
595
607
  filters: [
596
- I
608
+ x
597
609
  ]
598
- });
599
- const i = (u) => {
600
- l.value = u, r.value = u.id;
610
+ }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [o.on]));
611
+ const i = (d) => {
612
+ l.value = d, r.value = d.id;
601
613
  };
602
- Se({
614
+ ce({
603
615
  projectId: () => o.projectId,
604
616
  folderId: () => o.folder?.id,
605
617
  canSelectAll: () => o.canSelectAll
606
- }, (u) => {
607
- if (u.projectId && (n?.changeParams({
618
+ }, (d) => {
619
+ if (d.projectId && (n?.changeParams({
608
620
  project_id: o.projectId
609
621
  }), n?.setOptions({
610
622
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
611
- })), u.folderId && (I.values = [
623
+ })), d.folderId && (x.values = [
612
624
  o.folder?.id ?? 0
613
- ], o.groups && (f.value = pt(o.groups, o.folder))), c.value?.resetCache(), (u.folderId?.old !== void 0 || u.canSelectAll?.old !== void 0) && r.value !== de) {
625
+ ], o.groups && (c.value = pt(o.groups, o.on, o.folder))), f.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && r.value !== de) {
614
626
  let s;
615
- o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = Te(W()))), (o.autoselect === "placeholder" || !s) && (s = je()), i(s);
627
+ o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(W()))), (o.autoselect === "placeholder" || !s) && (s = je()), i(s);
616
628
  }
617
- }, { immediate: !0 }), Se({
629
+ }, { immediate: !0 }), ce({
618
630
  modelGroup: l,
619
631
  modelGroupId: r
620
- }, async (u) => {
632
+ }, async (d) => {
621
633
  if (r.value !== l.value.id) {
622
- if (u.modelGroup && !u.modelGroupId) {
634
+ if (d.modelGroup && !d.modelGroupId) {
623
635
  r.value = l.value.id;
624
636
  return;
625
637
  }
626
638
  if (!(o.canAdd && r.value === de)) {
627
639
  if (o.groups) {
628
- let s = f.value?.find((g) => g.id === r.value);
640
+ let s = c.value?.find((g) => g.id === r.value);
629
641
  if (!s && o.canSelectAll && (s = W()), s)
630
642
  i(s);
631
643
  else {
632
- const g = f.value?.[0];
633
- g && !r.value ? i(g) : i(ce);
644
+ const g = c.value?.[0];
645
+ g && !r.value ? i(g) : i(ge);
634
646
  }
635
647
  }
636
- if (o.client && !o.groups && (r.value || r.value === we && !o.canSelectAll)) {
637
- const s = xe(o.client).changeParams({
648
+ if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
649
+ const s = Ce(o.client).changeParams({
638
650
  project_id: o.projectId,
639
651
  id: r.value,
640
652
  filters: [
641
- I
653
+ x
642
654
  ]
643
655
  });
644
656
  s?.setOptions({
@@ -646,32 +658,32 @@ const ce = {
646
658
  });
647
659
  const g = await s.call();
648
660
  if (!g.errors?.length && !g.result) return;
649
- !g.errors && g.result[0] ? i(g.result[0]) : i(ce);
661
+ !g.errors && g.result[0] ? i(g.result[0]) : i(ge);
650
662
  }
651
663
  }
652
664
  }
653
665
  }, { immediate: !0 });
654
- const m = async (u) => {
655
- if (o.canAdd !== "api" || !d) return;
656
- const s = l.value, g = await d.changeParams({
666
+ const m = async (d) => {
667
+ if (o.canAdd !== "api" || !u) return;
668
+ const s = l.value, g = await u.changeParams({
657
669
  project_id: o.projectId,
658
- names: [u.name],
659
- to_id: o.folder?.id ?? N.id,
670
+ names: [d.name],
671
+ to_id: o.folder?.id ?? O.id,
660
672
  to_type: "in_folder_last"
661
673
  }).call();
662
- g.result ? (i(g.result), t("addGroup", g.result)) : i(s), c.value?.resetCache(!0);
674
+ g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
663
675
  };
664
- return (u, s) => (h(), C(Ve, {
676
+ return (d, s) => (h(), C(we, {
665
677
  ref_key: "refSelector",
666
- ref: c,
678
+ ref: f,
667
679
  class: "top-groupSelector_group",
668
680
  modelValue: l.value,
669
681
  "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
670
- items: f.value ?? e.groups,
682
+ items: c.value ?? e.groups,
671
683
  searchType: "inline",
672
684
  icon: e.addIcon ? "" : void 0,
673
685
  api: e.groups ? void 0 : v(n),
674
- apiSetSearchParams: (...g) => v(Me)(...g, "name"),
686
+ apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
675
687
  appendSearchToResult: !!e.canAdd,
676
688
  useAllItem: e.canSelectAll ? v(W)().name : !1,
677
689
  addChanger: e.addChanger,
@@ -680,15 +692,15 @@ const ce = {
680
692
  }, {
681
693
  item: B(({ item: g }) => [
682
694
  oe("div", ht, [
683
- g.id === v(de) ? (h(), b("div", It, V(u.$i18n.Common.Add) + ": ", 1)) : O("", !0),
684
- oe("span", null, V(g.name), 1),
685
- g.folder_path ? (h(), b("span", St, V(g.folder_path), 1)) : O("", !0)
695
+ g.id === v(de) ? (h(), A("div", It, b(d.$i18n.Common.Add) + ": ", 1)) : L("", !0),
696
+ oe("span", null, b(g.name), 1),
697
+ g.folder_path ? (h(), A("span", St, b(g.folder_path), 1)) : L("", !0)
686
698
  ])
687
699
  ]),
688
700
  _: 1
689
701
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
690
702
  }
691
- }), kt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ L({
703
+ }), kt = { class: "top-groupSelector" }, Ft = /* @__PURE__ */ R({
692
704
  __name: "groupSelector",
693
705
  props: /* @__PURE__ */ M({
694
706
  folderId: {},
@@ -697,7 +709,7 @@ const ce = {
697
709
  projectId: {},
698
710
  folders: {},
699
711
  groups: {},
700
- onlyOnGroups: { type: Boolean },
712
+ on: { type: Boolean },
701
713
  canSelectAllGroups: { type: Boolean },
702
714
  canAddGroup: {},
703
715
  autoselect: { default: "first" },
@@ -716,52 +728,54 @@ const ce = {
716
728
  }),
717
729
  emits: /* @__PURE__ */ M(["update:groups"], ["update:folderId", "update:groupId", "update:group"]),
718
730
  setup(e, { emit: a }) {
719
- const o = e, t = A(e, "folderId"), r = A(e, "groupId"), l = A(e, "group"), n = a, d = G(ft(o.folders, o.canSelectAllGroups));
720
- let c = o.groups?.find((I) => I.id === r.value);
721
- r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = je()), c ??= ce, l.value ??= c;
722
- const f = (I) => {
723
- let i;
724
- o.groups && I && (i = [...o.groups, I]), n("update:groups", i);
731
+ const o = e, t = T(e, "folderId"), r = T(e, "groupId"), l = T(e, "group"), n = a, u = G(ft(o.folders, o.canSelectAllGroups)), f = pe(o.folders ?? { root: [O] }, o.canSelectAllGroups);
732
+ u.value = f.get(t.value);
733
+ let c = o.groups?.find((i) => i.id === r.value);
734
+ r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = je()), c ??= ge, l.value ??= c;
735
+ const x = (i) => {
736
+ let m;
737
+ o.groups && i && (m = [...o.groups, i]), n("update:groups", m);
725
738
  };
726
- return (I, i) => (h(), b("div", kt, [
739
+ return (i, m) => (h(), A("div", kt, [
727
740
  e.showFolders ? (h(), C(vt, {
728
741
  key: 0,
729
742
  folderId: t.value,
730
- "onUpdate:folderId": i[0] || (i[0] = (m) => t.value = m),
731
- folder: d.value,
732
- "onUpdate:folder": i[1] || (i[1] = (m) => d.value = m),
743
+ "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
744
+ folder: u.value,
745
+ "onUpdate:folder": m[1] || (m[1] = (d) => u.value = d),
733
746
  projectId: e.projectId,
734
747
  folders: e.folders,
735
748
  canSelectAll: e.canSelectAllGroups,
736
749
  addChanger: e.addChanger,
737
750
  addIcon: e.addIcon,
738
751
  client: e.client
739
- }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
752
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : L("", !0),
740
753
  e.showGroups ? (h(), C(xt, {
741
754
  key: 1,
742
755
  groupId: r.value,
743
- "onUpdate:groupId": i[2] || (i[2] = (m) => r.value = m),
756
+ "onUpdate:groupId": m[2] || (m[2] = (d) => r.value = d),
744
757
  group: l.value,
745
- "onUpdate:group": i[3] || (i[3] = (m) => l.value = m),
758
+ "onUpdate:group": m[3] || (m[3] = (d) => l.value = d),
746
759
  projectId: e.projectId,
747
- folder: d.value,
760
+ folder: u.value,
748
761
  groups: e.groups,
762
+ on: e.on,
749
763
  canAdd: e.canAddGroup,
750
764
  canSelectAll: e.canSelectAllGroups,
751
765
  autoselect: e.autoselect,
752
766
  addChanger: e.addChanger,
753
767
  addIcon: e.addIcon,
754
768
  client: e.client,
755
- onAddGroup: f
756
- }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : O("", !0)
769
+ onAddGroup: x
770
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : L("", !0)
757
771
  ]));
758
772
  }
759
- }), ke = (e) => "-" + e, Q = (e) => e[0] === "-" ? e.substring(1) : e, re = (e, a) => {
760
- e = Q(e);
773
+ }), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, re = (e, a) => {
774
+ e = H(e);
761
775
  const o = a.find((t) => t.id === e);
762
776
  if (o)
763
777
  return o;
764
- }, Ut = (e, a, o) => {
778
+ }, qt = (e, a, o) => {
765
779
  a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
766
780
  const t = Ze.genElPopupOpener("div", a);
767
781
  return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || t.classList.add("top-tagSelector-custom"), 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 = (r) => {
@@ -773,15 +787,15 @@ const ce = {
773
787
  filters: e.filters,
774
788
  payload: e.payload
775
789
  };
776
- J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, pe(e.modelValue) || T(l, () => {
790
+ J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || V(l, () => {
777
791
  e.modelValue = l.value, te(t, e, o);
778
792
  }), t.click();
779
- }, pe(e.modelValue) ? T(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
793
+ }, he(e.modelValue) ? V(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
780
794
  e.modelValue = r;
781
795
  const l = J(t, "topTagSelectorTarget");
782
796
  l && (l.model.value = r), te(t, e, o);
783
797
  }), te(t, e, o), t;
784
- }, Ft = (e, a) => {
798
+ }, Ut = (e, a) => {
785
799
  J(e, "topTagSelectorRender")?.(a);
786
800
  }, te = (e, a, o) => {
787
801
  const t = v(a.modelValue);
@@ -790,7 +804,7 @@ const ce = {
790
804
  return;
791
805
  }
792
806
  if (e.innerHTML = "", !t.length && a.mode === "filter") {
793
- const r = Ce({
807
+ const r = Te({
794
808
  id: "all",
795
809
  colorId: "",
796
810
  name: w().Common?.All_tags ?? "",
@@ -799,15 +813,15 @@ const ce = {
799
813
  e.append(r);
800
814
  }
801
815
  t.forEach((r) => {
802
- const l = Ce({
803
- id: Q(r),
816
+ const l = Te({
817
+ id: H(r),
804
818
  colorId: re(r, a.tags)?.color_id ?? "",
805
819
  name: re(r, a.tags)?.name ?? "",
806
- state: Q(r) === r ? "selected" : "excluded"
820
+ state: H(r) === r ? "selected" : "excluded"
807
821
  });
808
822
  e.append(l);
809
823
  });
810
- }, Ce = (e) => {
824
+ }, Te = (e) => {
811
825
  const a = document.createElement("div");
812
826
  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;
813
827
  }, Ct = [
@@ -861,7 +875,7 @@ const ce = {
861
875
  name: "Turquoise",
862
876
  color_id: "10"
863
877
  }
864
- ], Bt = ["data-tag_id", "data-tag_color_id", "title"], ge = /* @__PURE__ */ L({
878
+ ], Bt = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
865
879
  __name: "tagIcon",
866
880
  props: {
867
881
  id: {},
@@ -870,7 +884,7 @@ const ce = {
870
884
  state: {}
871
885
  },
872
886
  setup(e) {
873
- return (a, o) => (h(), b("div", {
887
+ return (a, o) => (h(), A("div", {
874
888
  class: X({
875
889
  "top-tagSelector_tagIcon": !0,
876
890
  "top-tagSelector-active": !!e.state,
@@ -881,7 +895,7 @@ const ce = {
881
895
  title: e.name
882
896
  }, null, 10, Bt));
883
897
  }
884
- }), Tt = ["contenteditable", "onKeydown"], Be = /* @__PURE__ */ L({
898
+ }), Tt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
885
899
  __name: "tagPopupListItem",
886
900
  props: /* @__PURE__ */ M({
887
901
  editable: { type: Boolean },
@@ -899,69 +913,69 @@ const ce = {
899
913
  }),
900
914
  emits: /* @__PURE__ */ M(["update:name", "unselect", "exclude", "select"], ["update:name"]),
901
915
  setup(e, { emit: a }) {
902
- const o = e, t = a, r = A(e, "name"), l = G(null), n = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
903
- contenteditable: d.value,
916
+ const o = e, t = a, r = T(e, "name"), l = G(null), n = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
917
+ contenteditable: u.value,
904
918
  onpaste: (m) => m.preventDefault()
905
- } : {}), d = G(!1), c = async () => {
906
- d.value = !0, await Re(), l.value?.focus();
907
- }, f = () => {
919
+ } : {}), u = G(!1), f = async () => {
920
+ u.value = !0, await Ne(), l.value?.focus();
921
+ }, c = () => {
908
922
  const m = l.value?.innerText;
909
- if (!m) return I();
910
- l.value && (l.value.innerText = m), d.value = !1, t("update:name", m);
911
- }, I = async () => {
912
- l.value && (l.value.innerText = o.name), d.value = !1;
923
+ if (!m) return x();
924
+ l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
925
+ }, x = async () => {
926
+ l.value && (l.value.innerText = o.name), u.value = !1;
913
927
  }, i = (m) => {
914
- if (d.value || o.disabled) return;
915
- let u = "selected";
916
- o.canExclude && (m.ctrlKey || m.metaKey) && (u = "excluded"), o.state == u && (u = ""), u === "" && t("unselect"), u === "selected" && t("select"), u === "excluded" && t("exclude");
928
+ if (u.value || o.disabled) return;
929
+ let d = "selected";
930
+ o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
917
931
  };
918
- return (m, u) => (h(), C(me, {
932
+ return (m, d) => (h(), C(ve, {
919
933
  class: X({
920
934
  "top-tagSelector_tagListItem": !0,
921
- "top-tagSelector_tagListItem-inEdit": d.value,
935
+ "top-tagSelector_tagListItem-inEdit": u.value,
922
936
  "top-tagSelector_tagListItem-disabled": e.disabled,
923
937
  "top-tagSelector_tagListItem-canExclude": e.canExclude,
924
938
  "top-tagSelector-active": !!e.state,
925
939
  "top-tagSelector-excluded": e.state === "excluded"
926
940
  }),
927
- onClick: F(i, ["stop"])
941
+ onClick: U(i, ["stop"])
928
942
  }, {
929
943
  default: B(() => [
930
- R(ge, {
944
+ N(fe, {
931
945
  id: e.id,
932
946
  name: r.value,
933
947
  colorId: e.colorId,
934
948
  state: e.state
935
949
  }, null, 8, ["id", "name", "colorId", "state"]),
936
- oe("span", Ae({
950
+ oe("span", Ve({
937
951
  ref_key: "elName",
938
952
  ref: l,
939
953
  class: "top-tagSelector_tagListItemName",
940
- contenteditable: d.value ? "plaintext-only" : !1
954
+ contenteditable: u.value ? "plaintext-only" : !1
941
955
  }, n.value, {
942
956
  onKeydown: [
943
- ye(F(f, ["stop"]), ["enter"]),
944
- ye(F(I, ["stop"]), ["esc"])
957
+ Ie(U(c, ["stop"]), ["enter"]),
958
+ Ie(U(x, ["stop"]), ["esc"])
945
959
  ]
946
- }), V(r.value), 17, Tt),
947
- e.editable ? (h(), b(Y, { key: 0 }, [
948
- d.value ? (h(), b("span", {
960
+ }), b(r.value), 17, Tt),
961
+ e.editable ? (h(), A(Y, { key: 0 }, [
962
+ u.value ? (h(), A("span", {
949
963
  key: 1,
950
964
  "data-top-icon": "",
951
965
  class: "top-tagSelector_edit",
952
- onClick: F(f, ["stop"])
953
- })) : (h(), b("span", {
966
+ onClick: U(c, ["stop"])
967
+ })) : (h(), A("span", {
954
968
  key: 0,
955
969
  "data-top-icon": "",
956
970
  class: "top-tagSelector_edit",
957
- onClick: c
971
+ onClick: f
958
972
  }))
959
- ], 64)) : O("", !0)
973
+ ], 64)) : L("", !0)
960
974
  ]),
961
975
  _: 1
962
976
  }, 8, ["class"]));
963
977
  }
964
- }), At = { key: 1 }, bt = /* @__PURE__ */ L({
978
+ }), At = { key: 1 }, bt = /* @__PURE__ */ R({
965
979
  inheritAttrs: !1,
966
980
  __name: "popupOpener",
967
981
  props: /* @__PURE__ */ M({
@@ -982,18 +996,18 @@ const ce = {
982
996
  }),
983
997
  emits: ["update:modelValue"],
984
998
  setup(e) {
985
- const a = e, o = A(e, "modelValue"), t = a.useTopButton ? H : "div", r = a.useTopButton ? "html" : "default", l = {
999
+ const a = e, o = T(e, "modelValue"), t = a.useTopButton ? Q : "div", r = a.useTopButton ? "html" : "default", l = {
986
1000
  model: o,
987
1001
  mode: a.mode,
988
1002
  targetId: a.targetId,
989
1003
  filters: a.filters,
990
1004
  payload: a.payload
991
1005
  };
992
- return (n, d) => {
993
- const c = Ne("top-data");
994
- return h(), C(ze, { id: e.id }, {
1006
+ return (n, u) => {
1007
+ const f = Pe("top-data");
1008
+ return h(), C(Je, { id: e.id }, {
995
1009
  default: B(() => [
996
- Pe((h(), C(De(v(t)), Ae({
1010
+ De((h(), C(Fe(v(t)), Ve({
997
1011
  class: {
998
1012
  "top-tagSelector": !0,
999
1013
  "top-tagSelector-useTopButton": a.useTopButton,
@@ -1009,32 +1023,32 @@ const ce = {
1009
1023
  styling: e.styling
1010
1024
  }, n.$attrs), {
1011
1025
  [v(r)]: B(() => [
1012
- !o.value.length && e.mode === "filter" ? (h(), C(ge, {
1026
+ !o.value.length && e.mode === "filter" ? (h(), C(fe, {
1013
1027
  key: 0,
1014
1028
  id: "all",
1015
1029
  colorId: "",
1016
1030
  name: n.$i18n.Common.All_tags ?? "",
1017
1031
  state: ""
1018
- }, null, 8, ["name"])) : O("", !0),
1019
- e.mode === "setter" && e.filters ? (h(), b("div", At, [
1032
+ }, null, 8, ["name"])) : L("", !0),
1033
+ e.mode === "setter" && e.filters ? (h(), A("div", At, [
1020
1034
  qe(n.$slots, "default")
1021
- ])) : (h(!0), b(Y, { key: 2 }, fe(o.value, (f) => (h(), C(ge, {
1022
- id: v(Q)(f),
1023
- colorId: v(re)(f, e.tags)?.color_id ?? "",
1024
- name: v(re)(f, e.tags)?.name ?? "",
1025
- state: v(Q)(f) === f ? "selected" : "excluded"
1035
+ ])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
1036
+ id: v(H)(c),
1037
+ colorId: v(re)(c, e.tags)?.color_id ?? "",
1038
+ name: v(re)(c, e.tags)?.name ?? "",
1039
+ state: v(H)(c) === c ? "selected" : "excluded"
1026
1040
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1027
1041
  ]),
1028
1042
  _: 2
1029
1043
  }, 1040, ["class", "styling"])), [
1030
- [c, l, "topTagSelectorTarget"]
1044
+ [f, l, "topTagSelectorTarget"]
1031
1045
  ])
1032
1046
  ]),
1033
1047
  _: 3
1034
1048
  }, 8, ["id"]);
1035
1049
  };
1036
1050
  }
1037
- }), _t = /* @__PURE__ */ L({
1051
+ }), _t = /* @__PURE__ */ R({
1038
1052
  __name: "tagSelector",
1039
1053
  props: /* @__PURE__ */ M({
1040
1054
  modelValue: {},
@@ -1054,19 +1068,19 @@ const ce = {
1054
1068
  },
1055
1069
  modelModifiers: {},
1056
1070
  tags: {
1057
- default: Te(Ct)
1071
+ default: be(Ct)
1058
1072
  },
1059
1073
  tagsModifiers: {}
1060
1074
  }),
1061
1075
  emits: /* @__PURE__ */ M(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1062
1076
  setup(e, { emit: a }) {
1063
- const o = w(), t = e, r = A(e, "modelValue"), l = A(e, "tags"), n = a, d = _e((p, S) => {
1064
- n(p, S);
1077
+ const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
1078
+ n(p, I);
1065
1079
  }, t.emitDelay);
1066
1080
  t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1067
- const c = t.id ?? "top-popup-id-" + Math.random(), f = G("add"), I = () => {
1068
- const p = " " + o.Common.Tags?.toLowerCase(), S = /* @__PURE__ */ new Map();
1069
- return S.set("add", { value: "add", title: o.Common.Add + p }), S.set("replace", { value: "replace", title: o.Common.Replace + p }), S.set("delete", { value: "delete", title: o.Common.Delete + p }), S;
1081
+ const f = t.id ?? "top-popup-id-" + Math.random(), c = G("add"), x = () => {
1082
+ const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1083
+ return I.set("add", { value: "add", title: o.Common.Add + p }), I.set("replace", { value: "replace", title: o.Common.Replace + p }), I.set("delete", { value: "delete", title: o.Common.Delete + p }), I;
1070
1084
  };
1071
1085
  let i = Ue({
1072
1086
  model: r,
@@ -1075,26 +1089,26 @@ const ce = {
1075
1089
  filters: void 0,
1076
1090
  payload: void 0
1077
1091
  });
1078
- T(r, () => {
1079
- d("selector", r.value);
1092
+ V(r, () => {
1093
+ u("selector", r.value);
1080
1094
  });
1081
1095
  const m = E(() => {
1082
1096
  if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1083
1097
  return i.value.model.value.length >= t.maxTagsForSetter;
1084
- }), u = (p) => {
1098
+ }), d = (p) => {
1085
1099
  if (p !== "all") {
1086
1100
  if (i.value.model.value.includes(p)) return "selected";
1087
- if (i.value.model.value.includes(ke(p))) return "excluded";
1101
+ if (i.value.model.value.includes(Be(p))) return "excluded";
1088
1102
  }
1089
1103
  return p === "all" && !i.value.model.value.length ? "selected" : "";
1090
- }, s = (p, S) => {
1091
- const x = ke(p);
1092
- let k = i.value.model.value.filter((K) => K !== p && K !== x);
1093
- S === "select" && k.push(p), S === "exclude" && k.push(x), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, ee) => {
1104
+ }, s = (p, I) => {
1105
+ const S = Be(p);
1106
+ let k = i.value.model.value.filter((K) => K !== p && K !== S);
1107
+ I === "select" && k.push(p), I === "exclude" && k.push(S), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, ee) => {
1094
1108
  if (!t.tags) return 0;
1095
- const D = t.tags.findIndex((U) => U.id === K), q = t.tags.findIndex((U) => U.id === ee);
1096
- return D - q;
1097
- }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && d("setter", {
1109
+ const D = t.tags.findIndex((q) => q.id === K), F = t.tags.findIndex((q) => q.id === ee);
1110
+ return D - F;
1111
+ }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1098
1112
  tagsIds: k,
1099
1113
  targetId: i.value.targetId,
1100
1114
  payload: i.value.payload
@@ -1105,15 +1119,15 @@ const ce = {
1105
1119
  }), Z = () => {
1106
1120
  const p = prompt("", "New tag");
1107
1121
  if (!p || p === "New tag") return;
1108
- const S = l.value.length + 1;
1122
+ const I = l.value.length + 1;
1109
1123
  l.value.push({
1110
- id: String(S),
1124
+ id: String(I),
1111
1125
  name: p,
1112
- color_id: String((S - 1) % 10 + 1)
1126
+ color_id: String((I - 1) % 10 + 1)
1113
1127
  }), n("tagsChanged", l.value);
1114
1128
  }, P = (p) => {
1115
1129
  if (i.value = J(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1116
- if (i.value.filters && (f.value = "add", i.value.model.value = []), !_.$?.ui.sortable) {
1130
+ if (i.value.filters && (c.value = "add", i.value.model.value = []), !_.$?.ui.sortable) {
1117
1131
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1118
1132
  return;
1119
1133
  }
@@ -1124,84 +1138,84 @@ const ce = {
1124
1138
  */
1125
1139
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
1126
1140
  distance: 10,
1127
- stop: function(S, x) {
1141
+ stop: function(I, S) {
1128
1142
  if (!l.value) return;
1129
- const k = $(x.item).parent().find("[data-tag_id]"), K = [];
1143
+ const k = $(S.item).parent().find("[data-tag_id]"), K = [];
1130
1144
  k.each((ee, D) => {
1131
1145
  if (!l.value) return;
1132
- const q = $(D).attr("data-tag_id");
1133
- K.push(q);
1146
+ const F = $(D).attr("data-tag_id");
1147
+ K.push(F);
1134
1148
  }), l.value.sort((ee, D) => {
1135
- const q = K.findIndex((ie) => ie === ee.id), U = K.findIndex((ie) => ie === D.id);
1136
- return q - U;
1137
- }), d("tagsChanged", l.value);
1149
+ const F = K.findIndex((ie) => ie === ee.id), q = K.findIndex((ie) => ie === D.id);
1150
+ return F - q;
1151
+ }), u("tagsChanged", l.value);
1138
1152
  }
1139
1153
  });
1140
- }, Le = (p) => {
1154
+ }, Re = (p) => {
1141
1155
  _.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
1142
1156
  };
1143
- return (p, S) => (h(), b(Y, null, [
1144
- R(bt, {
1157
+ return (p, I) => (h(), A(Y, null, [
1158
+ N(bt, {
1145
1159
  modelValue: r.value,
1146
- "onUpdate:modelValue": S[0] || (S[0] = (x) => r.value = x),
1147
- id: v(c),
1160
+ "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
1161
+ id: v(f),
1148
1162
  tags: l.value,
1149
1163
  styling: e.styling,
1150
1164
  mode: "filter",
1151
1165
  useTopButton: e.useTopButton
1152
1166
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1153
- R(be, {
1154
- id: v(c),
1167
+ N(Me, {
1168
+ id: v(f),
1155
1169
  class: X(g.value),
1156
- onOpen: S[4] || (S[4] = (x) => P(x)),
1157
- onClose: S[5] || (S[5] = (x) => Le(x)),
1170
+ onOpen: I[4] || (I[4] = (S) => P(S)),
1171
+ onClose: I[5] || (I[5] = (S) => Re(S)),
1158
1172
  "transition-duration": 50
1159
- }, Fe({
1173
+ }, _e({
1160
1174
  contentList: B(() => [
1161
- v(i).mode === "filter" && !e.singleMode ? (h(), C(Be, {
1175
+ v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
1162
1176
  key: 0,
1163
1177
  id: "all",
1164
1178
  colorId: "",
1165
1179
  name: p.$i18n.Common.All_tags ?? "",
1166
1180
  state: v(i).model.value.length ? "" : "selected",
1167
- onSelect: S[3] || (S[3] = (x) => v(i).model.value = [])
1168
- }, null, 8, ["name", "state"])) : O("", !0),
1169
- (h(!0), b(Y, null, fe(l.value, (x) => (h(), C(Be, {
1170
- key: x.id,
1171
- id: x.id,
1172
- colorId: x.color_id,
1173
- name: x.name,
1174
- state: u(x.id),
1181
+ onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
1182
+ }, null, 8, ["name", "state"])) : L("", !0),
1183
+ (h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
1184
+ key: S.id,
1185
+ id: S.id,
1186
+ colorId: S.color_id,
1187
+ name: S.name,
1188
+ state: d(S.id),
1175
1189
  canExclude: v(i).mode === "filter" && !e.singleMode,
1176
1190
  editable: e.tagsEditable,
1177
- disabled: m.value && u(x.id) === "",
1178
- onUnselect: (k) => s(x.id, "unselect"),
1179
- onSelect: (k) => s(x.id, "select"),
1180
- onExclude: (k) => s(x.id, "exclude"),
1191
+ disabled: m.value && d(S.id) === "",
1192
+ onUnselect: (k) => s(S.id, "unselect"),
1193
+ onSelect: (k) => s(S.id, "select"),
1194
+ onExclude: (k) => s(S.id, "exclude"),
1181
1195
  "onUpdate:name": (k) => {
1182
- x.name = k, v(d)("tagsChanged", l.value);
1196
+ S.name = k, v(u)("tagsChanged", l.value);
1183
1197
  }
1184
1198
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1185
- e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(me, {
1199
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
1186
1200
  key: 1,
1187
1201
  "data-top-icon": "",
1188
- onClick: F(Z, ["stop"])
1202
+ onClick: U(Z, ["stop"])
1189
1203
  }, {
1190
1204
  default: B(() => [
1191
- z(V(p.$i18n.Common.Add), 1)
1205
+ z(b(p.$i18n.Common.Add), 1)
1192
1206
  ]),
1193
1207
  _: 1
1194
- })) : O("", !0)
1208
+ })) : L("", !0)
1195
1209
  ]),
1196
1210
  _: 2
1197
1211
  }, [
1198
1212
  v(i).mode === "setter" && v(i).filters ? {
1199
1213
  name: "header",
1200
1214
  fn: B(() => [
1201
- R(se, {
1202
- modelValue: f.value,
1203
- "onUpdate:modelValue": S[1] || (S[1] = (x) => f.value = x),
1204
- options: I()
1215
+ N(se, {
1216
+ modelValue: c.value,
1217
+ "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
1218
+ options: x()
1205
1219
  }, null, 8, ["modelValue", "options"])
1206
1220
  ]),
1207
1221
  key: "0"
@@ -1209,22 +1223,22 @@ const ce = {
1209
1223
  v(i).mode === "setter" && v(i).filters ? {
1210
1224
  name: "footer",
1211
1225
  fn: B(() => [
1212
- R(H, { color: "theme" }, {
1226
+ N(Q, { color: "theme" }, {
1213
1227
  default: B(() => [
1214
- z(V(p.$i18n.Common.Cancel), 1)
1228
+ z(b(p.$i18n.Common.Cancel), 1)
1215
1229
  ]),
1216
1230
  _: 1
1217
1231
  }),
1218
- R(H, {
1219
- onClick: S[2] || (S[2] = (x) => v(d)("setter", {
1232
+ N(Q, {
1233
+ onClick: I[2] || (I[2] = (S) => v(u)("setter", {
1220
1234
  tagsIds: v(i).model.value,
1221
1235
  filters: v(i).filters,
1222
- filtersAction: f.value,
1236
+ filtersAction: c.value,
1223
1237
  payload: v(i).payload
1224
1238
  }))
1225
1239
  }, {
1226
1240
  default: B(() => [
1227
- z(V(f.value === "add" ? p.$i18n.Common.Add : "") + " " + V(f.value === "replace" ? p.$i18n.Common.Replace : "") + " " + V(f.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
1241
+ z(b(c.value === "add" ? p.$i18n.Common.Add : "") + " " + b(c.value === "replace" ? p.$i18n.Common.Replace : "") + " " + b(c.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
1228
1242
  ]),
1229
1243
  _: 1
1230
1244
  })
@@ -1237,16 +1251,16 @@ const ce = {
1237
1251
  });
1238
1252
  export {
1239
1253
  Nt as TopCompetitorSelector,
1240
- qt as TopGroupSelector,
1254
+ Ft as TopGroupSelector,
1241
1255
  Dt as TopRegionSelector,
1242
1256
  _t as TopTagSelector,
1243
1257
  bt as TopTagSelectorPopupOpener,
1244
- ge as TopTagSelectorTagIcon,
1258
+ fe as TopTagSelectorTagIcon,
1245
1259
  dt as dialogRegionSelector,
1246
1260
  it as findRegion,
1247
- Ut as genElTopTagSelectorPopupOpener,
1248
- Ee as genSearcherByKey,
1249
- Ft as renderElTopTagSelectorPopupOpener,
1261
+ qt as genElTopTagSelectorPopupOpener,
1262
+ Ke as genSearcherByKey,
1263
+ Ut as renderElTopTagSelectorPopupOpener,
1250
1264
  Pt as useItemsFromCompetitors
1251
1265
  };
1252
1266
  //# sourceMappingURL=project.js.map