@topvisor/ui 1.4.1-projectSelector.1 → 1.4.1-titleHTML.21

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 (35) hide show
  1. package/.chunks/policy.vue_vue_type_style_index_0_lang-Dgb5Q7Hx.amd.js +2 -0
  2. package/.chunks/policy.vue_vue_type_style_index_0_lang-Dgb5Q7Hx.amd.js.map +1 -0
  3. package/.chunks/policy.vue_vue_type_style_index_0_lang-LkyBILW6.es.js +496 -0
  4. package/.chunks/policy.vue_vue_type_style_index_0_lang-LkyBILW6.es.js.map +1 -0
  5. package/assets/policy.css +1 -1
  6. package/assets/project.css +1 -1
  7. package/formsExt/formsExt.amd.js +1 -1
  8. package/formsExt/formsExt.js +1 -1
  9. package/package.json +1 -1
  10. package/popup/popup.amd.js +1 -1
  11. package/popup/popup.amd.js.map +1 -1
  12. package/popup/popup.js +2 -2
  13. package/popup/popup.js.map +1 -1
  14. package/project/project.amd.js +1 -1
  15. package/project/project.amd.js.map +1 -1
  16. package/project/project.js +612 -893
  17. package/project/project.js.map +1 -1
  18. package/src/components/formsExt/selector2/composables/useAPI.d.ts +0 -2
  19. package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -3
  20. package/src/components/formsExt/selector2/types.d.ts +0 -14
  21. package/src/components/popup/popup/listItem.vue.d.ts +4 -24
  22. package/src/components/popup/popup/types.d.ts +0 -1
  23. package/src/components/project/groupSelector/groups/groups.vue.d.ts +0 -2
  24. package/src/components/project/groupSelector/groups/utils.d.ts +1 -1
  25. package/src/components/project/project.d.ts +0 -1
  26. package/.chunks/policy.vue_vue_type_style_index_0_lang-CO-f4TwZ.amd.js +0 -2
  27. package/.chunks/policy.vue_vue_type_style_index_0_lang-CO-f4TwZ.amd.js.map +0 -1
  28. package/.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js +0 -503
  29. package/.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js.map +0 -1
  30. package/src/components/project/projectSelector/projectSelector.vue.d.ts +0 -120
  31. package/src/components/project/projectSelector/stories/mocks/projects.d.ts +0 -10
  32. package/src/components/project/projectSelector/submenu/submenu.vue.d.ts +0 -4
  33. package/src/components/project/projectSelector/submenu/types.d.ts +0 -17
  34. package/src/components/project/projectSelector/types.d.ts +0 -51
  35. package/src/components/project/projectSelector/utils.d.ts +0 -206
@@ -3,21 +3,20 @@
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 G, mergeModels as M, useModel as B, computed as w, createElementBlock as T, openBlock as v, createBlock as j, unref as p, withCtx as C, Fragment as q, renderList as se, normalizeClass as Z, createElementVNode as L, toDisplayString as A, createVNode as E, createTextVNode as N, toValue as ke, ref as V, watch as P, createCommentVNode as _, reactive as _e, resolveComponent as Ee, onMounted as Ue, withModifiers as D, isRef as Ce, mergeProps as Ge, withKeys as je, nextTick as Fe, resolveDirective as We, withDirectives as ze, resolveDynamicComponent as Je, renderSlot as Ye, shallowRef as He, createSlots as Qe } from "vue";
7
- import { u as b, C as J, e as Q, q as fe, d as Xe } from "../.chunks/forms-BAUgA7Ct.es.js";
8
- import { _ as he, b as ye, a as Ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
9
- import { a as et, _ as Ie, b as Se, c as Ke, I as le } from "../.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js";
10
- import { u as tt } from "../.chunks/utils-BYaZxGC1.es.js";
11
- import { getSearcherGIcon as ot, getLangLabel as lt, getDeviceGIcon as nt } from "../utils/searchers.js";
6
+ import { defineComponent as R, mergeModels as V, useModel as T, computed as M, 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 P, createTextVNode as J, toValue as ye, ref as K, watch as E, createCommentVNode as O, reactive as be, isRef as he, withModifiers as U, mergeProps as Ve, withKeys as Ie, nextTick as Re, resolveDirective as Pe, withDirectives as Ne, resolveDynamicComponent as qe, renderSlot as De, shallowRef as Fe, createSlots as Ue } from "vue";
7
+ import { u as w, C as z, e as Q, q as ce, d as ze } from "../.chunks/forms-BAUgA7Ct.es.js";
8
+ import { _ as we, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
9
+ import { a as We, _ as Me, b as Ee, c as $e, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-LkyBILW6.es.js";
10
+ import { u as _e } from "../.chunks/utils-BYaZxGC1.es.js";
11
+ import { getSearcherGIcon as Ye, getLangLabel as Qe, getDeviceGIcon as He } from "../utils/searchers.js";
12
12
  import "../.chunks/core-BE_-rKvW.es.js";
13
13
  import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DMhcuiHP.es.js";
14
- import { g as Te } from "../.chunks/field-CyyFzM-Y.es.js";
15
- import { validUrl as Ae } from "../utils/check.js";
16
- import { storage as Y } from "../utils/dom.js";
17
- import { TopPopupWorker as at } from "../popup/worker.js";
18
- const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" }, io = /* @__PURE__ */ G({
14
+ import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
15
+ import { storage as W } from "../utils/dom.js";
16
+ import { TopPopupWorker as Xe } from "../popup/worker.js";
17
+ const Ze = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
19
18
  __name: "competitorSelector",
20
- props: /* @__PURE__ */ M({
19
+ props: /* @__PURE__ */ V({
21
20
  modelValue: {},
22
21
  items: {},
23
22
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -27,64 +26,64 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
27
26
  }),
28
27
  emits: ["update:modelValue"],
29
28
  setup(e) {
30
- const t = e, o = B(e, "modelValue"), l = w(() => {
31
- if (t.showSelectAllItem)
29
+ const a = e, o = T(e, "modelValue"), t = M(() => {
30
+ if (a.showSelectAllItem)
32
31
  return {
33
32
  icon: "",
34
- title: b().Common.Select_all,
33
+ title: w().Common.Select_all,
35
34
  value: "all",
36
35
  content: ""
37
36
  };
38
37
  });
39
- return (a, n) => (v(), T("div", rt, [
40
- p(J).state.isMobile ? (v(), j(he, { key: 0 }, {
41
- opener: C(() => [
42
- E(Q, {
38
+ return (r, l) => (h(), A("div", Ze, [
39
+ v(z).state.isMobile ? (h(), C(we, { key: 0 }, {
40
+ opener: B(() => [
41
+ P(Q, {
43
42
  class: "top-competitorSelector_opener",
44
43
  color: "theme",
45
44
  icon: "",
46
45
  icon2: ""
47
46
  }, {
48
- default: C(() => [
49
- N(A(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
47
+ default: B(() => [
48
+ J(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
50
49
  ]),
51
50
  _: 1
52
51
  })
53
52
  ]),
54
- contentList: C(() => [
55
- (v(!0), T(q, null, se(e.items, (r) => (v(), j(ye, {
56
- class: Z({
57
- "top-active": o.value?.includes(r.value)
53
+ contentList: B(() => [
54
+ (h(!0), A(Y, null, me(e.items, (n) => (h(), C(ve, {
55
+ class: X({
56
+ "top-active": o.value?.includes(n.value)
58
57
  }),
59
- "data-top-icon": r.icon,
60
- title: r.title,
61
- onClick: () => o.value = [r.value]
58
+ "data-top-icon": n.icon,
59
+ title: n.title,
60
+ onClick: () => o.value = [n.value]
62
61
  }, {
63
- default: C(() => [
64
- L("span", it, A(r.content), 1)
62
+ default: B(() => [
63
+ oe("span", et, b(n.content), 1)
65
64
  ]),
66
65
  _: 2
67
66
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
68
67
  ]),
69
68
  _: 1
70
- })) : (v(), j(et, {
69
+ })) : (h(), C(We, {
71
70
  key: 1,
72
71
  modelValue: o.value,
73
- "onUpdate:modelValue": n[0] || (n[0] = (r) => o.value = r),
72
+ "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
74
73
  items: e.items,
75
74
  isMultiple: !0,
76
75
  styling: "bar",
77
76
  canBeEmptyMultiple: !1,
78
- selectAllItem: l.value
77
+ selectAllItem: t.value
79
78
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
80
79
  ]));
81
80
  }
82
- }), so = (e, t) => w(() => ke(e).filter((a) => a.on >= 0 || a.id === t).map((a) => ({
83
- value: a.id,
84
- title: a.url + ` [${a.id}]`,
85
- icon: a.id === ke(t) ? "" : "",
86
- content: a.name
87
- }))), O = -1, y = -2, ne = -1, dt = {
81
+ }), Pt = (e, a) => M(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
82
+ value: r.id,
83
+ title: r.url + ` [${r.id}]`,
84
+ icon: r.id === ye(a) ? "" : "",
85
+ content: r.name
86
+ }))), L = -1, y = -2, le = -1, tt = {
88
87
  0: "Yandex",
89
88
  1: "Google",
90
89
  4: "YouTube",
@@ -94,241 +93,241 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
94
93
  9: "GoogleStore",
95
94
  20: "Yandex.com",
96
95
  21: "Yandex.com.tr"
97
- }, Be = {
96
+ }, xe = {
98
97
  key: y,
99
98
  name: "--",
100
99
  index: y
101
- }, Le = {
100
+ }, Ge = {
102
101
  key: y,
103
102
  name: "--",
104
- regions: [Be],
105
- regionByIndex: /* @__PURE__ */ new Map([[y, Be]])
103
+ regions: [xe],
104
+ regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
106
105
  }, ae = {
107
106
  key: y,
108
107
  name: "Autoselect",
109
108
  index: y
110
- }, ce = {
109
+ }, se = {
111
110
  key: y,
112
111
  name: "Autoselect",
113
112
  regions: [ae],
114
113
  regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
115
- }, be = {
114
+ }, ke = {
116
115
  countryCode: "00",
117
116
  depth: 1,
118
117
  device: 0,
119
- key: ne,
120
- index: ne,
118
+ key: le,
119
+ index: le,
121
120
  lang: "ru",
122
121
  name: "Without region"
123
- }, st = () => (ae.name = b().Common.Autoselect, ae), ut = () => (st(), ce.name = b().Common.Autoselect, console.log(ce), ce), ct = () => (be.name = b().Keywords.Without_region, be), Oe = (e = !1, t = !1, o = []) => {
124
- let l;
125
- return e ? l = gt(o) : l = Re(o), t && l.set(y, ut()), l.size || l.set(y, Le), l;
126
- }, Re = (e, t = !0, o = [], l = !1) => {
127
- const a = /* @__PURE__ */ new Map();
128
- return e.forEach((n) => {
129
- if (!n.enabled || l && typeof n.key == "number" && n.key > 1) return;
130
- const r = { ...n };
131
- r.regionByIndex = /* @__PURE__ */ new Map(), n.regions && n.regions.forEach((u) => {
132
- if (t && !u.enabled) return;
133
- const c = { ...u };
134
- r.regionByIndex.set(c.index, c);
135
- }), !r.regionByIndex.size && o.length, // режим вывода ПС без регионов
136
- (!n.regions || // есть включенные регионы
137
- r.regionByIndex.size || // запрошен вывод конкретных ПС
138
- o.length) && typeof r.key == "number" && a.set(r.key, r);
139
- }), o.forEach((n) => {
140
- if (a.has(n)) return;
141
- const r = {
142
- key: n,
143
- name: dt[n],
122
+ }, ot = () => (ae.name = w().Common.Autoselect, ae), lt = () => (ot(), se.name = w().Common.Autoselect, console.log(se), se), at = () => (ke.name = w().Keywords.Without_region, ke), Ke = (e = !1, a = !1, o = []) => {
123
+ let t;
124
+ return e ? t = nt(o) : t = Oe(o), a && t.set(y, lt()), t.size || t.set(y, Ge), t;
125
+ }, Oe = (e, a = !0, o = [], t = !1) => {
126
+ const r = /* @__PURE__ */ new Map();
127
+ return e.forEach((l) => {
128
+ if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
129
+ const n = { ...l };
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
+ }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
135
+ (!l.regions || // есть включенные регионы
136
+ n.regionByIndex.size || // запрошен вывод конкретных ПС
137
+ o.length) && typeof n.key == "number" && r.set(n.key, n);
138
+ }), o.forEach((l) => {
139
+ if (r.has(l)) return;
140
+ const n = {
141
+ key: l,
142
+ name: tt[l],
144
143
  regions: [],
145
144
  regionByIndex: /* @__PURE__ */ new Map()
146
145
  };
147
- a.set(r.key, r);
148
- }), a;
149
- }, gt = (e) => {
150
- const t = Re(e, !1, [0, 1], !0);
151
- if (t.has(2)) {
152
- const o = t.get(2);
146
+ r.set(n.key, n);
147
+ }), r;
148
+ }, nt = (e) => {
149
+ const a = Oe(e, !1, [0, 1], !0);
150
+ if (a.has(2)) {
151
+ const o = a.get(2);
153
152
  o && (o.regionByIndex = /* @__PURE__ */ new Map());
154
153
  }
155
- return t.forEach((o) => {
154
+ return a.forEach((o) => {
156
155
  if (!o.regionByIndex) return;
157
- const l = { ...ct() };
158
- o.regionByIndex.set(l.index, l);
159
- }), t;
160
- }, ft = (e, t, o = []) => {
161
- const l = Oe(e, !1, o);
162
- let a;
163
- return l.forEach((n) => {
164
- if (!(t.searcher_key !== void 0 && t.searcher_key != n.key) && n.regions && (n.regions.forEach((r) => {
165
- if (!a && !(t.key !== void 0 && t.key != r.key) && !(t.index !== void 0 && t.index != r.index) && !(!e && (t.lang !== void 0 && t.lang != r.lang || t.device !== void 0 && t.device != r.device)))
166
- return r.searcher_key = n.key, a = r, !1;
167
- }), a))
168
- return !1;
156
+ const t = { ...at() };
157
+ o.regionByIndex.set(t.index, t);
169
158
  }), a;
170
- }, mt = tt(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), pt = (e, t) => {
171
- const o = b(), l = V(t.value.keys().next().value ?? y), a = w(() => {
172
- const n = /* @__PURE__ */ new Map();
173
- if (t.value.forEach((r) => {
159
+ }, rt = (e, a, o = []) => {
160
+ const t = Ke(e, !1, o);
161
+ let r;
162
+ return t.forEach((l) => {
163
+ if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
164
+ if (!r && !(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)))
165
+ return n.searcher_key = l.key, r = n, !1;
166
+ }), r))
167
+ return !1;
168
+ }), r;
169
+ }, it = _e(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), dt = (e, a) => {
170
+ const o = w(), t = K(a.value.keys().next().value ?? y), r = M(() => {
171
+ const l = /* @__PURE__ */ new Map();
172
+ if (a.value.forEach((n) => {
174
173
  let u = {
175
- value: r.key,
176
- title: r.name
174
+ value: n.key,
175
+ title: n.name
177
176
  };
178
- e.addSearcherIcon && (u.icon = ot(r.key)), n.set(r.key, u);
179
- }), e.addCompare && !n.has(y)) {
180
- const r = {
177
+ e.addSearcherIcon && (u.icon = Ye(n.key)), l.set(n.key, u);
178
+ }), e.addCompare && !l.has(y)) {
179
+ const n = {
181
180
  value: "",
182
181
  title: "--------------------",
183
182
  disabled: !0
184
183
  };
185
- n.set(r.value, r);
184
+ l.set(n.value, n);
186
185
  const u = {
187
- value: O,
186
+ value: L,
188
187
  title: o.Common.Compare
189
188
  };
190
- n.set(u.value, u);
189
+ l.set(u.value, u);
191
190
  }
192
- return n;
191
+ return l;
193
192
  });
194
193
  return {
195
- searcherKey: l,
196
- optionBySearcherKey: a
194
+ searcherKey: t,
195
+ optionBySearcherKey: r
197
196
  };
198
- }, vt = (e, t) => {
199
- const o = b(), l = V(y);
200
- e.modelValue.length === 1 && (l.value = e.modelValue[0]), l.value === y && (e.forFrequency ? l.value = t.value?.regionByIndex.values().next().value?.key ?? y : l.value = t.value?.regionByIndex.keys().next().value ?? y);
201
- const a = w(() => {
202
- const n = /* @__PURE__ */ new Map();
203
- return t.value.regionByIndex?.forEach((r) => {
204
- let u = r.name;
197
+ }, ut = (e, a) => {
198
+ const o = w(), t = K(y);
199
+ e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === y && (e.forFrequency ? t.value = a.value?.regionByIndex.values().next().value?.key ?? y : t.value = a.value?.regionByIndex.keys().next().value ?? y);
200
+ const r = M(() => {
201
+ const l = /* @__PURE__ */ new Map();
202
+ return a.value.regionByIndex?.forEach((n) => {
203
+ let u = n.name;
205
204
  if (e.forFrequency) {
206
- const S = {
207
- value: r.key,
205
+ const x = {
206
+ value: n.key,
208
207
  title: u
209
208
  };
210
- n.has(r.key) || n.set(r.key, S);
209
+ l.has(n.key) || l.set(n.key, x);
211
210
  return;
212
211
  }
213
- r.device && (u += " (" + o.Common["Device_" + r.device] + ")");
214
- const c = lt(t.value.key || 0, r.lang ?? "");
215
- c && (u += " / " + c);
216
- const f = {
217
- value: r.index,
212
+ n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
213
+ const f = Qe(a.value.key || 0, n.lang ?? "");
214
+ f && (u += " / " + f);
215
+ const c = {
216
+ value: n.index,
218
217
  title: u,
219
- icon: r.device ? nt(r.device) : void 0
218
+ icon: n.device ? He(n.device) : void 0
220
219
  };
221
- n.set(r.index, f);
222
- }), n;
220
+ l.set(n.index, c);
221
+ }), l;
223
222
  });
224
- return P(a, (n, r) => {
225
- if (e.onlySearcher || l.value !== void 0 && n.get(l.value))
223
+ return E(r, (l, n) => {
224
+ if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
226
225
  return;
227
- let u = n.keys().next().value;
228
- if (l.value === y || u === y) {
229
- l.value = u;
226
+ let u = l.keys().next().value;
227
+ if (t.value === y || u === y) {
228
+ t.value = u;
230
229
  return;
231
230
  }
232
- let c = r?.get(l.value)?.title || "", f = -1;
233
- for (const [S, i] of n.entries()) {
234
- const g = i.title;
235
- if (typeof g != "string" || typeof S == "string")
231
+ let f = n?.get(t.value)?.title || "", c = -1;
232
+ for (const [x, i] of l.entries()) {
233
+ const m = i.title;
234
+ if (typeof m != "string" || typeof x == "string")
236
235
  break;
237
- if (g === c) {
238
- u = S;
236
+ if (m === f) {
237
+ u = x;
239
238
  break;
240
239
  }
241
240
  const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
242
- let s = c, m = 3;
243
- g.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(d, ""), m--), g.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), m--), g.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(d, ""), m--), g.indexOf(s) !== -1 && (m <= f || (f = m, u = S));
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));
244
243
  }
245
- l.value = u;
244
+ t.value = u;
246
245
  }), {
247
- regionIndex: l,
248
- optionByRegionIndex: a
246
+ regionIndex: t,
247
+ optionByRegionIndex: r
249
248
  };
250
- }, ht = (e, t, o) => {
251
- const l = V([]), a = () => {
252
- if (e.onlySearcher && t.value) {
253
- l.value = Array.from(t.value.keys());
249
+ }, st = (e, a, o) => {
250
+ const t = K([]), r = () => {
251
+ if (e.onlySearcher && a.value) {
252
+ t.value = Array.from(a.value.keys());
254
253
  return;
255
254
  }
256
- let r = [];
255
+ let n = [];
257
256
  if (e.modelValue.length > 1)
258
- r = [...e.modelValue];
257
+ n = [...e.modelValue];
259
258
  else
260
259
  try {
261
- r = JSON.parse(
260
+ n = JSON.parse(
262
261
  localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
263
262
  ) ?? [];
264
263
  } catch {
265
264
  }
266
- r.length && (r = r.filter((u) => o.value.has(u))), r.length || (r = Array.from(o.value)), l.value = [...r];
267
- }, n = () => {
268
- l.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(l.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
265
+ n.length && (n = n.filter((u) => o.value.has(u))), n.length || (n = Array.from(o.value)), t.value = [...n];
266
+ }, l = () => {
267
+ t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
269
268
  };
270
- return P(l, () => {
271
- n();
272
- }), e.addCompare && a(), {
273
- regionsIndexes: l
269
+ return E(t, () => {
270
+ l();
271
+ }), e.addCompare && r(), {
272
+ regionsIndexes: t
274
273
  };
275
- }, yt = (e) => {
276
- const t = w(() => Oe(e.forFrequency, e.autoRegion, e.searchers)), o = w(() => t.value.get(a.searcherKey.value) || Le), l = w(() => {
274
+ }, ct = (e) => {
275
+ const a = M(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = M(() => a.value.get(r.searcherKey.value) || Ge), t = M(() => {
277
276
  const i = /* @__PURE__ */ new Set();
278
- return t.value.forEach((g) => {
279
- g.regionByIndex.forEach((d) => {
280
- d.index !== ne && d.index !== y && i.add(d.index);
277
+ return a.value.forEach((m) => {
278
+ m.regionByIndex.forEach((d) => {
279
+ d.index !== le && d.index !== y && i.add(d.index);
281
280
  });
282
281
  }), i;
283
- }), a = pt(e, t), n = vt(e, o), r = ht(e, t, l);
284
- P(t, () => {
285
- if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((g) => l.value.has(g)), a.searcherKey.value === O) return;
286
- let i = t.value.keys().next().value;
287
- t.value.forEach((g) => {
288
- if (e.onlySearcher && g.key === a.searcherKey.value) {
289
- i = a.searcherKey.value;
282
+ }), r = dt(e, a), l = ut(e, o), n = st(e, a, t);
283
+ E(a, () => {
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 === L) return;
285
+ let i = a.value.keys().next().value;
286
+ a.value.forEach((m) => {
287
+ if (e.onlySearcher && m.key === r.searcherKey.value) {
288
+ i = r.searcherKey.value;
290
289
  return;
291
290
  }
292
- if (n.regionIndex.value && g.regionByIndex?.has(n.regionIndex.value) && (i = g.key), !e.onlySearcher) {
291
+ if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
293
292
  let d;
294
- i !== void 0 && (d = t.value.get(i)?.regionByIndex);
295
- const s = t.value.get(g.key)?.regionByIndex;
296
- d?.has(y) && !s?.has(y) && (i = g.key);
293
+ i !== void 0 && (d = a.value.get(i)?.regionByIndex);
294
+ const s = a.value.get(m.key)?.regionByIndex;
295
+ d?.has(y) && !s?.has(y) && (i = m.key);
297
296
  }
298
- }), i !== void 0 && (a.searcherKey.value = i), n.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(n.regionIndex.value) && (n.regionIndex.value = o.value?.regions?.keys().next().value);
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);
299
298
  }, { immediate: !0 });
300
299
  const u = () => {
301
- if (!(a.searcherKey.value === O || a.searcherKey.value === y))
302
- return a.searcherKey.value;
303
- }, c = () => {
304
- if (e.onlySearcher || n.regionIndex.value === y) return;
305
- let i = n.regionIndex.value;
300
+ if (!(r.searcherKey.value === L || r.searcherKey.value === y))
301
+ return r.searcherKey.value;
302
+ }, f = () => {
303
+ if (e.onlySearcher || l.regionIndex.value === y) return;
304
+ let i = l.regionIndex.value;
306
305
  if (e.forFrequency) {
307
- const g = n.regionIndex.value;
308
- i = ft(e.forFrequency, { searcher_key: u(), key: g }, e.searchers)?.index;
306
+ const m = l.regionIndex.value;
307
+ i = rt(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
309
308
  }
310
309
  return i;
311
- }, f = () => {
310
+ }, c = () => {
312
311
  const i = u();
313
312
  if (i !== void 0)
314
- return t.value.get(i);
313
+ return a.value.get(i);
315
314
  };
316
315
  return {
317
- selectSearcher: a,
318
- selectRegion: n,
319
- compare: r,
320
- searcherByKey: t,
321
- allRegionsIndexes: l,
322
- getSearcher: f,
316
+ selectSearcher: r,
317
+ selectRegion: l,
318
+ compare: n,
319
+ searcherByKey: a,
320
+ allRegionsIndexes: t,
321
+ getSearcher: c,
323
322
  getRegion: () => {
324
- const i = c();
323
+ const i = f();
325
324
  if (i !== void 0)
326
- return f()?.regionByIndex?.get(i);
325
+ return c()?.regionByIndex?.get(i);
327
326
  }
328
327
  };
329
- }, uo = /* @__PURE__ */ G({
328
+ }, Nt = /* @__PURE__ */ R({
330
329
  __name: "regionSelector",
331
- props: /* @__PURE__ */ M({
330
+ props: /* @__PURE__ */ V({
332
331
  projectId: {},
333
332
  searchers: { default: () => [] },
334
333
  modelValue: {},
@@ -347,163 +346,163 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
347
346
  modelValueSingleModifiers: {}
348
347
  }),
349
348
  emits: ["update:modelValue", "update:modelValueSingle"],
350
- setup(e, { expose: t }) {
351
- const o = e, l = B(e, "modelValue"), a = B(e, "modelValueSingle"), {
352
- selectSearcher: n,
353
- selectRegion: r,
349
+ setup(e, { expose: a }) {
350
+ const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
351
+ selectSearcher: l,
352
+ selectRegion: n,
354
353
  compare: u,
355
- searcherByKey: c,
356
- allRegionsIndexes: f,
357
- getSearcher: S,
354
+ searcherByKey: f,
355
+ allRegionsIndexes: c,
356
+ getSearcher: x,
358
357
  getRegion: i
359
- } = yt(o), g = () => {
358
+ } = ct(o), m = () => {
360
359
  const d = [];
361
- c.value.forEach((s) => {
362
- s.enabled && s.regions.forEach((m) => {
363
- m.enabled && d.push(m);
360
+ f.value.forEach((s) => {
361
+ s.enabled && s.regions.forEach((g) => {
362
+ g.enabled && d.push(g);
364
363
  });
365
- }), mt.open("regions", {
364
+ }), it.open("regions", {
366
365
  regions: d,
367
366
  regionsIndexes: u.regionsIndexes.value,
368
367
  "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
369
368
  });
370
369
  };
371
- return P([r.regionIndex, n.searcherKey, u.regionsIndexes], () => {
372
- if (n.searcherKey.value === O && u.regionsIndexes.value.length) {
373
- if (JSON.stringify(l.value) === JSON.stringify(u.regionsIndexes.value))
370
+ return E([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
371
+ if (l.searcherKey.value === L && u.regionsIndexes.value.length) {
372
+ if (JSON.stringify(t.value) === JSON.stringify(u.regionsIndexes.value))
374
373
  return;
375
- l.value = [...u.regionsIndexes.value];
374
+ t.value = [...u.regionsIndexes.value];
376
375
  } else
377
- o.onlySearcher ? (l.value = [n.searcherKey.value], n.searcherKey.value === y && !o.autoRegion && (l.value.length = 0)) : (l.value = [r.regionIndex.value], r.regionIndex.value === y && !o.autoRegion && (l.value.length = 0));
378
- !o.onlySearcher && !f.value.size && (n.searcherKey.value = y);
379
- }), a.value && P(a, () => {
380
- a.value && (l.value = [a.value]);
381
- }, { immediate: !0 }), P(l, () => {
382
- if (l.value[0] && (a.value = l.value[0]), o.onlySearcher) {
383
- if (!l.value.length || l.value.length === 1 && !c.value.has(l.value[0]) || l.value.length === 1 && l.value[0] === y && !o.autoRegion) {
384
- let d = c.value.keys().next().value;
385
- d === y && !o.autoRegion && (d = void 0, a.value = y), d !== void 0 ? l.value = [d] : l.value.length = 0;
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 && !c.value.size && (l.searcherKey.value = y);
378
+ }), r.value && E(r, () => {
379
+ r.value && (t.value = [r.value]);
380
+ }, { immediate: !0 }), E(t, () => {
381
+ if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
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;
386
385
  return;
387
386
  }
388
- if (l.value.length > 1 && JSON.stringify(l.value) !== JSON.stringify(u.regionsIndexes.value)) {
389
- l.value = [...u.regionsIndexes.value];
387
+ if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
388
+ t.value = [...u.regionsIndexes.value];
390
389
  return;
391
390
  }
392
391
  } else {
393
- let d = [...new Set(l.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
394
- if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, a.value = y), !d.length)
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)
395
394
  s !== void 0 && d.push(s);
396
395
  else if (d.length === 1) {
397
- let m = f.value;
398
- o.forFrequency && (m = /* @__PURE__ */ new Set(), c.value.forEach((ee) => {
399
- ee.regionByIndex.forEach((U) => {
400
- U.index !== ne && U.index !== y && m.add(U.key);
396
+ let g = c.value;
397
+ o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
398
+ Z.regionByIndex.forEach((N) => {
399
+ N.index !== le && N.index !== y && g.add(N.key);
401
400
  });
402
- })), m.has(d[0]) || (d = [], s !== void 0 && d.push(s));
401
+ })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
403
402
  } else
404
- d = d.filter((m) => f.value.has(m)), !d.length && s !== void 0 && d.push(s);
405
- if (JSON.stringify(l.value) !== JSON.stringify(d)) {
406
- l.value = d;
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;
407
406
  return;
408
407
  }
409
408
  }
410
- if (!(l.value.length === 1 && l.value[0] === (o.onlySearcher ? n.searcherKey.value : r.regionIndex.value)))
409
+ if (!(t.value.length === 1 && t.value[0] === (o.onlySearcher ? l.searcherKey.value : n.regionIndex.value)))
411
410
  if (o.onlySearcher) {
412
- if (l.value.length === 1) {
413
- n.searcherKey.value = l.value[0];
411
+ if (t.value.length === 1) {
412
+ l.searcherKey.value = t.value[0];
414
413
  return;
415
414
  }
416
- n.searcherKey.value = O;
415
+ l.searcherKey.value = L;
417
416
  return;
418
417
  } else {
419
- if (!l.value.length)
418
+ if (!t.value.length)
420
419
  return;
421
- if (l.value.length === 1 && n.searcherKey.value !== O) {
422
- r.regionIndex.value = l.value[0];
420
+ if (t.value.length === 1 && l.searcherKey.value !== L) {
421
+ n.regionIndex.value = t.value[0];
423
422
  let d;
424
- for (const s of c.value.values()) {
425
- for (const m of s.regionByIndex.values())
426
- if ((o.forFrequency ? m.key : m.index) === r.regionIndex.value) {
423
+ for (const s of f.value.values()) {
424
+ for (const g of s.regionByIndex.values())
425
+ if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
427
426
  d = s.key;
428
427
  break;
429
428
  }
430
429
  if (d !== void 0)
431
430
  break;
432
431
  }
433
- d !== void 0 && (n.searcherKey.value = d);
432
+ d !== void 0 && (l.searcherKey.value = d);
434
433
  } else
435
- n.searcherKey.value = O, u.regionsIndexes.value = [...l.value];
434
+ l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
436
435
  }
437
- }, { immediate: !0 }), t({
438
- getSearcher: S,
436
+ }, { immediate: !0 }), a({
437
+ getSearcher: x,
439
438
  getRegion: i
440
- }), (d, s) => (v(), T("div", {
441
- class: Z({
439
+ }), (d, s) => (h(), A("div", {
440
+ class: X({
442
441
  "top-selectorRegion": !0,
443
442
  "top-selectorRegion-onlySearcher": e.onlySearcher
444
443
  })
445
444
  }, [
446
- E(fe, {
447
- options: p(n).optionBySearcherKey.value,
448
- modelValue: p(n).searcherKey.value,
449
- "onUpdate:modelValue": s[0] || (s[0] = (m) => p(n).searcherKey.value = m),
445
+ P(ce, {
446
+ options: v(l).optionBySearcherKey.value,
447
+ modelValue: v(l).searcherKey.value,
448
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
450
449
  name: "searcher_key",
451
450
  addChanger: e.addChanger
452
451
  }, null, 8, ["options", "modelValue", "addChanger"]),
453
- !e.onlySearcher && p(n).searcherKey.value !== p(O) ? (v(), j(fe, {
452
+ !e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
454
453
  key: 0,
455
454
  class: "top-select-region",
456
- options: p(r).optionByRegionIndex.value,
457
- modelValue: p(r).regionIndex.value,
458
- "onUpdate:modelValue": s[1] || (s[1] = (m) => p(r).regionIndex.value = m),
455
+ options: v(n).optionByRegionIndex.value,
456
+ modelValue: v(n).regionIndex.value,
457
+ "onUpdate:modelValue": s[1] || (s[1] = (g) => v(n).regionIndex.value = g),
459
458
  name: e.forFrequency ? "region_key" : "region_index",
460
459
  addChanger: e.addChanger,
461
460
  "data-top-icon": e.addRegionIcon ? "" : void 0
462
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : _("", !0),
463
- e.addCompare && !e.onlySearcher && p(n).searcherKey.value === p(O) ? (v(), j(Q, {
461
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
462
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(L) ? (h(), C(Q, {
464
463
  key: 1,
465
464
  name: "compare",
466
- onClick: g,
467
- "data-count-compare-regions-indexes": p(u).regionsIndexes.value.length
465
+ onClick: m,
466
+ "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
468
467
  }, {
469
- default: C(() => [
470
- N(A(d.$i18n.Common.Selected_regions), 1)
468
+ default: B(() => [
469
+ J(b(d.$i18n.Common.Selected_regions), 1)
471
470
  ]),
472
471
  _: 1
473
- }, 8, ["data-count-compare-regions-indexes"])) : _("", !0)
472
+ }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
474
473
  ], 2));
475
474
  }
476
- }), R = {
475
+ }), j = {
477
476
  id: 0,
478
477
  name: "/",
479
478
  path: "/"
480
479
  };
481
- function It(e) {
482
- return e ? b()?.Common.All_folders : "/ (" + b()?.Keywords.Root_folder + ")";
480
+ function gt(e) {
481
+ return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
483
482
  }
484
- const xe = (e, t, o = /* @__PURE__ */ new Map(), l = { id: "root" }, a = 0) => (l.childsIds = [], l.id && (l.countAllGroupsActive = l.count_groups_active), e[l.id] && e[l.id].forEach((n) => {
485
- n = { ...n }, l.childsIds.push(n.id), n.id === 0 && (n.name = It(t));
486
- const r = a > 1 ? "-".repeat(a - 1) + " " : "";
487
- r && !n.name.startsWith(r) && (n.name = r + n.name), o.set(n.id, n), xe(e, t, o, n, a + 1), l.childsIds = l.childsIds.concat(n.childsIds), l.id && n.count_groups_active && (l.countAllGroupsActive += n.count_groups_active);
488
- }), o), St = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
489
- function me(e, t, o) {
490
- const l = Object.keys(e), a = l.map((n) => e[n]);
491
- return P(a, (n, r, u) => {
492
- const c = {};
493
- n.forEach((f, S) => {
494
- if (!Object.is(f, r[S])) {
495
- const i = l[S];
496
- c[i] = {
497
- old: r[S],
498
- new: f
483
+ 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) => {
484
+ l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = gt(a));
485
+ const n = r > 1 ? "-".repeat(r - 1) + " " : "";
486
+ 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);
487
+ }), o), ft = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
488
+ function ge(e, a, o) {
489
+ const t = Object.keys(e), r = t.map((l) => e[l]);
490
+ return E(r, (l, n, u) => {
491
+ const f = {};
492
+ l.forEach((c, x) => {
493
+ if (!Object.is(c, n[x])) {
494
+ const i = t[x];
495
+ f[i] = {
496
+ old: n[x],
497
+ new: c
499
498
  };
500
499
  }
501
- }), Object.keys(c).length && t(c, u);
500
+ }), Object.keys(f).length && a(f, u);
502
501
  }, o);
503
502
  }
504
- const xt = /* @__PURE__ */ G({
503
+ const mt = /* @__PURE__ */ R({
505
504
  __name: "folders",
506
- props: /* @__PURE__ */ M({
505
+ props: /* @__PURE__ */ V({
507
506
  folderId: {},
508
507
  folder: {},
509
508
  folders: {},
@@ -515,64 +514,64 @@ const xt = /* @__PURE__ */ G({
515
514
  }, {
516
515
  folderId: { required: !0 },
517
516
  folderIdModifiers: {},
518
- folder: { default: R },
517
+ folder: { default: j },
519
518
  folderModifiers: {}
520
519
  }),
521
520
  emits: ["update:folderId", "update:folder"],
522
521
  setup(e) {
523
- const t = e, o = B(e, "folderId"), l = B(e, "folder"), a = t.client && !t.folders ? St(t.client) : void 0, n = V(null);
524
- P(() => t.projectId, () => {
525
- a?.changeParams({
526
- project_id: t.projectId
527
- }), a?.setOptions({
528
- checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
529
- }), n.value?.resetCache();
522
+ const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client) : void 0, l = K(null);
523
+ E(() => a.projectId, () => {
524
+ r?.changeParams({
525
+ project_id: a.projectId
526
+ }), r?.setOptions({
527
+ checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
528
+ }), l.value?.resetCache();
530
529
  }, { immediate: !0 });
531
- const r = w(() => xe(t.folders ?? { root: [R] }, t.canSelectAll));
532
- return me({
533
- modelFolder: l,
530
+ const n = M(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
531
+ return ge({
532
+ modelFolder: t,
534
533
  modelFolderId: o
535
534
  }, async (u) => {
536
- if (o.value === l.value.id)
535
+ if (o.value === t.value.id)
537
536
  return;
538
537
  if (u.modelFolder && !u.modelFolderId) {
539
- o.value = l.value.id;
538
+ o.value = t.value.id;
540
539
  return;
541
540
  }
542
- let c = r.value.get(t.folderId);
543
- c || (c = R), l.value = c, o.value = c.id;
544
- }, { immediate: !0 }), (u, c) => (v(), j(Ie, {
541
+ let f = n.value.get(a.folderId);
542
+ f || (f = j), t.value = f, o.value = f.id;
543
+ }, { immediate: !0 }), (u, f) => (h(), C(Me, {
545
544
  class: "top-groupSelector_folder",
546
- modelValue: l.value,
547
- "onUpdate:modelValue": c[0] || (c[0] = (f) => l.value = f),
548
- items: e.folders ? [...r.value.values()] : void 0,
545
+ modelValue: t.value,
546
+ "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
547
+ items: e.folders ? [...n.value.values()] : void 0,
549
548
  "search-type": "inline",
550
549
  icon: e.addIcon ? "" : void 0,
551
- api: e.folders ? void 0 : p(a),
552
- apiSetSearchParams: (...f) => p(Se)(...f, "name"),
550
+ api: e.folders ? void 0 : v(r),
551
+ apiSetSearchParams: (...c) => v(Ee)(...c, "name"),
553
552
  addChanger: e.addChanger,
554
553
  useCache: ""
555
554
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
556
555
  }
557
- }), re = {
556
+ }), ne = {
558
557
  id: -1,
559
558
  name: "--",
560
- folder_id: R.id,
561
- folder_path: R.path
562
- }, ie = {
563
- id: Ke,
559
+ folder_id: j.id,
560
+ folder_path: j.path
561
+ }, re = {
562
+ id: $e,
564
563
  name: "All groups",
565
- folder_id: R.id,
566
- folder_path: R.path
567
- }, H = () => (ie.name = b()?.Common.All_groups, ie), Ne = () => (ie.name = b()?.Keywords.Choose_group, ie), kt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((l) => l.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((l) => l.folder_id === o.id || o.childsIds.includes(l.folder_id))), e), $e = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Ct = (e) => e.gen("/add/keywords_2/groups/"), jt = { class: "top-groupSelector_groupItem" }, Tt = {
564
+ folder_id: j.id,
565
+ folder_path: j.path
566
+ }, _ = () => (re.name = w()?.Common.All_groups, re), Le = () => (re.name = w()?.Keywords.Choose_group, re), vt = (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 }), pt = (e) => e.gen("/add/keywords_2/groups/"), yt = { class: "top-groupSelector_groupItem" }, ht = {
568
567
  key: 0,
569
568
  class: "top-comment"
570
- }, At = {
569
+ }, It = {
571
570
  key: 1,
572
571
  class: "top-groupSelector_groupItemFolderPath"
573
- }, Bt = /* @__PURE__ */ G({
572
+ }, St = /* @__PURE__ */ R({
574
573
  __name: "groups",
575
- props: /* @__PURE__ */ M({
574
+ props: /* @__PURE__ */ V({
576
575
  groupId: {},
577
576
  group: {},
578
577
  projectId: {},
@@ -592,111 +591,111 @@ const xt = /* @__PURE__ */ G({
592
591
  group: { required: !0 },
593
592
  groupModifiers: {}
594
593
  }),
595
- emits: /* @__PURE__ */ M(["addGroup"], ["update:groupId", "update:group"]),
596
- setup(e, { emit: t }) {
597
- const o = e, l = t, a = B(e, "groupId"), n = B(e, "group"), r = o.client && !o.groups ? $e(o.client) : void 0, u = o.client ? Ct(o.client) : void 0, c = V(null), f = V(void 0), S = Te("folder_id", "EQUALS", [o.folder?.id ?? 0]);
598
- r?.changeParams({
594
+ emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
595
+ setup(e, { emit: a }) {
596
+ 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 ? pt(o.client) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
597
+ n?.changeParams({
599
598
  project_id: o.projectId,
600
599
  folder_id_depth: !0,
601
600
  filters: [
602
- S
601
+ x
603
602
  ]
604
- }), o.on !== void 0 && r?.params.filters?.push(Te("on", "EQUALS", [Number(o.on)]));
603
+ }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [Number(o.on)]));
605
604
  const i = (d) => {
606
- n.value = d, a.value = d.id;
605
+ l.value = d, r.value = d.id;
607
606
  };
608
- me({
607
+ ge({
609
608
  projectId: () => o.projectId,
610
609
  folderId: () => o.folder?.id,
611
610
  canSelectAll: () => o.canSelectAll
612
611
  }, (d) => {
613
- if (d.projectId && (r?.changeParams({
612
+ if (d.projectId && (n?.changeParams({
614
613
  project_id: o.projectId
615
- }), r?.setOptions({
614
+ }), n?.setOptions({
616
615
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
617
- })), d.folderId && (S.values = [
616
+ })), d.folderId && (x.values = [
618
617
  o.folder?.id ?? 0
619
- ], o.groups && (f.value = kt(o.groups, o.on, o.folder))), c.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && a.value !== le) {
618
+ ], o.groups && (c.value = vt(o.groups, o.on, o.folder))), f.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && r.value !== ue) {
620
619
  let s;
621
- o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = _e(H()))), (o.autoselect === "placeholder" || !s) && (s = Ne()), i(s);
620
+ o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(_()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
622
621
  }
623
- }, { immediate: !0 }), me({
624
- modelGroup: n,
625
- modelGroupId: a
622
+ }, { immediate: !0 }), ge({
623
+ modelGroup: l,
624
+ modelGroupId: r
626
625
  }, async (d) => {
627
- if (a.value !== n.value.id) {
626
+ if (r.value !== l.value.id) {
628
627
  if (d.modelGroup && !d.modelGroupId) {
629
- a.value = n.value.id;
628
+ r.value = l.value.id;
630
629
  return;
631
630
  }
632
- if (!(o.canAdd && a.value === le)) {
631
+ if (!(o.canAdd && r.value === ue)) {
633
632
  if (o.groups) {
634
- let s = f.value?.find((m) => m.id === a.value);
635
- if (!s && o.canSelectAll && (s = H()), s)
633
+ let s = c.value?.find((g) => g.id === r.value);
634
+ if (!s && o.canSelectAll && (s = _()), s)
636
635
  i(s);
637
636
  else {
638
- const m = f.value?.[0];
639
- m && !a.value ? i(m) : i(re);
637
+ const g = c.value?.[0];
638
+ g && !r.value ? i(g) : i(ne);
640
639
  }
641
640
  }
642
- if (o.client && !o.groups && (a.value || a.value === Ke && !o.canSelectAll)) {
643
- const s = $e(o.client).changeParams({
641
+ if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
642
+ const s = Ce(o.client).changeParams({
644
643
  project_id: o.projectId,
645
- id: a.value,
644
+ id: r.value,
646
645
  filters: [
647
- S
646
+ x
648
647
  ]
649
648
  });
650
649
  s?.setOptions({
651
650
  checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
652
651
  });
653
- const m = await s.call();
654
- if (!m.errors?.length && !m.result) return;
655
- !m.errors && m.result[0] ? i(m.result[0]) : i(re);
652
+ const g = await s.call();
653
+ if (!g.errors?.length && !g.result) return;
654
+ !g.errors && g.result[0] ? i(g.result[0]) : i(ne);
656
655
  }
657
656
  }
658
657
  }
659
658
  }, { immediate: !0 });
660
- const g = async (d) => {
659
+ const m = async (d) => {
661
660
  if (o.canAdd !== "api" || !u) return;
662
- const s = n.value, m = await u.changeParams({
661
+ const s = l.value, g = await u.changeParams({
663
662
  project_id: o.projectId,
664
663
  names: [d.name],
665
- to_id: o.folder?.id ?? R.id,
664
+ to_id: o.folder?.id ?? j.id,
666
665
  to_type: "in_folder_last"
667
666
  }).call();
668
- m.result ? (i(m.result), l("addGroup", m.result)) : i(s), c.value?.resetCache(!0);
667
+ g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
669
668
  };
670
- return (d, s) => (v(), j(Ie, {
669
+ return (d, s) => (h(), C(Me, {
671
670
  ref_key: "refSelector",
672
- ref: c,
671
+ ref: f,
673
672
  class: "top-groupSelector_group",
674
- modelValue: n.value,
675
- "onUpdate:modelValue": s[0] || (s[0] = (m) => n.value = m),
676
- items: f.value ?? e.groups,
673
+ modelValue: l.value,
674
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
675
+ items: c.value ?? e.groups,
677
676
  searchType: "inline",
678
677
  icon: e.addIcon ? "" : void 0,
679
- api: e.groups ? void 0 : p(r),
680
- apiSetSearchParams: (...m) => p(Se)(...m, "name"),
678
+ api: e.groups ? void 0 : v(n),
679
+ apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
681
680
  appendSearchToResult: !!e.canAdd,
682
- useAllItem: e.canSelectAll ? p(H)().name : !1,
681
+ useAllItem: e.canSelectAll ? v(_)().name : !1,
683
682
  addChanger: e.addChanger,
684
683
  useCache: "",
685
- onAppendItem: g
684
+ onAppendItem: m
686
685
  }, {
687
- item: C(({ item: m }) => [
688
- L("div", jt, [
689
- m.id === p(le) ? (v(), T("div", Tt, A(d.$i18n.Common.Add) + ": ", 1)) : _("", !0),
690
- L("span", null, A(m.name), 1),
691
- m.folder_path && e.showPath ? (v(), T("span", At, A(m.folder_path), 1)) : _("", !0)
686
+ item: B(({ item: g }) => [
687
+ oe("div", yt, [
688
+ g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
689
+ oe("span", null, b(g.name), 1),
690
+ g.folder_path && e.showPath ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
692
691
  ])
693
692
  ]),
694
693
  _: 1
695
694
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
696
695
  }
697
- }), bt = { class: "top-groupSelector" }, co = /* @__PURE__ */ G({
696
+ }), xt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ R({
698
697
  __name: "groupSelector",
699
- props: /* @__PURE__ */ M({
698
+ props: /* @__PURE__ */ V({
700
699
  folderId: {},
701
700
  folder: {},
702
701
  groupId: {},
@@ -720,41 +719,41 @@ const xt = /* @__PURE__ */ G({
720
719
  folderModifiers: {},
721
720
  groupId: { required: !0 },
722
721
  groupIdModifiers: {},
723
- group: { default: re },
722
+ group: { default: ne },
724
723
  groupModifiers: {}
725
724
  }),
726
- emits: /* @__PURE__ */ M(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
727
- setup(e, { emit: t }) {
728
- const o = e, l = B(e, "folderId"), a = B(e, "folder"), n = B(e, "groupId"), r = B(e, "group"), u = t, c = xe(o.folders ?? { root: [R] }, o.canSelectAllGroups);
729
- a.value = c.get(l.value);
730
- let f = o.groups?.find((i) => i.id === n.value);
731
- n.value || (f = o.groups?.[0]), o.canSelectAllGroups && !f && (f = H()), o.canSelectAllGroups && !f && (f = H()), (o.autoselect === "placeholder" || !f) && (f = Ne()), f ??= re, r.value = f;
732
- const S = (i) => {
733
- let g;
734
- o.groups && i && (g = [...o.groups, i]), u("update:groups", g);
725
+ emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
726
+ setup(e, { emit: a }) {
727
+ const o = e, t = T(e, "folderId"), r = T(e, "folder"), l = T(e, "groupId"), n = T(e, "group"), u = a, f = pe(o.folders ?? { root: [j] }, o.canSelectAllGroups);
728
+ r.value = f.get(t.value);
729
+ let c = o.groups?.find((i) => i.id === l.value);
730
+ l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = _()), o.canSelectAllGroups && !c && (c = _()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
731
+ const x = (i) => {
732
+ let m;
733
+ o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
735
734
  };
736
- return (i, g) => (v(), T("div", bt, [
737
- e.showFolders ? (v(), j(xt, {
735
+ return (i, m) => (h(), A("div", xt, [
736
+ e.showFolders ? (h(), C(mt, {
738
737
  key: 0,
739
- folderId: l.value,
740
- "onUpdate:folderId": g[0] || (g[0] = (d) => l.value = d),
741
- folder: a.value,
742
- "onUpdate:folder": g[1] || (g[1] = (d) => a.value = d),
738
+ folderId: t.value,
739
+ "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
740
+ folder: r.value,
741
+ "onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
743
742
  projectId: e.projectId,
744
743
  folders: e.folders,
745
744
  canSelectAll: e.canSelectAllGroups,
746
745
  addChanger: e.addChanger,
747
746
  addIcon: e.addIcon,
748
747
  client: e.client
749
- }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : _("", !0),
750
- e.showGroups ? (v(), j(Bt, {
748
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
749
+ e.showGroups ? (h(), C(St, {
751
750
  key: 1,
752
- groupId: n.value,
753
- "onUpdate:groupId": g[2] || (g[2] = (d) => n.value = d),
754
- group: r.value,
755
- "onUpdate:group": g[3] || (g[3] = (d) => r.value = d),
751
+ groupId: l.value,
752
+ "onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
753
+ group: n.value,
754
+ "onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
756
755
  projectId: e.projectId,
757
- folder: a.value,
756
+ folder: r.value,
758
757
  groups: e.groups,
759
758
  on: e.on,
760
759
  canAdd: e.canAddGroup,
@@ -764,344 +763,65 @@ const xt = /* @__PURE__ */ G({
764
763
  showPath: e.showFolders && !!e.folders?.[0],
765
764
  addIcon: e.addIcon,
766
765
  client: e.client,
767
- onAddGroup: S
768
- }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : _("", !0)
766
+ onAddGroup: x
767
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : O("", !0)
769
768
  ]));
770
769
  }
771
- }), $t = { class: "top-projectSelectorSubmenu_item" }, wt = ["href", "title", "data-top-icon", "data-right"], Mt = { class: "top-projectSelectorSubmenu_item" }, Pt = ["href"], Vt = /* @__PURE__ */ G({
772
- __name: "submenu",
773
- props: {
774
- id: {},
775
- right: {},
776
- url: {}
777
- },
778
- setup(e) {
779
- const t = e, o = b();
780
- let l = [
781
- {
782
- href: `/project/keywords/${t.id}/`,
783
- title: o.Common.Menu_phrases,
784
- icon: "",
785
- right: "2"
786
- },
787
- {
788
- href: `/project/dynamics/${t.id}/`,
789
- title: o.Common.Menu_dynamics,
790
- icon: "",
791
- right: "1"
792
- },
793
- {
794
- href: `/project/snapshots/${t.id}/`,
795
- title: o.Common.Menu_snapshots,
796
- icon: "",
797
- right: "1"
798
- },
799
- {
800
- href: `/project/competitors/${t.id}/`,
801
- title: o.Common.Menu_competitors,
802
- icon: "",
803
- right: "1"
804
- },
805
- {
806
- href: `/project/analytics/${t.id}/`,
807
- title: o.Common.Menu_analytics,
808
- icon: "",
809
- right: "5"
810
- },
811
- {
812
- href: `/project/broker/${t.id}/`,
813
- title: o.Common.Menu_broker,
814
- icon: "",
815
- right: "6"
816
- },
817
- {
818
- href: `/project/audit/${t.id}/sitemap/`,
819
- title: o.Audit.Sitemap_gen,
820
- icon: "",
821
- right: "8"
822
- },
823
- {
824
- href: `/project/audit/${t.id}/audit/`,
825
- title: o.Common.Menu_audit,
826
- icon: "",
827
- right: "8"
828
- },
829
- {
830
- href: `//project/audit/${t.id}/indexing/`,
831
- title: o.Audit.Indexing,
832
- icon: "",
833
- right: "8"
834
- },
835
- {
836
- href: `/project/audit/${t.id}/watcher/`,
837
- title: o.Audit.Watcher,
838
- icon: "",
839
- right: "9"
840
- },
841
- {
842
- href: `/project/settings/${t.id}/`,
843
- title: o.Common.Menu_settings,
844
- icon: "",
845
- right: "2"
846
- }
847
- ];
848
- const a = w(() => t.right.includes("0") ? l.filter((n) => t.right[n.right] === "1") : l);
849
- return (n, r) => {
850
- const u = Ee("TopButton");
851
- return v(), j(p(he), {
852
- class: "top-projectSelectorSubmenu",
853
- notch: !1,
854
- pos: "2"
855
- }, {
856
- opener: C(() => [
857
- E(u, {
858
- class: "top-projectSelectorSubmenu_opener",
859
- "data-top-icon": "",
860
- color: "theme"
861
- })
862
- ]),
863
- contentList: C(() => [
864
- (v(!0), T(q, null, se(a.value, (c) => (v(), T("li", $t, [
865
- L("a", {
866
- href: c.href,
867
- title: c.title,
868
- "data-top-icon": c.icon,
869
- "data-right": c.right
870
- }, null, 8, wt)
871
- ]))), 256)),
872
- L("li", Mt, [
873
- L("a", {
874
- href: e.url,
875
- "data-top-icon": "",
876
- target: "_blank"
877
- }, null, 8, Pt)
878
- ])
879
- ]),
880
- _: 1
881
- });
882
- };
883
- }
884
- }), ge = (e) => ({
885
- id: null,
886
- name: e,
887
- listItemProps: {
888
- type: "title"
889
- }
890
- }), _t = (e) => {
891
- const t = b();
892
- return [
893
- { filter: (l) => l.right.startsWith("1") && l.on > 0, title: ge(t.Projects.Scheduled_update) },
894
- { filter: (l) => l.right.startsWith("1") && l.on === 0, title: ge(t.Projects.Manual_update) },
895
- { filter: (l) => l.right.startsWith("0") && l.on >= 0, title: ge(t.Projects.Guest_projects) }
896
- ].flatMap(({ filter: l, title: a }) => {
897
- const n = e.filter(l);
898
- return n.length ? [a, ...n] : [];
899
- });
900
- }, Et = (e) => e.map((t) => ({
901
- ...t,
902
- listItemProps: {
903
- class: "top-projectSelector_item",
904
- href: qe(Number(t.id)),
905
- title: t.name
906
- }
907
- })), pe = (e, t) => {
908
- if (!e) return;
909
- t && (e = e.filter((l) => l.id !== t));
910
- const o = Et(e);
911
- return _t(o);
912
- }, Gt = (e) => {
913
- if (!e) return "";
914
- let t = e;
915
- return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*\],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*\],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*\],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*\],/, ""), /%22dataSort%22:\{[^\}]*0000-00-00[^\}]*\}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^\}]*\},/, "")), t;
916
- }, qe = (e) => {
917
- const t = location.pathname.split("/");
918
- let o = "project/dynamics/", l = "";
919
- t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (l = t[4] + "/");
920
- let a = "/" + o + e + "/" + l;
921
- const n = Gt(location.hash);
922
- return a += n, a;
923
- }, we = (e) => {
924
- let t = e.startsWith("http") ? e : "http://" + e;
925
- return t = t.replace(/"/g, "%22"), t;
926
- }, Kt = (e, t) => {
927
- const o = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
928
- return o.options.onApiLoaded = (l, a, n) => {
929
- l.result = pe(l.result, t), n?.(l, a);
930
- }, o;
931
- }, Lt = (e) => e.gen("/add/projects_2/projects/"), Ot = { class: "top-projectSelector_itemText" }, Rt = { class: "top-projectSelector_itemName" }, Nt = { class: "top-projectSelector_itemId" }, qt = { key: 1 }, Dt = {
932
- key: 0,
933
- class: "top-comment"
934
- }, go = /* @__PURE__ */ G({
935
- __name: "projectSelector",
936
- props: /* @__PURE__ */ M({
937
- project: {},
938
- projects: {},
939
- userId: { default: window.mo?.user?.id },
940
- icon: {},
941
- excludeProjectId: {},
942
- placeholder: {},
943
- openerText: {},
944
- buttonProps: {},
945
- openerShortcut: {},
946
- client: {}
947
- }, {
948
- project: {
949
- default: { id: le, name: "" }
950
- },
951
- projectModifiers: {}
952
- }),
953
- emits: ["update:project"],
954
- setup(e) {
955
- const t = b(), o = e, l = w(() => o.placeholder ?? t.Projects.Select_project), a = w(() => o.openerText ?? t.Common.Projects), n = B(e, "project");
956
- n.value.name || (n.value.name = a.value);
957
- const r = o.client ? Kt(o.client, o.excludeProjectId) : void 0, u = o.client ? Lt(o.client) : void 0, c = V(pe(o.projects, o.excludeProjectId)), f = V(null);
958
- P([() => o.projects, () => o.excludeProjectId], () => {
959
- c.value = pe(o.projects, o.excludeProjectId);
960
- });
961
- const S = async (i) => {
962
- if (!u) return;
963
- const g = await u.changeParams({
964
- url: i.name,
965
- name: i.name
966
- }).call();
967
- if (!g.errors)
968
- if (o.projects) {
969
- const d = {
970
- id: Number(g.result),
971
- url: i.name,
972
- name: i.name,
973
- user_id: o.userId,
974
- on: 0,
975
- right: "11111111111111111111",
976
- listItemProps: {
977
- class: "top-projectSelector_item",
978
- href: qe(Number(g.result))
979
- }
980
- };
981
- c.value?.unshift(d);
982
- } else
983
- f.value?.resetCache(!0);
984
- };
985
- return Ue(() => {
986
- n.value.name || (n.value.name = a.value);
987
- }), (i, g) => {
988
- const d = Ee("TopButton");
989
- return v(), j(Ie, {
990
- ref_key: "refSelector",
991
- ref: f,
992
- class: "top-projectSelector",
993
- modelValue: n.value,
994
- "onUpdate:modelValue": g[1] || (g[1] = (s) => n.value = s),
995
- items: c.value,
996
- title: i.$i18n.Projects.Search_projects,
997
- icon: e.icon,
998
- modificator: "projectSelector",
999
- placeholder: l.value,
1000
- api: e.projects ? void 0 : p(r),
1001
- apiSetSearchParams: e.projects ? void 0 : (...s) => p(Se)(...s, "name"),
1002
- useCache: "",
1003
- appendSearchToResult: "",
1004
- appendSearchToResultCond: p(Ae),
1005
- buttonProps: e.buttonProps,
1006
- openerShortcut: e.openerShortcut,
1007
- onAppendItem: S
1008
- }, {
1009
- widgetAction: C(() => [
1010
- i.$core.state.isMobile ? _("", !0) : (v(), j(d, {
1011
- key: 0,
1012
- class: "top-projectSelector_cancel closer",
1013
- color: "theme"
1014
- }, {
1015
- default: C(() => [
1016
- N(A(i.$i18n.Common.Cancel), 1)
1017
- ]),
1018
- _: 1
1019
- }))
1020
- ]),
1021
- item: C(({ item: s }) => [
1022
- s.id ? (v(), T(q, { key: 0 }, [
1023
- L("div", Ot, [
1024
- L("span", Rt, A(s.name), 1),
1025
- L("span", Nt, " id " + A(s.id), 1)
1026
- ]),
1027
- E(d, {
1028
- class: "top-projectSelector_itemLink",
1029
- href: p(we)(s.url),
1030
- "data-top-icon": "",
1031
- color: "theme",
1032
- target: "_blank",
1033
- onClick: g[0] || (g[0] = D(() => {
1034
- }, ["stop"]))
1035
- }, null, 8, ["href"]),
1036
- E(Vt, {
1037
- id: s.id,
1038
- right: s.right ?? void 0,
1039
- url: p(we)(s.url)
1040
- }, null, 8, ["id", "right", "url"])
1041
- ], 64)) : (v(), T("div", qt, [
1042
- p(Ae)(s.name) ? (v(), T("div", Dt, A(i.$i18n.Projects.Add_project) + ": ", 1)) : _("", !0),
1043
- N(" " + A(s.name), 1)
1044
- ]))
1045
- ]),
1046
- _: 1
1047
- }, 8, ["modelValue", "items", "title", "icon", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
1048
- };
1049
- }
1050
- }), Me = (e) => "-" + e, X = (e) => e[0] === "-" ? e.substring(1) : e, de = (e, t) => {
1051
- e = X(e);
1052
- const o = t.find((l) => l.id === e);
770
+ }), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
771
+ e = H(e);
772
+ const o = a.find((t) => t.id === e);
1053
773
  if (o)
1054
774
  return o;
1055
- }, fo = (e, t, o) => {
1056
- t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
1057
- const l = at.genElPopupOpener("div", t);
1058
- return l.classList.add("top-tagSelector"), e.useTopButton && l.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || l.classList.add("top-tagSelector-custom"), e.mode === "filter" && l.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && l.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && l.classList.add("top-tagSelector-setter_several"), l.onclick = (a) => {
1059
- a.preventDefault(), a.stopPropagation(), l.onclick = null;
1060
- const n = V(e.modelValue), r = {
1061
- model: n,
775
+ }, Dt = (e, a, o) => {
776
+ a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
777
+ const t = Xe.genElPopupOpener("div", a);
778
+ 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) => {
779
+ r.preventDefault(), r.stopPropagation(), t.onclick = null;
780
+ const l = K(e.modelValue), n = {
781
+ model: l,
1062
782
  mode: e.mode,
1063
783
  targetId: e.targetId,
1064
784
  filters: e.filters,
1065
785
  payload: e.payload
1066
786
  };
1067
- Y(l, "topTagSelectorTarget", r), delete l.dataset.topPopupDisabled, Ce(e.modelValue) || P(n, () => {
1068
- e.modelValue = n.value, oe(l, e, o);
1069
- }), l.click();
1070
- }, Ce(e.modelValue) ? P(e.modelValue, () => oe(l, e, o)) : Y(l, "topTagSelectorRender", (a) => {
1071
- e.modelValue = a;
1072
- const n = Y(l, "topTagSelectorTarget");
1073
- n && (n.model.value = a), oe(l, e, o);
1074
- }), oe(l, e, o), l;
1075
- }, mo = (e, t) => {
1076
- Y(e, "topTagSelectorRender")?.(t);
1077
- }, oe = (e, t, o) => {
1078
- const l = p(t.modelValue);
1079
- if (e.classList.toggle("top-tagSelector-selectedOne", !l.length || l.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", l.length > 5), t.mode === "setter" && t.filters) {
787
+ W(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
788
+ e.modelValue = l.value, te(t, e, o);
789
+ }), t.click();
790
+ }, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : W(t, "topTagSelectorRender", (r) => {
791
+ e.modelValue = r;
792
+ const l = W(t, "topTagSelectorTarget");
793
+ l && (l.model.value = r), te(t, e, o);
794
+ }), te(t, e, o), t;
795
+ }, Ft = (e, a) => {
796
+ W(e, "topTagSelectorRender")?.(a);
797
+ }, te = (e, a, o) => {
798
+ const t = v(a.modelValue);
799
+ 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) {
1080
800
  e.innerHTML = `<div>${o}</div>`;
1081
801
  return;
1082
802
  }
1083
- if (e.innerHTML = "", !l.length && t.mode === "filter") {
1084
- const a = Pe({
803
+ if (e.innerHTML = "", !t.length && a.mode === "filter") {
804
+ const r = Te({
1085
805
  id: "all",
1086
806
  colorId: "",
1087
- name: b().Common?.All_tags ?? "",
807
+ name: w().Common?.All_tags ?? "",
1088
808
  state: ""
1089
809
  });
1090
- e.append(a);
810
+ e.append(r);
1091
811
  }
1092
- l.forEach((a) => {
1093
- const n = Pe({
1094
- id: X(a),
1095
- colorId: de(a, t.tags)?.color_id ?? "",
1096
- name: de(a, t.tags)?.name ?? "",
1097
- state: X(a) === a ? "selected" : "excluded"
812
+ t.forEach((r) => {
813
+ const l = Te({
814
+ id: H(r),
815
+ colorId: ie(r, a.tags)?.color_id ?? "",
816
+ name: ie(r, a.tags)?.name ?? "",
817
+ state: H(r) === r ? "selected" : "excluded"
1098
818
  });
1099
- e.append(n);
819
+ e.append(l);
1100
820
  });
1101
- }, Pe = (e) => {
1102
- const t = document.createElement("div");
1103
- return t.classList.add("top-tagSelector_tagIcon"), t.classList.toggle("top-tagSelector-active", !!e.state), t.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), t.dataset.tag_id = e.id, t.dataset.tag_color_id = e.colorId, t.title = e.name, t;
1104
- }, Ut = [
821
+ }, Te = (e) => {
822
+ const a = document.createElement("div");
823
+ 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;
824
+ }, kt = [
1105
825
  {
1106
826
  id: "1",
1107
827
  name: "Without Tag",
@@ -1152,7 +872,7 @@ const xt = /* @__PURE__ */ G({
1152
872
  name: "Turquoise",
1153
873
  color_id: "10"
1154
874
  }
1155
- ], Ft = ["data-tag_id", "data-tag_color_id", "title"], ve = /* @__PURE__ */ G({
875
+ ], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
1156
876
  __name: "tagIcon",
1157
877
  props: {
1158
878
  id: {},
@@ -1161,8 +881,8 @@ const xt = /* @__PURE__ */ G({
1161
881
  state: {}
1162
882
  },
1163
883
  setup(e) {
1164
- return (t, o) => (v(), T("div", {
1165
- class: Z({
884
+ return (a, o) => (h(), A("div", {
885
+ class: X({
1166
886
  "top-tagSelector_tagIcon": !0,
1167
887
  "top-tagSelector-active": !!e.state,
1168
888
  "top-tagSelector-excluded": e.state === "excluded"
@@ -1170,11 +890,11 @@ const xt = /* @__PURE__ */ G({
1170
890
  "data-tag_id": e.id,
1171
891
  "data-tag_color_id": e.colorId,
1172
892
  title: e.name
1173
- }, null, 10, Ft));
893
+ }, null, 10, Ct));
1174
894
  }
1175
- }), Wt = ["contenteditable", "onKeydown"], Ve = /* @__PURE__ */ G({
895
+ }), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
1176
896
  __name: "tagPopupListItem",
1177
- props: /* @__PURE__ */ M({
897
+ props: /* @__PURE__ */ V({
1178
898
  editable: { type: Boolean },
1179
899
  disabled: { type: Boolean },
1180
900
  canExclude: { type: Boolean },
@@ -1188,26 +908,26 @@ const xt = /* @__PURE__ */ G({
1188
908
  },
1189
909
  nameModifiers: {}
1190
910
  }),
1191
- emits: /* @__PURE__ */ M(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1192
- setup(e, { emit: t }) {
1193
- const o = e, l = t, a = B(e, "name"), n = V(null), r = w(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
911
+ emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
912
+ setup(e, { emit: a }) {
913
+ const o = e, t = a, r = T(e, "name"), l = K(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
1194
914
  contenteditable: u.value,
1195
- onpaste: (g) => g.preventDefault()
1196
- } : {}), u = V(!1), c = async () => {
1197
- u.value = !0, await Fe(), n.value?.focus();
1198
- }, f = () => {
1199
- const g = n.value?.innerText;
1200
- if (!g) return S();
1201
- n.value && (n.value.innerText = g), u.value = !1, l("update:name", g);
1202
- }, S = async () => {
1203
- n.value && (n.value.innerText = o.name), u.value = !1;
1204
- }, i = (g) => {
915
+ onpaste: (m) => m.preventDefault()
916
+ } : {}), u = K(!1), f = async () => {
917
+ u.value = !0, await Re(), l.value?.focus();
918
+ }, c = () => {
919
+ const m = l.value?.innerText;
920
+ if (!m) return x();
921
+ l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
922
+ }, x = async () => {
923
+ l.value && (l.value.innerText = o.name), u.value = !1;
924
+ }, i = (m) => {
1205
925
  if (u.value || o.disabled) return;
1206
926
  let d = "selected";
1207
- o.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && l("unselect"), d === "selected" && l("select"), d === "excluded" && l("exclude");
927
+ o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
1208
928
  };
1209
- return (g, d) => (v(), j(ye, {
1210
- class: Z({
929
+ return (m, d) => (h(), C(ve, {
930
+ class: X({
1211
931
  "top-tagSelector_tagListItem": !0,
1212
932
  "top-tagSelector_tagListItem-inEdit": u.value,
1213
933
  "top-tagSelector_tagListItem-disabled": e.disabled,
@@ -1215,47 +935,47 @@ const xt = /* @__PURE__ */ G({
1215
935
  "top-tagSelector-active": !!e.state,
1216
936
  "top-tagSelector-excluded": e.state === "excluded"
1217
937
  }),
1218
- onClick: D(i, ["stop"])
938
+ onClick: U(i, ["stop"])
1219
939
  }, {
1220
- default: C(() => [
1221
- E(ve, {
940
+ default: B(() => [
941
+ P(fe, {
1222
942
  id: e.id,
1223
- name: a.value,
943
+ name: r.value,
1224
944
  colorId: e.colorId,
1225
945
  state: e.state
1226
946
  }, null, 8, ["id", "name", "colorId", "state"]),
1227
- L("span", Ge({
947
+ oe("span", Ve({
1228
948
  ref_key: "elName",
1229
- ref: n,
949
+ ref: l,
1230
950
  class: "top-tagSelector_tagListItemName",
1231
951
  contenteditable: u.value ? "plaintext-only" : !1
1232
- }, r.value, {
952
+ }, n.value, {
1233
953
  onKeydown: [
1234
- je(D(f, ["stop"]), ["enter"]),
1235
- je(D(S, ["stop"]), ["esc"])
954
+ Ie(U(c, ["stop"]), ["enter"]),
955
+ Ie(U(x, ["stop"]), ["esc"])
1236
956
  ]
1237
- }), A(a.value), 17, Wt),
1238
- e.editable ? (v(), T(q, { key: 0 }, [
1239
- u.value ? (v(), T("span", {
957
+ }), b(r.value), 17, Bt),
958
+ e.editable ? (h(), A(Y, { key: 0 }, [
959
+ u.value ? (h(), A("span", {
1240
960
  key: 1,
1241
961
  "data-top-icon": "",
1242
962
  class: "top-tagSelector_edit",
1243
- onClick: D(f, ["stop"])
1244
- })) : (v(), T("span", {
963
+ onClick: U(c, ["stop"])
964
+ })) : (h(), A("span", {
1245
965
  key: 0,
1246
966
  "data-top-icon": "",
1247
967
  class: "top-tagSelector_edit",
1248
- onClick: c
968
+ onClick: f
1249
969
  }))
1250
- ], 64)) : _("", !0)
970
+ ], 64)) : O("", !0)
1251
971
  ]),
1252
972
  _: 1
1253
973
  }, 8, ["class"]));
1254
974
  }
1255
- }), zt = { key: 1 }, Jt = /* @__PURE__ */ G({
975
+ }), Tt = { key: 1 }, At = /* @__PURE__ */ R({
1256
976
  inheritAttrs: !1,
1257
977
  __name: "popupOpener",
1258
- props: /* @__PURE__ */ M({
978
+ props: /* @__PURE__ */ V({
1259
979
  modelValue: {},
1260
980
  id: {},
1261
981
  tags: {},
@@ -1273,61 +993,61 @@ const xt = /* @__PURE__ */ G({
1273
993
  }),
1274
994
  emits: ["update:modelValue"],
1275
995
  setup(e) {
1276
- const t = e, o = B(e, "modelValue"), l = t.useTopButton ? Q : "div", a = t.useTopButton ? "html" : "default", n = {
996
+ const a = e, o = T(e, "modelValue"), t = a.useTopButton ? Q : "div", r = a.useTopButton ? "html" : "default", l = {
1277
997
  model: o,
1278
- mode: t.mode,
1279
- targetId: t.targetId,
1280
- filters: t.filters,
1281
- payload: t.payload
998
+ mode: a.mode,
999
+ targetId: a.targetId,
1000
+ filters: a.filters,
1001
+ payload: a.payload
1282
1002
  };
1283
- return (r, u) => {
1284
- const c = We("top-data");
1285
- return v(), j(Ze, { id: e.id }, {
1286
- default: C(() => [
1287
- ze((v(), j(Je(p(l)), Ge({
1003
+ return (n, u) => {
1004
+ const f = Pe("top-data");
1005
+ return h(), C(Je, { id: e.id }, {
1006
+ default: B(() => [
1007
+ Ne((h(), C(qe(v(t)), Ve({
1288
1008
  class: {
1289
1009
  "top-tagSelector": !0,
1290
- "top-tagSelector-useTopButton": t.useTopButton,
1291
- "top-tagSelector-custom": !t.useTopButton,
1292
- "top-as-selector": t.useTopButton,
1293
- "top-tagSelector-filter": t.mode === "filter",
1294
- "top-tagSelector-setter_single": t.mode === "setter" && !e.filters,
1295
- "top-tagSelector-setter_several": t.mode === "setter" && e.filters,
1010
+ "top-tagSelector-useTopButton": a.useTopButton,
1011
+ "top-tagSelector-custom": !a.useTopButton,
1012
+ "top-as-selector": a.useTopButton,
1013
+ "top-tagSelector-filter": a.mode === "filter",
1014
+ "top-tagSelector-setter_single": a.mode === "setter" && !e.filters,
1015
+ "top-tagSelector-setter_several": a.mode === "setter" && e.filters,
1296
1016
  "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
1297
1017
  "top-tagSelector-toTwoLine": o.value.length > 5
1298
1018
  },
1299
1019
  color: "theme",
1300
1020
  styling: e.styling
1301
- }, r.$attrs), {
1302
- [p(a)]: C(() => [
1303
- !o.value.length && e.mode === "filter" ? (v(), j(ve, {
1021
+ }, n.$attrs), {
1022
+ [v(r)]: B(() => [
1023
+ !o.value.length && e.mode === "filter" ? (h(), C(fe, {
1304
1024
  key: 0,
1305
1025
  id: "all",
1306
1026
  colorId: "",
1307
- name: r.$i18n.Common.All_tags ?? "",
1027
+ name: n.$i18n.Common.All_tags ?? "",
1308
1028
  state: ""
1309
- }, null, 8, ["name"])) : _("", !0),
1310
- e.mode === "setter" && e.filters ? (v(), T("div", zt, [
1311
- Ye(r.$slots, "default")
1312
- ])) : (v(!0), T(q, { key: 2 }, se(o.value, (f) => (v(), j(ve, {
1313
- id: p(X)(f),
1314
- colorId: p(de)(f, e.tags)?.color_id ?? "",
1315
- name: p(de)(f, e.tags)?.name ?? "",
1316
- state: p(X)(f) === f ? "selected" : "excluded"
1029
+ }, null, 8, ["name"])) : O("", !0),
1030
+ e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
1031
+ De(n.$slots, "default")
1032
+ ])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
1033
+ id: v(H)(c),
1034
+ colorId: v(ie)(c, e.tags)?.color_id ?? "",
1035
+ name: v(ie)(c, e.tags)?.name ?? "",
1036
+ state: v(H)(c) === c ? "selected" : "excluded"
1317
1037
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1318
1038
  ]),
1319
1039
  _: 2
1320
1040
  }, 1040, ["class", "styling"])), [
1321
- [c, n, "topTagSelectorTarget"]
1041
+ [f, l, "topTagSelectorTarget"]
1322
1042
  ])
1323
1043
  ]),
1324
1044
  _: 3
1325
1045
  }, 8, ["id"]);
1326
1046
  };
1327
1047
  }
1328
- }), po = /* @__PURE__ */ G({
1048
+ }), Ut = /* @__PURE__ */ R({
1329
1049
  __name: "tagSelector",
1330
- props: /* @__PURE__ */ M({
1050
+ props: /* @__PURE__ */ V({
1331
1051
  modelValue: {},
1332
1052
  tags: {},
1333
1053
  tagsEditable: { type: Boolean },
@@ -1345,177 +1065,177 @@ const xt = /* @__PURE__ */ G({
1345
1065
  },
1346
1066
  modelModifiers: {},
1347
1067
  tags: {
1348
- default: _e(Ut)
1068
+ default: be(kt)
1349
1069
  },
1350
1070
  tagsModifiers: {}
1351
1071
  }),
1352
- emits: /* @__PURE__ */ M(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1353
- setup(e, { emit: t }) {
1354
- const o = b(), l = e, a = B(e, "modelValue"), n = B(e, "tags"), r = t, u = Xe((h, I) => {
1355
- r(h, I);
1356
- }, l.emitDelay);
1357
- l.singleMode && !a.value.length && (a.value = [n.value[0].id]);
1358
- const c = l.id ?? "top-popup-id-" + Math.random(), f = V("add"), S = () => {
1359
- const h = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1360
- return I.set("add", { value: "add", title: o.Common.Add + h }), I.set("replace", { value: "replace", title: o.Common.Replace + h }), I.set("delete", { value: "delete", title: o.Common.Delete + h }), I;
1072
+ emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1073
+ setup(e, { emit: a }) {
1074
+ const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
1075
+ n(p, I);
1076
+ }, t.emitDelay);
1077
+ t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1078
+ const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
1079
+ const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1080
+ 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;
1361
1081
  };
1362
- let i = He({
1363
- model: a,
1082
+ let i = Fe({
1083
+ model: r,
1364
1084
  mode: "filter",
1365
1085
  targetId: void 0,
1366
1086
  filters: void 0,
1367
1087
  payload: void 0
1368
1088
  });
1369
- P(a, () => {
1370
- u("selector", a.value);
1089
+ E(r, () => {
1090
+ u("selector", r.value);
1371
1091
  });
1372
- const g = w(() => {
1373
- if (i.value.mode === "setter" && l.maxTagsForSetter && !i.value.filters)
1374
- return i.value.model.value.length >= l.maxTagsForSetter;
1375
- }), d = (h) => {
1376
- if (h !== "all") {
1377
- if (i.value.model.value.includes(h)) return "selected";
1378
- if (i.value.model.value.includes(Me(h))) return "excluded";
1092
+ const m = M(() => {
1093
+ if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1094
+ return i.value.model.value.length >= t.maxTagsForSetter;
1095
+ }), d = (p) => {
1096
+ if (p !== "all") {
1097
+ if (i.value.model.value.includes(p)) return "selected";
1098
+ if (i.value.model.value.includes(Be(p))) return "excluded";
1379
1099
  }
1380
- return h === "all" && !i.value.model.value.length ? "selected" : "";
1381
- }, s = (h, I) => {
1382
- const x = Me(h);
1383
- let k = i.value.model.value.filter((K) => K !== h && K !== x);
1384
- I === "select" && k.push(h), I === "exclude" && k.push(x), i.value.mode === "setter" && i.value.targetId !== void 0 && l.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"))), l.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, te) => {
1385
- if (!l.tags) return 0;
1386
- const F = l.tags.findIndex((z) => z.id === K), W = l.tags.findIndex((z) => z.id === te);
1387
- return F - W;
1100
+ return p === "all" && !i.value.model.value.length ? "selected" : "";
1101
+ }, s = (p, I) => {
1102
+ const S = Be(p);
1103
+ let k = i.value.model.value.filter((G) => G !== p && G !== S);
1104
+ 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((G) => G !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((G, ee) => {
1105
+ if (!t.tags) return 0;
1106
+ const q = t.tags.findIndex((F) => F.id === G), D = t.tags.findIndex((F) => F.id === ee);
1107
+ return q - D;
1388
1108
  }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1389
1109
  tagsIds: k,
1390
1110
  targetId: i.value.targetId,
1391
1111
  payload: i.value.payload
1392
1112
  });
1393
- }, m = w(() => {
1394
- let h = "top-tagSelector_popup";
1395
- return i.value.mode === "filter" && (h += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (h += " top-tagSelector_popup-setter"), h;
1396
- }), ee = () => {
1397
- const h = prompt("", "New tag");
1398
- if (!h || h === "New tag") return;
1399
- const I = n.value.length + 1;
1400
- n.value.push({
1113
+ }, g = M(() => {
1114
+ let p = "top-tagSelector_popup";
1115
+ return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
1116
+ }), Z = () => {
1117
+ const p = prompt("", "New tag");
1118
+ if (!p || p === "New tag") return;
1119
+ const I = l.value.length + 1;
1120
+ l.value.push({
1401
1121
  id: String(I),
1402
- name: h,
1122
+ name: p,
1403
1123
  color_id: String((I - 1) % 10 + 1)
1404
- }), r("tagsChanged", n.value);
1405
- }, U = (h) => {
1406
- if (i.value = Y(h.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1407
- if (i.value.filters && (f.value = "add", i.value.model.value = []), !J.$?.ui.sortable) {
1124
+ }), n("tagsChanged", l.value);
1125
+ }, N = (p) => {
1126
+ if (i.value = W(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1127
+ if (i.value.filters && (c.value = "add", i.value.model.value = []), !z.$?.ui.sortable) {
1408
1128
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1409
1129
  return;
1410
1130
  }
1411
- !J.state.isMobile && !J.state.isMobileUA && n.value && $(h.elPopup).sortable({
1131
+ !z.state.isMobile && !z.state.isMobileUA && l.value && $(p.elPopup).sortable({
1412
1132
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
1413
1133
  /**
1414
1134
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
1415
1135
  */
1416
1136
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
1417
1137
  distance: 10,
1418
- stop: function(I, x) {
1419
- if (!n.value) return;
1420
- const k = $(x.item).parent().find("[data-tag_id]"), K = [];
1421
- k.each((te, F) => {
1422
- if (!n.value) return;
1423
- const W = $(F).attr("data-tag_id");
1424
- K.push(W);
1425
- }), n.value.sort((te, F) => {
1426
- const W = K.findIndex((ue) => ue === te.id), z = K.findIndex((ue) => ue === F.id);
1427
- return W - z;
1428
- }), u("tagsChanged", n.value);
1138
+ stop: function(I, S) {
1139
+ if (!l.value) return;
1140
+ const k = $(S.item).parent().find("[data-tag_id]"), G = [];
1141
+ k.each((ee, q) => {
1142
+ if (!l.value) return;
1143
+ const D = $(q).attr("data-tag_id");
1144
+ G.push(D);
1145
+ }), l.value.sort((ee, q) => {
1146
+ const D = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === q.id);
1147
+ return D - F;
1148
+ }), u("tagsChanged", l.value);
1429
1149
  }
1430
1150
  });
1431
- }, De = (h) => {
1432
- J.$?.ui.sortable && $(h.elPopup).data("ui-sortable") && $(h.elPopup).sortable("destroy");
1151
+ }, je = (p) => {
1152
+ z.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
1433
1153
  };
1434
- return (h, I) => (v(), T(q, null, [
1435
- E(Jt, {
1436
- modelValue: a.value,
1437
- "onUpdate:modelValue": I[0] || (I[0] = (x) => a.value = x),
1438
- id: p(c),
1439
- tags: n.value,
1154
+ return (p, I) => (h(), A(Y, null, [
1155
+ P(At, {
1156
+ modelValue: r.value,
1157
+ "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
1158
+ id: v(f),
1159
+ tags: l.value,
1440
1160
  styling: e.styling,
1441
1161
  mode: "filter",
1442
1162
  useTopButton: e.useTopButton
1443
1163
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1444
- E(he, {
1445
- id: p(c),
1446
- class: Z(m.value),
1447
- onOpen: I[4] || (I[4] = (x) => U(x)),
1448
- onClose: I[5] || (I[5] = (x) => De(x)),
1164
+ P(we, {
1165
+ id: v(f),
1166
+ class: X(g.value),
1167
+ onOpen: I[4] || (I[4] = (S) => N(S)),
1168
+ onClose: I[5] || (I[5] = (S) => je(S)),
1449
1169
  "transition-duration": 50
1450
- }, Qe({
1451
- contentList: C(() => [
1452
- p(i).mode === "filter" && !e.singleMode ? (v(), j(Ve, {
1170
+ }, Ue({
1171
+ contentList: B(() => [
1172
+ v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
1453
1173
  key: 0,
1454
1174
  id: "all",
1455
1175
  colorId: "",
1456
- name: h.$i18n.Common.All_tags ?? "",
1457
- state: p(i).model.value.length ? "" : "selected",
1458
- onSelect: I[3] || (I[3] = (x) => p(i).model.value = [])
1459
- }, null, 8, ["name", "state"])) : _("", !0),
1460
- (v(!0), T(q, null, se(n.value, (x) => (v(), j(Ve, {
1461
- key: x.id,
1462
- id: x.id,
1463
- colorId: x.color_id,
1464
- name: x.name,
1465
- state: d(x.id),
1466
- canExclude: p(i).mode === "filter" && !e.singleMode,
1176
+ name: p.$i18n.Common.All_tags ?? "",
1177
+ state: v(i).model.value.length ? "" : "selected",
1178
+ onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
1179
+ }, null, 8, ["name", "state"])) : O("", !0),
1180
+ (h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
1181
+ key: S.id,
1182
+ id: S.id,
1183
+ colorId: S.color_id,
1184
+ name: S.name,
1185
+ state: d(S.id),
1186
+ canExclude: v(i).mode === "filter" && !e.singleMode,
1467
1187
  editable: e.tagsEditable,
1468
- disabled: g.value && d(x.id) === "",
1469
- onUnselect: (k) => s(x.id, "unselect"),
1470
- onSelect: (k) => s(x.id, "select"),
1471
- onExclude: (k) => s(x.id, "exclude"),
1188
+ disabled: m.value && d(S.id) === "",
1189
+ onUnselect: (k) => s(S.id, "unselect"),
1190
+ onSelect: (k) => s(S.id, "select"),
1191
+ onExclude: (k) => s(S.id, "exclude"),
1472
1192
  "onUpdate:name": (k) => {
1473
- x.name = k, p(u)("tagsChanged", n.value);
1193
+ S.name = k, v(u)("tagsChanged", l.value);
1474
1194
  }
1475
1195
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1476
- e.tagsEditable && n.value.length < e.tagsMax && n.value.length < 20 ? (v(), j(ye, {
1196
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
1477
1197
  key: 1,
1478
1198
  "data-top-icon": "",
1479
- onClick: D(ee, ["stop"])
1199
+ onClick: U(Z, ["stop"])
1480
1200
  }, {
1481
- default: C(() => [
1482
- N(A(h.$i18n.Common.Add), 1)
1201
+ default: B(() => [
1202
+ J(b(p.$i18n.Common.Add), 1)
1483
1203
  ]),
1484
1204
  _: 1
1485
- })) : _("", !0)
1205
+ })) : O("", !0)
1486
1206
  ]),
1487
1207
  _: 2
1488
1208
  }, [
1489
- p(i).mode === "setter" && p(i).filters ? {
1209
+ v(i).mode === "setter" && v(i).filters ? {
1490
1210
  name: "header",
1491
- fn: C(() => [
1492
- E(fe, {
1493
- modelValue: f.value,
1494
- "onUpdate:modelValue": I[1] || (I[1] = (x) => f.value = x),
1495
- options: S()
1211
+ fn: B(() => [
1212
+ P(ce, {
1213
+ modelValue: c.value,
1214
+ "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
1215
+ options: x()
1496
1216
  }, null, 8, ["modelValue", "options"])
1497
1217
  ]),
1498
1218
  key: "0"
1499
1219
  } : void 0,
1500
- p(i).mode === "setter" && p(i).filters ? {
1220
+ v(i).mode === "setter" && v(i).filters ? {
1501
1221
  name: "footer",
1502
- fn: C(() => [
1503
- E(Q, { color: "theme" }, {
1504
- default: C(() => [
1505
- N(A(h.$i18n.Common.Cancel2), 1)
1222
+ fn: B(() => [
1223
+ P(Q, { color: "theme" }, {
1224
+ default: B(() => [
1225
+ J(b(p.$i18n.Common.Cancel), 1)
1506
1226
  ]),
1507
1227
  _: 1
1508
1228
  }),
1509
- E(Q, {
1510
- onClick: I[2] || (I[2] = (x) => p(u)("setter", {
1511
- tagsIds: p(i).model.value,
1512
- filters: p(i).filters,
1513
- filtersAction: f.value,
1514
- payload: p(i).payload
1229
+ P(Q, {
1230
+ onClick: I[2] || (I[2] = (S) => v(u)("setter", {
1231
+ tagsIds: v(i).model.value,
1232
+ filters: v(i).filters,
1233
+ filtersAction: c.value,
1234
+ payload: v(i).payload
1515
1235
  }))
1516
1236
  }, {
1517
- default: C(() => [
1518
- N(A(f.value === "add" ? h.$i18n.Common.Add : "") + " " + A(f.value === "replace" ? h.$i18n.Common.Replace : "") + " " + A(f.value === "delete" ? h.$i18n.Common.Delete : ""), 1)
1237
+ default: B(() => [
1238
+ J(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)
1519
1239
  ]),
1520
1240
  _: 1
1521
1241
  })
@@ -1527,18 +1247,17 @@ const xt = /* @__PURE__ */ G({
1527
1247
  }
1528
1248
  });
1529
1249
  export {
1530
- io as TopCompetitorSelector,
1531
- co as TopGroupSelector,
1532
- go as TopProjectSelector,
1533
- uo as TopRegionSelector,
1534
- po as TopTagSelector,
1535
- Jt as TopTagSelectorPopupOpener,
1536
- ve as TopTagSelectorTagIcon,
1537
- mt as dialogRegionSelector,
1538
- ft as findRegion,
1539
- fo as genElTopTagSelectorPopupOpener,
1540
- Oe as genSearcherByKey,
1541
- mo as renderElTopTagSelectorPopupOpener,
1542
- so as useItemsFromCompetitors
1250
+ Rt as TopCompetitorSelector,
1251
+ qt as TopGroupSelector,
1252
+ Nt as TopRegionSelector,
1253
+ Ut as TopTagSelector,
1254
+ At as TopTagSelectorPopupOpener,
1255
+ fe as TopTagSelectorTagIcon,
1256
+ it as dialogRegionSelector,
1257
+ rt as findRegion,
1258
+ Dt as genElTopTagSelectorPopupOpener,
1259
+ Ke as genSearcherByKey,
1260
+ Ft as renderElTopTagSelectorPopupOpener,
1261
+ Pt as useItemsFromCompetitors
1543
1262
  };
1544
1263
  //# sourceMappingURL=project.js.map