@topvisor/ui 1.4.3-fixTabsView.1 → 1.4.3-fixTabsView.3

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.
@@ -3,23 +3,23 @@
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 K, useModel as P, computed as E, openBlock as h, createElementBlock as j, unref as v, createBlock as A, withCtx as B, Fragment as F, renderList as pe, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as W, mergeModels as G, toValue as be, ref as _, watch as L, createCommentVNode as M, reactive as De, resolveComponent as Fe, shallowRef as qe, onMounted as et, withModifiers as H, isRef as Pe, mergeProps as We, withKeys as Ee, nextTick as tt, resolveDirective as ot, withDirectives as at, resolveDynamicComponent as lt, renderSlot as nt, createSlots as rt } from "vue";
7
- import { u as w, C as X, e as ee, q as xe, d as it } from "../.chunks/forms-DtC-EKJL.es.js";
8
- import { _ as je, a as Ae, b as dt } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js";
9
- import { _ as st, b as Be, c as He, I as Je, a as ye } from "../.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js";
10
- import { u as ut } from "../.chunks/utils-BNzP9anP.es.js";
11
- import { getSearcherGIcon as ct, getLangLabel as ft, getDeviceGIcon as gt } from "../utils/searchers.js";
6
+ import { defineComponent as K, useModel as P, computed as E, openBlock as h, createElementBlock as A, unref as m, createBlock as j, withCtx as B, Fragment as F, renderList as ve, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as H, mergeModels as L, toValue as Pe, ref as _, watch as G, createCommentVNode as M, reactive as qe, resolveComponent as We, shallowRef as He, onMounted as lt, withModifiers as W, isRef as Ee, mergeProps as Je, withKeys as Me, nextTick as nt, resolveDirective as rt, withDirectives as it, resolveDynamicComponent as st, renderSlot as dt, createSlots as ut } from "vue";
7
+ import { u as w, C as X, e as ee, q as Ce, d as ct } from "../.chunks/forms-DtC-EKJL.es.js";
8
+ import { _ as je, a as Be, b as ft } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js";
9
+ import { _ as gt, b as $e, c as ze, I as Ye, a as ye } from "../.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js";
10
+ import { u as mt } from "../.chunks/utils-BNzP9anP.es.js";
11
+ import { getSearcherGIcon as pt, getLangLabel as vt, getDeviceGIcon as ht } from "../utils/searchers.js";
12
12
  import "../.chunks/core-Dgj_YGWh.es.js";
13
13
  import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js";
14
14
  import { g as ie, a as le } from "../.chunks/field-CyyFzM-Y.es.js";
15
- import { validUrl as mt } from "../utils/check.js";
16
- import { ellipsis as vt } from "../utils/string.js";
17
- import { invertKeyboardLayout as pt } from "../utils/keyboard.js";
15
+ import { validUrl as yt } from "../utils/check.js";
16
+ import { ellipsis as St } from "../utils/string.js";
17
+ import { TopPopupWorker as Qe } from "../popup/worker.js";
18
+ import { invertKeyboardLayout as It } from "../utils/keyboard.js";
18
19
  import { storage as Z } from "../utils/dom.js";
19
- import { TopPopupWorker as ht } from "../popup/worker.js";
20
- const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" }, Bo = /* @__PURE__ */ K({
20
+ const xt = { class: "top-competitorSelector" }, Ct = { class: "top-ellipsis1" }, wo = /* @__PURE__ */ K({
21
21
  __name: "competitorSelector",
22
- props: /* @__PURE__ */ G({
22
+ props: /* @__PURE__ */ L({
23
23
  modelValue: {},
24
24
  items: {},
25
25
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -38,8 +38,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
38
38
  content: ""
39
39
  };
40
40
  });
41
- return (n, l) => (h(), j("div", yt, [
42
- v(X).state.isMobile ? (h(), A(je, { key: 0 }, {
41
+ return (n, l) => (h(), A("div", xt, [
42
+ m(X).state.isMobile ? (h(), j(je, { key: 0 }, {
43
43
  opener: B(() => [
44
44
  U(ee, {
45
45
  class: "top-competitorSelector_opener",
@@ -48,13 +48,13 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
48
48
  icon2: ""
49
49
  }, {
50
50
  default: B(() => [
51
- W(b(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
51
+ H(b(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
52
52
  ]),
53
53
  _: 1
54
54
  })
55
55
  ]),
56
56
  contentList: B(() => [
57
- (h(!0), j(F, null, pe(e.items, (r) => (h(), A(Ae, {
57
+ (h(!0), A(F, null, ve(e.items, (r) => (h(), j(Be, {
58
58
  class: oe({
59
59
  "top-active": o.value?.includes(r.value)
60
60
  }),
@@ -63,13 +63,13 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
63
63
  onClick: () => o.value = [r.value]
64
64
  }, {
65
65
  default: B(() => [
66
- N("span", St, b(r.content), 1)
66
+ N("span", Ct, b(r.content), 1)
67
67
  ]),
68
68
  _: 2
69
69
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
70
70
  ]),
71
71
  _: 1
72
- })) : (h(), A(st, {
72
+ })) : (h(), j(gt, {
73
73
  key: 1,
74
74
  modelValue: o.value,
75
75
  "onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r),
@@ -81,12 +81,12 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
81
81
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
82
82
  ]));
83
83
  }
84
- }), wo = (e, t) => E(() => be(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
84
+ }), bo = (e, t) => E(() => Pe(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
85
85
  value: n.id,
86
86
  title: n.url + ` [${n.id}]`,
87
- icon: n.id === be(t) ? "" : "",
87
+ icon: n.id === Pe(t) ? "" : "",
88
88
  content: n.name
89
- }))), D = -1, S = -2, de = -1, It = {
89
+ }))), D = -1, S = -2, se = -1, kt = {
90
90
  0: "Yandex",
91
91
  1: "Google",
92
92
  4: "YouTube",
@@ -96,44 +96,44 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
96
96
  9: "GoogleStore",
97
97
  20: "Yandex.com",
98
98
  21: "Yandex.com.tr"
99
- }, Me = {
99
+ }, _e = {
100
100
  key: S,
101
101
  name: "--",
102
102
  index: S
103
- }, ze = {
103
+ }, Xe = {
104
104
  key: S,
105
105
  name: "--",
106
- regions: [Me],
107
- regionByIndex: /* @__PURE__ */ new Map([[S, Me]])
108
- }, se = {
106
+ regions: [_e],
107
+ regionByIndex: /* @__PURE__ */ new Map([[S, _e]])
108
+ }, de = {
109
109
  key: S,
110
110
  name: "Autoselect",
111
111
  index: S
112
112
  }, Se = {
113
113
  key: S,
114
114
  name: "Autoselect",
115
- regions: [se],
116
- regionByIndex: /* @__PURE__ */ new Map([[S, se]])
117
- }, _e = {
115
+ regions: [de],
116
+ regionByIndex: /* @__PURE__ */ new Map([[S, de]])
117
+ }, Ve = {
118
118
  countryCode: "00",
119
119
  depth: 1,
120
120
  device: 0,
121
- key: de,
122
- index: de,
121
+ key: se,
122
+ index: se,
123
123
  lang: "ru",
124
124
  name: "Without region"
125
- }, xt = () => (se.name = w().Common.Autoselect, se), Ct = () => (xt(), Se.name = w().Common.Autoselect, console.log(Se), Se), kt = () => (_e.name = w().Keywords.Without_region, _e), Ye = (e = !1, t = !1, o = []) => {
125
+ }, Tt = () => (de.name = w().Common.Autoselect, de), At = () => (Tt(), Se.name = w().Common.Autoselect, console.log(Se), Se), jt = () => (Ve.name = w().Keywords.Without_region, Ve), Ze = (e = !1, t = !1, o = []) => {
126
126
  let a;
127
- return e ? a = Tt(o) : a = Qe(o), t && a.set(S, Ct()), a.size || a.set(S, ze), a;
128
- }, Qe = (e, t = !0, o = [], a = !1) => {
127
+ return e ? a = Bt(o) : a = et(o), t && a.set(S, At()), a.size || a.set(S, Xe), a;
128
+ }, et = (e, t = !0, o = [], a = !1) => {
129
129
  const n = /* @__PURE__ */ new Map();
130
130
  return e.forEach((l) => {
131
131
  if (!l.enabled || a && typeof l.key == "number" && l.key > 1) return;
132
132
  const r = { ...l };
133
133
  r.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((i) => {
134
134
  if (t && !i.enabled) return;
135
- const u = { ...i };
136
- r.regionByIndex.set(u.index, u);
135
+ const f = { ...i };
136
+ r.regionByIndex.set(f.index, f);
137
137
  }), !r.regionByIndex.size && o.length, // режим вывода ПС без регионов
138
138
  (!l.regions || // есть включенные регионы
139
139
  r.regionByIndex.size || // запрошен вывод конкретных ПС
@@ -142,25 +142,25 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
142
142
  if (n.has(l)) return;
143
143
  const r = {
144
144
  key: l,
145
- name: It[l],
145
+ name: kt[l],
146
146
  regions: [],
147
147
  regionByIndex: /* @__PURE__ */ new Map()
148
148
  };
149
149
  n.set(r.key, r);
150
150
  }), n;
151
- }, Tt = (e) => {
152
- const t = Qe(e, !1, [0, 1], !0);
151
+ }, Bt = (e) => {
152
+ const t = et(e, !1, [0, 1], !0);
153
153
  if (t.has(2)) {
154
154
  const o = t.get(2);
155
155
  o && (o.regionByIndex = /* @__PURE__ */ new Map());
156
156
  }
157
157
  return t.forEach((o) => {
158
158
  if (!o.regionByIndex) return;
159
- const a = { ...kt() };
159
+ const a = { ...jt() };
160
160
  o.regionByIndex.set(a.index, a);
161
161
  }), t;
162
- }, jt = (e, t, o = []) => {
163
- const a = Ye(e, !1, o);
162
+ }, $t = (e, t, o = []) => {
163
+ const a = Ze(e, !1, o);
164
164
  let n;
165
165
  return a.forEach((l) => {
166
166
  if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
@@ -169,7 +169,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
169
169
  }), n))
170
170
  return !1;
171
171
  }), n;
172
- }, At = ut(() => import("../.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js")), Bt = (e, t) => {
172
+ }, wt = mt(() => import("../.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js")), bt = (e, t) => {
173
173
  const o = w(), a = _(t.value.keys().next().value ?? S), n = E(() => {
174
174
  const l = /* @__PURE__ */ new Map();
175
175
  if (t.value.forEach((r) => {
@@ -177,7 +177,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
177
177
  value: r.key,
178
178
  title: r.name
179
179
  };
180
- e.addSearcherIcon && (i.icon = ct(r.key)), l.set(r.key, i);
180
+ e.addSearcherIcon && (i.icon = pt(r.key)), l.set(r.key, i);
181
181
  }), e.addCompare && !l.has(S)) {
182
182
  const r = {
183
183
  value: "",
@@ -197,7 +197,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
197
197
  searcherKey: a,
198
198
  optionBySearcherKey: n
199
199
  };
200
- }, wt = (e, t) => {
200
+ }, Pt = (e, t) => {
201
201
  const o = w(), a = _(S);
202
202
  e.modelValue.length === 1 && (a.value = e.modelValue[0]), a.value === S && (e.forFrequency ? a.value = t.value?.regionByIndex.values().next().value?.key ?? S : a.value = t.value?.regionByIndex.keys().next().value ?? S);
203
203
  const n = E(() => {
@@ -205,25 +205,25 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
205
205
  return t.value.regionByIndex?.forEach((r) => {
206
206
  let i = r.name;
207
207
  if (e.forFrequency) {
208
- const x = {
208
+ const C = {
209
209
  value: r.key,
210
210
  title: i
211
211
  };
212
- l.has(r.key) || l.set(r.key, x);
212
+ l.has(r.key) || l.set(r.key, C);
213
213
  return;
214
214
  }
215
215
  r.device && (i += " (" + o.Common["Device_" + r.device] + ")");
216
- const u = ft(t.value.key || 0, r.lang ?? "");
217
- u && (i += " / " + u);
218
- const g = {
216
+ const f = vt(t.value.key || 0, r.lang ?? "");
217
+ f && (i += " / " + f);
218
+ const u = {
219
219
  value: r.index,
220
220
  title: i,
221
- icon: r.device ? gt(r.device) : void 0
221
+ icon: r.device ? ht(r.device) : void 0
222
222
  };
223
- l.set(r.index, g);
223
+ l.set(r.index, u);
224
224
  }), l;
225
225
  });
226
- return L(n, (l, r) => {
226
+ return G(n, (l, r) => {
227
227
  if (e.onlySearcher || a.value !== void 0 && l.get(a.value))
228
228
  return;
229
229
  let i = l.keys().next().value;
@@ -231,25 +231,25 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
231
231
  a.value = i;
232
232
  return;
233
233
  }
234
- let u = r?.get(a.value)?.title || "", g = -1;
235
- for (const [x, d] of l.entries()) {
236
- const f = d.title;
237
- if (typeof f != "string" || typeof x == "string")
234
+ let f = r?.get(a.value)?.title || "", u = -1;
235
+ for (const [C, s] of l.entries()) {
236
+ const g = s.title;
237
+ if (typeof g != "string" || typeof C == "string")
238
238
  break;
239
- if (f === u) {
240
- i = x;
239
+ if (g === f) {
240
+ i = C;
241
241
  break;
242
242
  }
243
- const s = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
244
- let c = u, m = 3;
245
- f.indexOf(c) === -1 && (c = u.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), m--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), f.indexOf(c) !== -1 && (m <= g || (g = m, i = x));
243
+ const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
244
+ let c = f, p = 3;
245
+ g.indexOf(c) === -1 && (c = f.replace(/^[^a-zа-я]/i, "").replace(d, ""), p--), g.indexOf(c) === -1 && (c = f.replace(/ \/.*/, ""), p--), g.indexOf(c) === -1 && (c = f.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(d, ""), p--), g.indexOf(c) !== -1 && (p <= u || (u = p, i = C));
246
246
  }
247
247
  a.value = i;
248
248
  }), {
249
249
  regionIndex: a,
250
250
  optionByRegionIndex: n
251
251
  };
252
- }, $t = (e, t, o) => {
252
+ }, Et = (e, t, o) => {
253
253
  const a = _([]), n = () => {
254
254
  if (e.onlySearcher && t.value) {
255
255
  a.value = Array.from(t.value.keys());
@@ -269,51 +269,51 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
269
269
  }, l = () => {
270
270
  a.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(a.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
271
271
  };
272
- return L(a, () => {
272
+ return G(a, () => {
273
273
  l();
274
274
  }), e.addCompare && n(), {
275
275
  regionsIndexes: a
276
276
  };
277
- }, bt = (e) => {
278
- const t = E(() => Ye(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => t.value.get(n.searcherKey.value) || ze), a = E(() => {
279
- const d = /* @__PURE__ */ new Set();
280
- return t.value.forEach((f) => {
281
- f.regionByIndex.forEach((s) => {
282
- s.index !== de && s.index !== S && d.add(s.index);
277
+ }, Mt = (e) => {
278
+ const t = E(() => Ze(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => t.value.get(n.searcherKey.value) || Xe), a = E(() => {
279
+ const s = /* @__PURE__ */ new Set();
280
+ return t.value.forEach((g) => {
281
+ g.regionByIndex.forEach((d) => {
282
+ d.index !== se && d.index !== S && s.add(d.index);
283
283
  });
284
- }), d;
285
- }), n = Bt(e, t), l = wt(e, o), r = $t(e, t, a);
286
- L(t, () => {
287
- if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((f) => a.value.has(f)), n.searcherKey.value === D) return;
288
- let d = t.value.keys().next().value;
289
- t.value.forEach((f) => {
290
- if (e.onlySearcher && f.key === n.searcherKey.value) {
291
- d = n.searcherKey.value;
284
+ }), s;
285
+ }), n = bt(e, t), l = Pt(e, o), r = Et(e, t, a);
286
+ G(t, () => {
287
+ if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((g) => a.value.has(g)), n.searcherKey.value === D) return;
288
+ let s = t.value.keys().next().value;
289
+ t.value.forEach((g) => {
290
+ if (e.onlySearcher && g.key === n.searcherKey.value) {
291
+ s = n.searcherKey.value;
292
292
  return;
293
293
  }
294
- if (l.regionIndex.value && f.regionByIndex?.has(l.regionIndex.value) && (d = f.key), !e.onlySearcher) {
295
- let s;
296
- d !== void 0 && (s = t.value.get(d)?.regionByIndex);
297
- const c = t.value.get(f.key)?.regionByIndex;
298
- s?.has(S) && !c?.has(S) && (d = f.key);
294
+ if (l.regionIndex.value && g.regionByIndex?.has(l.regionIndex.value) && (s = g.key), !e.onlySearcher) {
295
+ let d;
296
+ s !== void 0 && (d = t.value.get(s)?.regionByIndex);
297
+ const c = t.value.get(g.key)?.regionByIndex;
298
+ d?.has(S) && !c?.has(S) && (s = g.key);
299
299
  }
300
- }), d !== void 0 && (n.searcherKey.value = d), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
300
+ }), s !== void 0 && (n.searcherKey.value = s), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
301
301
  }, { immediate: !0 });
302
302
  const i = () => {
303
303
  if (!(n.searcherKey.value === D || n.searcherKey.value === S))
304
304
  return n.searcherKey.value;
305
- }, u = () => {
305
+ }, f = () => {
306
306
  if (e.onlySearcher || l.regionIndex.value === S) return;
307
- let d = l.regionIndex.value;
307
+ let s = l.regionIndex.value;
308
308
  if (e.forFrequency) {
309
- const f = l.regionIndex.value;
310
- d = jt(e.forFrequency, { searcher_key: i(), key: f }, e.searchers)?.index;
309
+ const g = l.regionIndex.value;
310
+ s = $t(e.forFrequency, { searcher_key: i(), key: g }, e.searchers)?.index;
311
311
  }
312
- return d;
313
- }, g = () => {
314
- const d = i();
315
- if (d !== void 0)
316
- return t.value.get(d);
312
+ return s;
313
+ }, u = () => {
314
+ const s = i();
315
+ if (s !== void 0)
316
+ return t.value.get(s);
317
317
  };
318
318
  return {
319
319
  selectSearcher: n,
@@ -321,16 +321,16 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
321
321
  compare: r,
322
322
  searcherByKey: t,
323
323
  allRegionsIndexes: a,
324
- getSearcher: g,
324
+ getSearcher: u,
325
325
  getRegion: () => {
326
- const d = u();
327
- if (d !== void 0)
328
- return g()?.regionByIndex?.get(d);
326
+ const s = f();
327
+ if (s !== void 0)
328
+ return u()?.regionByIndex?.get(s);
329
329
  }
330
330
  };
331
- }, $o = /* @__PURE__ */ K({
331
+ }, Po = /* @__PURE__ */ K({
332
332
  __name: "regionSelector",
333
- props: /* @__PURE__ */ G({
333
+ props: /* @__PURE__ */ L({
334
334
  projectId: {},
335
335
  searchers: { default: () => [] },
336
336
  modelValue: {},
@@ -354,37 +354,37 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
354
354
  selectSearcher: l,
355
355
  selectRegion: r,
356
356
  compare: i,
357
- searcherByKey: u,
358
- allRegionsIndexes: g,
359
- getSearcher: x,
360
- getRegion: d
361
- } = bt(o), f = () => {
362
- const s = [];
363
- u.value.forEach((c) => {
364
- c.enabled && c.regions.forEach((m) => {
365
- m.enabled && s.push(m);
357
+ searcherByKey: f,
358
+ allRegionsIndexes: u,
359
+ getSearcher: C,
360
+ getRegion: s
361
+ } = Mt(o), g = () => {
362
+ const d = [];
363
+ f.value.forEach((c) => {
364
+ c.enabled && c.regions.forEach((p) => {
365
+ p.enabled && d.push(p);
366
366
  });
367
- }), At.open("regions", {
368
- regions: s,
367
+ }), wt.open("regions", {
368
+ regions: d,
369
369
  regionsIndexes: i.regionsIndexes.value,
370
370
  "@update:regionsIndexes": (c) => i.regionsIndexes.value = c
371
371
  });
372
372
  };
373
- return L([r.regionIndex, l.searcherKey, i.regionsIndexes], () => {
373
+ return G([r.regionIndex, l.searcherKey, i.regionsIndexes], () => {
374
374
  if (l.searcherKey.value === D && i.regionsIndexes.value.length) {
375
375
  if (JSON.stringify(a.value) === JSON.stringify(i.regionsIndexes.value))
376
376
  return;
377
377
  a.value = [...i.regionsIndexes.value];
378
378
  } else
379
379
  o.onlySearcher ? (a.value = [l.searcherKey.value], l.searcherKey.value === S && !o.autoRegion && (a.value.length = 0)) : (a.value = [r.regionIndex.value], r.regionIndex.value === S && !o.autoRegion && (a.value.length = 0));
380
- !o.onlySearcher && !g.value.size && (l.searcherKey.value = S);
381
- }), n.value && L(n, () => {
380
+ !o.onlySearcher && !u.value.size && (l.searcherKey.value = S);
381
+ }), n.value && G(n, () => {
382
382
  n.value && (a.value = [n.value]);
383
- }, { immediate: !0 }), L(a, () => {
383
+ }, { immediate: !0 }), G(a, () => {
384
384
  if (a.value[0] && (n.value = a.value[0]), o.onlySearcher) {
385
- if (!a.value.length || a.value.length === 1 && !u.value.has(a.value[0]) || a.value.length === 1 && a.value[0] === S && !o.autoRegion) {
386
- let s = u.value.keys().next().value;
387
- s === S && !o.autoRegion && (s = void 0, n.value = S), s !== void 0 ? a.value = [s] : a.value.length = 0;
385
+ if (!a.value.length || a.value.length === 1 && !f.value.has(a.value[0]) || a.value.length === 1 && a.value[0] === S && !o.autoRegion) {
386
+ let d = f.value.keys().next().value;
387
+ d === S && !o.autoRegion && (d = void 0, n.value = S), d !== void 0 ? a.value = [d] : a.value.length = 0;
388
388
  return;
389
389
  }
390
390
  if (a.value.length > 1 && JSON.stringify(a.value) !== JSON.stringify(i.regionsIndexes.value)) {
@@ -392,20 +392,20 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
392
392
  return;
393
393
  }
394
394
  } else {
395
- let s = [...new Set(a.value)], c = u.value.values().next().value?.regionByIndex?.keys().next().value;
396
- if (o.forFrequency && (c = u.value.values().next().value?.regionByIndex?.values().next().value?.key), c === S && !o.autoRegion && (c = void 0, n.value = S), !s.length)
397
- c !== void 0 && s.push(c);
398
- else if (s.length === 1) {
399
- let m = g.value;
400
- o.forFrequency && (m = /* @__PURE__ */ new Set(), u.value.forEach((I) => {
401
- I.regionByIndex.forEach((C) => {
402
- C.index !== de && C.index !== S && m.add(C.key);
395
+ let d = [...new Set(a.value)], c = f.value.values().next().value?.regionByIndex?.keys().next().value;
396
+ if (o.forFrequency && (c = f.value.values().next().value?.regionByIndex?.values().next().value?.key), c === S && !o.autoRegion && (c = void 0, n.value = S), !d.length)
397
+ c !== void 0 && d.push(c);
398
+ else if (d.length === 1) {
399
+ let p = u.value;
400
+ o.forFrequency && (p = /* @__PURE__ */ new Set(), f.value.forEach((I) => {
401
+ I.regionByIndex.forEach((k) => {
402
+ k.index !== se && k.index !== S && p.add(k.key);
403
403
  });
404
- })), m.has(s[0]) || (s = [], c !== void 0 && s.push(c));
404
+ })), p.has(d[0]) || (d = [], c !== void 0 && d.push(c));
405
405
  } else
406
- s = s.filter((m) => g.value.has(m)), !s.length && c !== void 0 && s.push(c);
407
- if (JSON.stringify(a.value) !== JSON.stringify(s)) {
408
- a.value = s;
406
+ d = d.filter((p) => u.value.has(p)), !d.length && c !== void 0 && d.push(c);
407
+ if (JSON.stringify(a.value) !== JSON.stringify(d)) {
408
+ a.value = d;
409
409
  return;
410
410
  }
411
411
  }
@@ -422,54 +422,54 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
422
422
  return;
423
423
  if (a.value.length === 1 && l.searcherKey.value !== D) {
424
424
  r.regionIndex.value = a.value[0];
425
- let s;
426
- for (const c of u.value.values()) {
427
- for (const m of c.regionByIndex.values())
428
- if ((o.forFrequency ? m.key : m.index) === r.regionIndex.value) {
429
- s = c.key;
425
+ let d;
426
+ for (const c of f.value.values()) {
427
+ for (const p of c.regionByIndex.values())
428
+ if ((o.forFrequency ? p.key : p.index) === r.regionIndex.value) {
429
+ d = c.key;
430
430
  break;
431
431
  }
432
- if (s !== void 0)
432
+ if (d !== void 0)
433
433
  break;
434
434
  }
435
- s !== void 0 && (l.searcherKey.value = s);
435
+ d !== void 0 && (l.searcherKey.value = d);
436
436
  } else
437
437
  l.searcherKey.value = D, i.regionsIndexes.value = [...a.value];
438
438
  }
439
439
  }, { immediate: !0 }), t({
440
- getSearcher: x,
441
- getRegion: d
442
- }), (s, c) => (h(), j("div", {
440
+ getSearcher: C,
441
+ getRegion: s
442
+ }), (d, c) => (h(), A("div", {
443
443
  class: oe({
444
444
  "top-selectorRegion": !0,
445
445
  "top-selectorRegion-onlySearcher": e.onlySearcher
446
446
  })
447
447
  }, [
448
- U(xe, {
449
- options: v(l).optionBySearcherKey.value,
450
- modelValue: v(l).searcherKey.value,
451
- "onUpdate:modelValue": c[0] || (c[0] = (m) => v(l).searcherKey.value = m),
448
+ U(Ce, {
449
+ options: m(l).optionBySearcherKey.value,
450
+ modelValue: m(l).searcherKey.value,
451
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => m(l).searcherKey.value = p),
452
452
  name: "searcher_key",
453
453
  addChanger: e.addChanger
454
454
  }, null, 8, ["options", "modelValue", "addChanger"]),
455
- !e.onlySearcher && v(l).searcherKey.value !== v(D) ? (h(), A(xe, {
455
+ !e.onlySearcher && m(l).searcherKey.value !== m(D) ? (h(), j(Ce, {
456
456
  key: 0,
457
457
  class: "top-select-region",
458
- options: v(r).optionByRegionIndex.value,
459
- modelValue: v(r).regionIndex.value,
460
- "onUpdate:modelValue": c[1] || (c[1] = (m) => v(r).regionIndex.value = m),
458
+ options: m(r).optionByRegionIndex.value,
459
+ modelValue: m(r).regionIndex.value,
460
+ "onUpdate:modelValue": c[1] || (c[1] = (p) => m(r).regionIndex.value = p),
461
461
  name: e.forFrequency ? "region_key" : "region_index",
462
462
  addChanger: e.addChanger,
463
463
  "data-top-icon": e.addRegionIcon ? "" : void 0
464
464
  }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : M("", !0),
465
- e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(D) ? (h(), A(ee, {
465
+ e.addCompare && !e.onlySearcher && m(l).searcherKey.value === m(D) ? (h(), j(ee, {
466
466
  key: 1,
467
467
  name: "compare",
468
- onClick: f,
469
- "data-count-compare-regions-indexes": v(i).regionsIndexes.value.length
468
+ onClick: g,
469
+ "data-count-compare-regions-indexes": m(i).regionsIndexes.value.length
470
470
  }, {
471
471
  default: B(() => [
472
- W(b(s.$i18n.Common.Selected_regions), 1)
472
+ H(b(d.$i18n.Common.Selected_regions), 1)
473
473
  ]),
474
474
  _: 1
475
475
  }, 8, ["data-count-compare-regions-indexes"])) : M("", !0)
@@ -490,37 +490,37 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
490
490
  name: "/",
491
491
  path: "/"
492
492
  };
493
- function Pt(e) {
493
+ function _t(e) {
494
494
  return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
495
495
  }
496
- const $e = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
497
- l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name = Pt(t));
496
+ const be = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
497
+ l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name = _t(t));
498
498
  const r = n > 1 ? "-".repeat(n - 1) + " " : "";
499
- r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), $e(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
500
- }), o), Et = (e, t) => {
499
+ r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), be(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
500
+ }), o), Vt = (e, t) => {
501
501
  const o = e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
502
502
  return o.options.onApiLoaded = (a, n, l) => {
503
503
  a.result && (a.result = a.result.map((r) => we(r))), l?.(a, n);
504
504
  }, o;
505
505
  };
506
- function Ce(e, t, o) {
506
+ function ke(e, t, o) {
507
507
  const a = Object.keys(e), n = a.map((l) => e[l]);
508
- return L(n, (l, r, i) => {
509
- const u = {};
510
- l.forEach((g, x) => {
511
- if (!Object.is(g, r[x])) {
512
- const d = a[x];
513
- u[d] = {
514
- old: r[x],
515
- new: g
508
+ return G(n, (l, r, i) => {
509
+ const f = {};
510
+ l.forEach((u, C) => {
511
+ if (!Object.is(u, r[C])) {
512
+ const s = a[C];
513
+ f[s] = {
514
+ old: r[C],
515
+ new: u
516
516
  };
517
517
  }
518
- }), Object.keys(u).length && t(u, i);
518
+ }), Object.keys(f).length && t(f, i);
519
519
  }, o);
520
520
  }
521
- const Mt = /* @__PURE__ */ K({
521
+ const Gt = /* @__PURE__ */ K({
522
522
  __name: "folders",
523
- props: /* @__PURE__ */ G({
523
+ props: /* @__PURE__ */ L({
524
524
  folderId: {},
525
525
  folder: {},
526
526
  folders: {},
@@ -538,19 +538,19 @@ const Mt = /* @__PURE__ */ K({
538
538
  }),
539
539
  emits: ["update:folderId", "update:folder"],
540
540
  setup(e) {
541
- const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders && t.service ? Et(t.client, t.service) : void 0, l = _(null), r = E(() => {
542
- const i = $e(t.folders ?? { root: [q] }, t.canSelectAll), u = /* @__PURE__ */ new Map();
543
- return i.forEach((g, x) => {
544
- u.set(x, we(g));
545
- }), u;
541
+ const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders && t.service ? Vt(t.client, t.service) : void 0, l = _(null), r = E(() => {
542
+ const i = be(t.folders ?? { root: [q] }, t.canSelectAll), f = /* @__PURE__ */ new Map();
543
+ return i.forEach((u, C) => {
544
+ f.set(C, we(u));
545
+ }), f;
546
546
  });
547
- return L(() => t.projectId, () => {
547
+ return G(() => t.projectId, () => {
548
548
  n?.changeParams({
549
549
  project_id: t.projectId
550
550
  }), n?.setOptions({
551
551
  checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
552
552
  }), l.value?.resetCache();
553
- }, { immediate: !0 }), Ce({
553
+ }, { immediate: !0 }), ke({
554
554
  modelFolder: a,
555
555
  modelFolderId: o
556
556
  }, async (i) => {
@@ -560,17 +560,17 @@ const Mt = /* @__PURE__ */ K({
560
560
  o.value = a.value.id;
561
561
  return;
562
562
  }
563
- let u = r.value.get(t.folderId);
564
- u || (u = q), a.value = u, o.value = u.id;
565
- }, { immediate: !0 }), (i, u) => (h(), A(Be, {
563
+ let f = r.value.get(t.folderId);
564
+ f || (f = q), a.value = f, o.value = f.id;
565
+ }, { immediate: !0 }), (i, f) => (h(), j($e, {
566
566
  class: "top-groupSelector_folder",
567
567
  modelValue: a.value,
568
- "onUpdate:modelValue": u[0] || (u[0] = (g) => a.value = g),
568
+ "onUpdate:modelValue": f[0] || (f[0] = (u) => a.value = u),
569
569
  items: e.folders ? [...r.value.values()] : void 0,
570
570
  "search-type": "inline",
571
571
  icon: e.addIcon ? "" : void 0,
572
- api: e.folders ? void 0 : v(n),
573
- apiSetSearchParams: (...g) => v(He)(...g, "name"),
572
+ api: e.folders ? void 0 : m(n),
573
+ apiSetSearchParams: (...u) => m(ze)(...u, "name"),
574
574
  addChanger: e.addChanger,
575
575
  useCache: ""
576
576
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
@@ -581,24 +581,24 @@ const Mt = /* @__PURE__ */ K({
581
581
  folder_id: q.id,
582
582
  folder_path: q.path
583
583
  }, ge = {
584
- id: Je,
584
+ id: Ye,
585
585
  name: "All groups",
586
586
  folder_id: q.id,
587
587
  folder_path: q.path
588
- }, re = () => (ge.name = w()?.Common.All_groups, ge), Xe = () => (ge.name = w()?.Keywords.Choose_group, ge), _t = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Ve = (e, t) => {
588
+ }, re = () => (ge.name = w()?.Common.All_groups, ge), tt = () => (ge.name = w()?.Keywords.Choose_group, ge), Lt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Ge = (e, t) => {
589
589
  const o = e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 });
590
590
  return o.options.onApiLoaded = (a, n, l) => {
591
591
  a.result && (a.result = a.result.map((r) => ce(r))), l?.(a, n);
592
592
  }, o;
593
- }, Vt = (e, t) => e.gen(`/add/${t}/groups/`), Gt = { class: "top-groupSelector_groupItem" }, Lt = {
593
+ }, Rt = (e, t) => e.gen(`/add/${t}/groups/`), Kt = { class: "top-groupSelector_groupItem" }, Ot = {
594
594
  key: 0,
595
595
  class: "top-comment"
596
- }, Rt = {
596
+ }, Ut = {
597
597
  key: 1,
598
598
  class: "top-groupSelector_groupItemFolderPath"
599
- }, Kt = /* @__PURE__ */ K({
599
+ }, Nt = /* @__PURE__ */ K({
600
600
  __name: "groups",
601
- props: /* @__PURE__ */ G({
601
+ props: /* @__PURE__ */ L({
602
602
  groupId: {},
603
603
  group: {},
604
604
  projectId: {},
@@ -619,25 +619,25 @@ const Mt = /* @__PURE__ */ K({
619
619
  group: { required: !0 },
620
620
  groupModifiers: {}
621
621
  }),
622
- emits: /* @__PURE__ */ G(["addGroup"], ["update:groupId", "update:group"]),
622
+ emits: /* @__PURE__ */ L(["addGroup"], ["update:groupId", "update:group"]),
623
623
  setup(e, { emit: t }) {
624
- const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups && o.service ? Ve(o.client, o.service) : void 0, i = o.client && o.service ? Vt(o.client, o.service) : void 0, u = _(null), g = _(void 0), x = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
624
+ const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups && o.service ? Ge(o.client, o.service) : void 0, i = o.client && o.service ? Rt(o.client, o.service) : void 0, f = _(null), u = _(void 0), C = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
625
625
  r?.changeParams({
626
626
  project_id: o.projectId,
627
627
  folder_id_depth: !0,
628
628
  filters: [
629
- x
629
+ C
630
630
  ]
631
631
  }), o.on !== void 0 && r?.params.filters?.push(ie("on", "EQUALS", [Number(o.on)]));
632
- const d = E(() => {
633
- const c = g.value ?? o.groups;
632
+ const s = E(() => {
633
+ const c = u.value ?? o.groups;
634
634
  if (c)
635
- return c.map((m) => ce(m));
636
- }), f = (c) => {
637
- const m = ce(c);
638
- l.value = m, n.value = m.id;
635
+ return c.map((p) => ce(p));
636
+ }), g = (c) => {
637
+ const p = ce(c);
638
+ l.value = p, n.value = p.id;
639
639
  };
640
- Ce({
640
+ ke({
641
641
  projectId: () => o.projectId,
642
642
  folderId: () => o.folder?.id,
643
643
  canSelectAll: () => o.canSelectAll
@@ -646,13 +646,13 @@ const Mt = /* @__PURE__ */ K({
646
646
  project_id: o.projectId
647
647
  }), r?.setOptions({
648
648
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
649
- })), c.folderId && (x.values = [
649
+ })), c.folderId && (C.values = [
650
650
  o.folder?.id ?? 0
651
- ], o.groups && (g.value = _t(o.groups, o.on, o.folder))), u.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== ye) {
652
- let m;
653
- o.autoselect === "first" && (m = g.value?.[0], o.canSelectAll && (m = De(re()))), (o.autoselect === "placeholder" || !m) && (m = Xe()), f(m);
651
+ ], o.groups && (u.value = Lt(o.groups, o.on, o.folder))), f.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== ye) {
652
+ let p;
653
+ o.autoselect === "first" && (p = u.value?.[0], o.canSelectAll && (p = qe(re()))), (o.autoselect === "placeholder" || !p) && (p = tt()), g(p);
654
654
  }
655
- }, { immediate: !0 }), Ce({
655
+ }, { immediate: !0 }), ke({
656
656
  modelGroup: l,
657
657
  modelGroupId: n
658
658
  }, async (c) => {
@@ -663,72 +663,72 @@ const Mt = /* @__PURE__ */ K({
663
663
  }
664
664
  if (!(o.canAdd && n.value === ye)) {
665
665
  if (o.groups) {
666
- let m = g.value?.find((I) => I.id === n.value);
667
- if (!m && o.canSelectAll && (m = re()), m)
668
- f(m);
666
+ let p = u.value?.find((I) => I.id === n.value);
667
+ if (!p && o.canSelectAll && (p = re()), p)
668
+ g(p);
669
669
  else {
670
- const I = g.value?.[0];
671
- I && !n.value ? f(I) : f(fe);
670
+ const I = u.value?.[0];
671
+ I && !n.value ? g(I) : g(fe);
672
672
  }
673
673
  }
674
- if (o.client && !o.groups && o.service && (n.value || n.value === Je && !o.canSelectAll)) {
675
- const m = Ve(o.client, o.service).changeParams({
674
+ if (o.client && !o.groups && o.service && (n.value || n.value === Ye && !o.canSelectAll)) {
675
+ const p = Ge(o.client, o.service).changeParams({
676
676
  project_id: o.projectId,
677
677
  id: n.value,
678
678
  filters: [
679
- x
679
+ C
680
680
  ]
681
681
  });
682
- m?.setOptions({
682
+ p?.setOptions({
683
683
  checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
684
684
  });
685
- const I = await m.call();
685
+ const I = await p.call();
686
686
  if (!I.errors?.length && !I.result) return;
687
- !I.errors && I.result[0] ? f(I.result[0]) : f(fe);
687
+ !I.errors && I.result[0] ? g(I.result[0]) : g(fe);
688
688
  }
689
689
  }
690
690
  }
691
691
  }, { immediate: !0 });
692
- const s = async (c) => {
692
+ const d = async (c) => {
693
693
  if (o.canAdd !== "api" || !i) return;
694
- const m = l.value, I = await i.changeParams({
694
+ const p = l.value, I = await i.changeParams({
695
695
  project_id: o.projectId,
696
696
  names: [c.name],
697
697
  to_id: o.folder?.id ?? q.id,
698
698
  to_type: "in_folder_last"
699
699
  }).call();
700
- I.result ? (f(I.result), a("addGroup", I.result)) : f(m), u.value?.resetCache(!0);
700
+ I.result ? (g(I.result), a("addGroup", I.result)) : g(p), f.value?.resetCache(!0);
701
701
  };
702
- return (c, m) => (h(), A(Be, {
702
+ return (c, p) => (h(), j($e, {
703
703
  ref_key: "refSelector",
704
- ref: u,
704
+ ref: f,
705
705
  class: "top-groupSelector_group",
706
706
  modelValue: l.value,
707
- "onUpdate:modelValue": m[0] || (m[0] = (I) => l.value = I),
708
- items: d.value,
707
+ "onUpdate:modelValue": p[0] || (p[0] = (I) => l.value = I),
708
+ items: s.value,
709
709
  searchType: "inline",
710
710
  icon: e.addIcon ? "" : void 0,
711
- api: e.groups ? void 0 : v(r),
712
- apiSetSearchParams: (...I) => v(He)(...I, "name"),
711
+ api: e.groups ? void 0 : m(r),
712
+ apiSetSearchParams: (...I) => m(ze)(...I, "name"),
713
713
  appendSearchToResult: !!e.canAdd,
714
- useAllItem: e.canSelectAll ? v(re)().name : !1,
714
+ useAllItem: e.canSelectAll ? m(re)().name : !1,
715
715
  addChanger: e.addChanger,
716
716
  useCache: "",
717
- onAppendItem: s
717
+ onAppendItem: d
718
718
  }, {
719
719
  item: B(({ item: I }) => [
720
- N("div", Gt, [
721
- I.id === v(ye) ? (h(), j("div", Lt, b(c.$i18n.Common.Add) + ": ", 1)) : M("", !0),
720
+ N("div", Kt, [
721
+ I.id === m(ye) ? (h(), A("div", Ot, b(c.$i18n.Common.Add) + ": ", 1)) : M("", !0),
722
722
  N("span", null, b(I.name), 1),
723
- I.folder_path && e.showPath ? (h(), j("span", Rt, b(I.folder_path), 1)) : M("", !0)
723
+ I.folder_path && e.showPath ? (h(), A("span", Ut, b(I.folder_path), 1)) : M("", !0)
724
724
  ])
725
725
  ]),
726
726
  _: 1
727
727
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
728
728
  }
729
- }), Ot = { class: "top-groupSelector" }, bo = /* @__PURE__ */ K({
729
+ }), Dt = { class: "top-groupSelector" }, Eo = /* @__PURE__ */ K({
730
730
  __name: "groupSelector",
731
- props: /* @__PURE__ */ G({
731
+ props: /* @__PURE__ */ L({
732
732
  folderId: {},
733
733
  folder: {},
734
734
  groupId: {},
@@ -756,23 +756,23 @@ const Mt = /* @__PURE__ */ K({
756
756
  group: { default: fe },
757
757
  groupModifiers: {}
758
758
  }),
759
- emits: /* @__PURE__ */ G(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
759
+ emits: /* @__PURE__ */ L(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
760
760
  setup(e, { emit: t }) {
761
- const o = e, a = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, u = $e(o.folders ?? { root: [q] }, o.canSelectAllGroups);
762
- n.value = u.get(a.value), n.value && (n.value = we(n.value));
763
- let g = o.groups?.find((d) => d.id === l.value);
764
- l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = re()), (o.autoselect === "placeholder" || !g) && (g = Xe()), g ??= fe, r.value = g, r.value = ce(r.value);
765
- const x = (d) => {
766
- let f;
767
- o.groups && d && (f = [...o.groups, d]), i("update:groups", f);
761
+ const o = e, a = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, f = be(o.folders ?? { root: [q] }, o.canSelectAllGroups);
762
+ n.value = f.get(a.value), n.value && (n.value = we(n.value));
763
+ let u = o.groups?.find((s) => s.id === l.value);
764
+ l.value || (u = o.groups?.[0]), o.canSelectAllGroups && !u && (u = re()), (o.autoselect === "placeholder" || !u) && (u = tt()), u ??= fe, r.value = u, r.value = ce(r.value);
765
+ const C = (s) => {
766
+ let g;
767
+ o.groups && s && (g = [...o.groups, s]), i("update:groups", g);
768
768
  };
769
- return (d, f) => (h(), j("div", Ot, [
770
- e.showFolders ? (h(), A(Mt, {
769
+ return (s, g) => (h(), A("div", Dt, [
770
+ e.showFolders ? (h(), j(Gt, {
771
771
  key: 0,
772
772
  folderId: a.value,
773
- "onUpdate:folderId": f[0] || (f[0] = (s) => a.value = s),
773
+ "onUpdate:folderId": g[0] || (g[0] = (d) => a.value = d),
774
774
  folder: n.value,
775
- "onUpdate:folder": f[1] || (f[1] = (s) => n.value = s),
775
+ "onUpdate:folder": g[1] || (g[1] = (d) => n.value = d),
776
776
  projectId: e.projectId,
777
777
  folders: e.folders,
778
778
  canSelectAll: e.canSelectAllGroups,
@@ -781,12 +781,12 @@ const Mt = /* @__PURE__ */ K({
781
781
  client: e.client,
782
782
  service: e.service
783
783
  }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) : M("", !0),
784
- e.showGroups ? (h(), A(Kt, {
784
+ e.showGroups ? (h(), j(Nt, {
785
785
  key: 1,
786
786
  groupId: l.value,
787
- "onUpdate:groupId": f[2] || (f[2] = (s) => l.value = s),
787
+ "onUpdate:groupId": g[2] || (g[2] = (d) => l.value = d),
788
788
  group: r.value,
789
- "onUpdate:group": f[3] || (f[3] = (s) => r.value = s),
789
+ "onUpdate:group": g[3] || (g[3] = (d) => r.value = d),
790
790
  projectId: e.projectId,
791
791
  folder: n.value,
792
792
  groups: e.groups,
@@ -799,11 +799,81 @@ const Mt = /* @__PURE__ */ K({
799
799
  addIcon: e.addIcon,
800
800
  client: e.client,
801
801
  service: e.service,
802
- onAddGroup: x
802
+ onAddGroup: C
803
803
  }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) : M("", !0)
804
804
  ]));
805
805
  }
806
- }), Ut = { class: "top-projectSelectorSubmenu_item" }, Nt = ["href", "title", "data-top-icon", "data-right"], Dt = { class: "top-projectSelectorSubmenu_item" }, Ft = ["href"], qt = /* @__PURE__ */ K({
806
+ }), Ie = (e) => ({
807
+ id: null,
808
+ name: e,
809
+ listItemProps: {
810
+ type: "title"
811
+ }
812
+ }), Te = {
813
+ scheduledUpdate: !1,
814
+ manualUpdate: !1,
815
+ guestProjects: !1
816
+ }, Ft = (e, t) => {
817
+ const o = [], a = {
818
+ scheduledUpdate: Ie(w().Projects.Scheduled_update),
819
+ manualUpdate: Ie(w().Projects.Manual_update),
820
+ guestProjects: Ie(w().Projects.Guest_projects)
821
+ }, n = t ? {
822
+ scheduledUpdate: !1,
823
+ manualUpdate: !1,
824
+ guestProjects: !1
825
+ } : Te;
826
+ for (const l of e)
827
+ !n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (o.push(a.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (o.push(a.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (o.push(a.guestProjects), n.guestProjects = !0), o.push(l);
828
+ return o;
829
+ }, qt = (e) => e.map((t) => ({
830
+ ...t,
831
+ listItemProps: {
832
+ attrs: { title: t.name }
833
+ }
834
+ })), Wt = (e, t, o) => {
835
+ if (!e || e.length === 0) return [];
836
+ t && Object.keys(Te).forEach((n) => Te[n] = !1);
837
+ const a = qt(e);
838
+ return Ft(a, o);
839
+ }, Ht = (e) => {
840
+ e = e.replace(/#.*/, "");
841
+ let t = location.hash;
842
+ 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:\{[^}]*},/, "")), e + t;
843
+ }, Le = (e, t) => {
844
+ t && t.target instanceof HTMLElement && Qe.close(t.target.closest(".top-popup-wrapper"));
845
+ const o = Ht(e);
846
+ location.href = o;
847
+ }, xe = (e) => {
848
+ const t = ot(), o = location.pathname.split("/");
849
+ let a = "project/dynamics/", n = "";
850
+ return o[1] == "project" && (a = o[1] + "/" + o[2] + "/"), o[2] == "settings" && (n = location.hash), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(o[4]) && (n = o[4] + "/"), "https://" + t + "/" + a + e + "/" + n;
851
+ }, ot = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, Re = (e) => {
852
+ let t = e.startsWith("http") ? e : "http://" + e;
853
+ return t = t.replace(/"/g, "%22"), t;
854
+ }, Jt = (e, t) => {
855
+ let o = e.params.filters ?? [];
856
+ o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
857
+ const a = It(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
858
+ t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
859
+ }, Ke = (e, t, o) => {
860
+ const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
861
+ return a.params = {
862
+ ...o,
863
+ filters: [
864
+ ie("on", "GREATER_THAN_EQUALS", [0])
865
+ ],
866
+ orders: [
867
+ le("user_id", "DESC", [t]),
868
+ le("on", "DESC"),
869
+ le("favorite", "DESC"),
870
+ le("id", "DESC")
871
+ ]
872
+ }, a.options.onApiLoaded = (n, l, r) => {
873
+ const i = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, f = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
874
+ n.result = Wt(n.result, i, f), r?.(n, l);
875
+ }, a;
876
+ }, zt = (e) => e.gen("/add/projects_2/projects/"), Yt = { class: "top-projectSelectorSubmenu_item" }, Qt = ["href", "title", "data-top-icon", "data-right"], Xt = { class: "top-projectSelectorSubmenu_item" }, Zt = ["href"], eo = /* @__PURE__ */ K({
807
877
  __name: "submenu",
808
878
  props: {
809
879
  id: {},
@@ -811,184 +881,115 @@ const Mt = /* @__PURE__ */ K({
811
881
  url: {}
812
882
  },
813
883
  setup(e) {
814
- const t = e, o = w(), a = [
884
+ const t = e, o = w(), a = ot(), n = [
815
885
  {
816
- href: `/project/keywords/${t.id}/`,
886
+ href: `https://${a}/project/keywords/${t.id}/`,
817
887
  title: o.Common.Menu_phrases,
818
888
  icon: "",
819
889
  right: "2"
820
890
  },
821
891
  {
822
- href: `/project/dynamics/${t.id}/`,
892
+ href: `https://${a}/project/dynamics/${t.id}/`,
823
893
  title: o.Common.Menu_dynamics,
824
894
  icon: "",
825
895
  right: "1"
826
896
  },
827
897
  {
828
- href: `/project/snapshots/${t.id}/`,
898
+ href: `https://${a}/project/snapshots/${t.id}/`,
829
899
  title: o.Common.Menu_snapshots,
830
900
  icon: "",
831
901
  right: "1"
832
902
  },
833
903
  {
834
- href: `/project/competitors/${t.id}/`,
904
+ href: `https://${a}/project/competitors/${t.id}/`,
835
905
  title: o.Common.Menu_competitors,
836
906
  icon: "",
837
907
  right: "1"
838
908
  },
839
909
  {
840
- href: `/project/analytics/${t.id}/`,
910
+ href: `https://${a}/project/analytics/${t.id}/`,
841
911
  title: o.Common.Menu_analytics,
842
912
  icon: "",
843
913
  right: "5"
844
914
  },
845
915
  {
846
- href: `/project/broker/${t.id}/`,
916
+ href: `https://${a}/project/broker/${t.id}/`,
847
917
  title: o.Common.Menu_broker,
848
918
  icon: "",
849
919
  right: "6"
850
920
  },
851
921
  {
852
- href: `/project/audit/${t.id}/sitemap/`,
922
+ href: `https://${a}/project/audit/${t.id}/sitemap/`,
853
923
  title: o.Audit.Sitemap_gen,
854
924
  icon: "",
855
925
  right: "8"
856
926
  },
857
927
  {
858
- href: `/project/audit/${t.id}/audit/`,
928
+ href: `https://${a}/project/audit/${t.id}/audit/`,
859
929
  title: o.Common.Menu_audit,
860
930
  icon: "",
861
931
  right: "8"
862
932
  },
863
933
  {
864
- href: `/project/audit/${t.id}/indexing/`,
934
+ href: `https://${a}/project/audit/${t.id}/indexing/`,
865
935
  title: o.Audit.Indexing,
866
936
  icon: "",
867
937
  right: "8"
868
938
  },
869
939
  {
870
- href: `/project/audit/${t.id}/watcher/`,
940
+ href: `https://${a}/project/audit/${t.id}/watcher/`,
871
941
  title: o.Audit.Watcher,
872
942
  icon: "",
873
943
  right: "9"
874
944
  },
875
945
  {
876
- href: `/project/settings/${t.id}/`,
946
+ href: `https://${a}/project/settings/${t.id}/`,
877
947
  title: o.Common.Menu_settings,
878
948
  icon: "",
879
949
  right: "2"
880
950
  }
881
- ], n = E(() => t.right.includes("0") ? a.filter((l) => t.right[l.right] === "1") : a);
882
- return (l, r) => {
883
- const i = Fe("TopButton");
884
- return h(), A(v(je), {
951
+ ], l = E(() => t.right.includes("0") ? n.filter((r) => t.right[r.right] === "1") : n);
952
+ return (r, i) => {
953
+ const f = We("TopButton");
954
+ return h(), j(m(je), {
885
955
  class: "top-projectSelectorSubmenu",
886
956
  notch: !1,
887
957
  pos: "2"
888
958
  }, {
889
959
  opener: B(() => [
890
- U(i, {
960
+ U(f, {
891
961
  class: "top-projectSelectorSubmenu_opener",
892
962
  "data-top-icon": "",
893
963
  color: "theme"
894
964
  })
895
965
  ]),
896
966
  contentList: B(() => [
897
- (h(!0), j(F, null, pe(n.value, (u) => (h(), j("li", Ut, [
967
+ (h(!0), A(F, null, ve(l.value, (u) => (h(), A("li", Yt, [
898
968
  N("a", {
899
969
  href: u.href,
900
970
  title: u.title,
901
971
  "data-top-icon": u.icon,
902
972
  "data-right": u.right
903
- }, null, 8, Nt)
973
+ }, null, 8, Qt)
904
974
  ]))), 256)),
905
- N("li", Dt, [
975
+ N("li", Xt, [
906
976
  N("a", {
907
977
  href: e.url,
908
978
  "data-top-icon": "",
909
979
  target: "_blank"
910
- }, null, 8, Ft)
980
+ }, null, 8, Zt)
911
981
  ])
912
982
  ]),
913
983
  _: 1
914
984
  });
915
985
  };
916
986
  }
917
- }), Ie = (e) => ({
918
- id: null,
919
- name: e,
920
- listItemProps: {
921
- type: "title"
922
- }
923
- }), ke = {
924
- scheduledUpdate: !1,
925
- manualUpdate: !1,
926
- guestProjects: !1
927
- }, Wt = (e, t) => {
928
- const o = [], a = {
929
- scheduledUpdate: Ie(w().Projects.Scheduled_update),
930
- manualUpdate: Ie(w().Projects.Manual_update),
931
- guestProjects: Ie(w().Projects.Guest_projects)
932
- }, n = t ? {
933
- scheduledUpdate: !1,
934
- manualUpdate: !1,
935
- guestProjects: !1
936
- } : ke;
937
- for (const l of e)
938
- !n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (o.push(a.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (o.push(a.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (o.push(a.guestProjects), n.guestProjects = !0), o.push(l);
939
- return o;
940
- }, Ht = (e) => e.map((t) => ({
941
- ...t,
942
- listItemProps: {
943
- attrs: { title: t.name }
944
- }
945
- })), Jt = (e, t, o) => {
946
- if (!e || e.length === 0) return [];
947
- t && Object.keys(ke).forEach((n) => ke[n] = !1);
948
- const a = Ht(e);
949
- return Wt(a, o);
950
- }, zt = (e) => {
951
- if (!e) return "";
952
- let t = e;
953
- 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;
954
- }, Yt = (e) => {
955
- const t = location.pathname.split("/");
956
- let o = "project/dynamics/", a = "";
957
- t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (a = t[4] + "/");
958
- let n = "/" + o + e + "/" + a;
959
- const l = zt(location.hash);
960
- return n += l, n;
961
- }, Ge = (e) => {
962
- let t = e.startsWith("http") ? e : "http://" + e;
963
- return t = t.replace(/"/g, "%22"), t;
964
- }, Qt = (e, t) => {
965
- let o = e.params.filters ?? [];
966
- o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
967
- const a = pt(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
968
- t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
969
- }, Le = (e, t, o) => {
970
- const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
971
- return a.params = {
972
- ...o,
973
- filters: [
974
- ie("on", "GREATER_THAN_EQUALS", [0])
975
- ],
976
- orders: [
977
- le("user_id", "DESC", [t]),
978
- le("on", "DESC"),
979
- le("favorite", "DESC"),
980
- le("id", "DESC")
981
- ]
982
- }, a.options.onApiLoaded = (n, l, r) => {
983
- const i = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, u = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
984
- n.result = Jt(n.result, i, u), r?.(n, l);
985
- }, a;
986
- }, Xt = (e) => e.gen("/add/projects_2/projects/"), me = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V = qe(), Ze = _(0), Q = _(null), Re = (e, t) => {
987
+ }), me = "ui_project_selector_total:", to = 1440 * 60 * 1e3, V = He(), at = _(0), Q = _(null), Oe = (e, t) => {
987
988
  localStorage.setItem(
988
989
  me + e,
989
- JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + Zt })
990
+ JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + to })
990
991
  );
991
- }, eo = (e) => {
992
+ }, oo = (e) => {
992
993
  const t = localStorage.getItem(me + e);
993
994
  if (!t) return;
994
995
  const { projectsTotal: o, expiresAt: a } = JSON.parse(t);
@@ -997,16 +998,16 @@ const Mt = /* @__PURE__ */ K({
997
998
  return;
998
999
  }
999
1000
  return o;
1000
- }, to = (e, t = !0) => {
1001
- V.value = void 0, localStorage.removeItem(me + e), t && Ze.value++;
1002
- }, oo = { class: "top-projectSelector_item" }, ao = { class: "top-projectSelector_itemText" }, lo = { class: "top-comment" }, no = {
1001
+ }, ao = (e, t = !0) => {
1002
+ V.value = void 0, localStorage.removeItem(me + e), t && at.value++;
1003
+ }, lo = { class: "top-projectSelector_item" }, no = { class: "top-projectSelector_itemText" }, ro = { class: "top-comment" }, io = {
1003
1004
  key: 0,
1004
1005
  class: "top-comment"
1005
- }, ro = ["href"], Ke = 1e3, Po = /* @__PURE__ */ K({
1006
+ }, so = ["href", "onClick"], Ue = 1e3, Mo = /* @__PURE__ */ K({
1006
1007
  __name: "projectSelector",
1007
- props: /* @__PURE__ */ G({
1008
+ props: /* @__PURE__ */ L({
1009
+ modelValue: {},
1008
1010
  client: {},
1009
- project: {},
1010
1011
  addLinksToProjects: { type: Boolean, default: !0 },
1011
1012
  excludeProjectId: {},
1012
1013
  modificator: {},
@@ -1014,135 +1015,138 @@ const Mt = /* @__PURE__ */ K({
1014
1015
  buttonProps: {},
1015
1016
  openerShortcut: {}
1016
1017
  }, {
1017
- project: { default: { id: null, name: "" } },
1018
- projectModifiers: {}
1018
+ modelValue: { default: { id: null, name: "" } },
1019
+ modelModifiers: {}
1019
1020
  }),
1020
- emits: ["update:project"],
1021
+ emits: ["update:modelValue"],
1021
1022
  setup(e) {
1022
1023
  const t = w();
1023
1024
  if (!window.mo?.user?.id)
1024
1025
  throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
1025
- const o = window.mo.user.id, a = e, n = P(e, "project"), l = Le(
1026
+ const o = window.mo.user.id, a = e, n = P(e, "modelValue"), l = Ke(
1026
1027
  a.client,
1027
1028
  o
1028
- ), r = Xt(a.client), i = _(eo(o)), u = _(null), g = E(() => a.placeholder ?? t.Projects.Select_project), x = E(() => !V.value || !a.excludeProjectId ? V.value : V.value.filter((C) => C.id !== a.excludeProjectId)), d = E(() => {
1029
+ ), r = zt(a.client), i = _(oo(o)), f = _(null), u = E(() => a.placeholder ?? t.Projects.Select_project), C = E(() => !V.value || !a.excludeProjectId ? V.value : V.value.filter((k) => k.id !== a.excludeProjectId)), s = E(() => {
1029
1030
  if (!(!i.value && i.value !== 0))
1030
- return i.value < Ke ? "static" : "api";
1031
+ return i.value < Ue ? "static" : "api";
1031
1032
  });
1032
- L(Ze, () => {
1033
- m();
1033
+ G(at, () => {
1034
+ p();
1035
+ }), G(n, () => {
1036
+ !n.value.id || !a.addLinksToProjects || Le(xe(n.value.id));
1034
1037
  });
1035
- const f = async () => {
1038
+ const g = async () => {
1036
1039
  if (!Q.value) {
1037
- const R = Le(
1040
+ const R = Ke(
1038
1041
  a.client,
1039
1042
  o,
1040
- { limit: Ke }
1043
+ { limit: Ue }
1041
1044
  );
1042
1045
  Q.value = R.call();
1043
1046
  }
1044
- const C = await Q.value;
1045
- if (C.errors) {
1047
+ const k = await Q.value;
1048
+ if (k.errors) {
1046
1049
  Q.value = null;
1047
1050
  return;
1048
1051
  }
1049
- return Q.value = null, C;
1050
- }, s = async () => {
1052
+ return Q.value = null, k;
1053
+ }, d = async () => {
1051
1054
  if (i.value) return;
1052
- const C = await f();
1053
- C && (i.value = C.total, d.value === "static" && !V.value && (V.value = C.result), i.value && Re(o, i.value));
1054
- }, c = async (C) => {
1055
+ const k = await g();
1056
+ k && (i.value = k.total, s.value === "static" && !V.value && (V.value = k.result), i.value && Oe(o, i.value));
1057
+ }, c = async (k) => {
1055
1058
  const R = await r.changeParams({
1056
- url: C.name,
1057
- name: C.name
1059
+ url: k.name,
1060
+ name: k.name
1058
1061
  }).call();
1059
1062
  if (!R.errors) {
1060
- if (V.value && d.value === "static") {
1063
+ if (V.value && s.value === "static") {
1061
1064
  const y = {
1062
1065
  id: Number(R.result),
1063
1066
  user_id: o,
1064
- name: C.name,
1065
- url: C.name,
1067
+ name: k.name,
1068
+ url: k.name,
1066
1069
  on: 0,
1067
1070
  right: "11111111111111111111",
1068
1071
  listItemProps: {
1069
- attrs: { title: C.name }
1072
+ attrs: { title: k.name }
1070
1073
  }
1071
- }, p = V.value.findIndex((k) => k.on === 0);
1074
+ }, v = V.value.findIndex((x) => x.on === 0);
1072
1075
  V.value = [
1073
- ...V.value.slice(0, p),
1076
+ ...V.value.slice(0, v),
1074
1077
  y,
1075
- ...V.value.slice(p)
1076
- ], i.value && (i.value += 1, Re(o, i.value));
1078
+ ...V.value.slice(v)
1079
+ ], i.value && (i.value += 1, Oe(o, i.value));
1077
1080
  }
1078
- d.value === "api" && to(o);
1081
+ s.value === "api" && ao(o);
1079
1082
  }
1080
- }, m = () => {
1081
- d.value === "api" && u.value?.resetCache(!0);
1083
+ }, p = () => {
1084
+ s.value === "api" && f.value?.resetCache(!0);
1082
1085
  }, I = async () => {
1083
- if (V.value || d.value !== "static") return;
1084
- const C = await f();
1085
- C && (V.value = C.result);
1086
+ if (V.value || s.value !== "static") return;
1087
+ const k = await g();
1088
+ k && (V.value = k.result);
1086
1089
  };
1087
- return et(async () => {
1088
- await s();
1089
- }), (C, R) => {
1090
- const y = Fe("TopButton");
1091
- return h(), A(Be, {
1090
+ return lt(async () => {
1091
+ await d();
1092
+ }), (k, R) => {
1093
+ const y = We("TopButton");
1094
+ return h(), j($e, {
1092
1095
  ref_key: "refSelector",
1093
- ref: u,
1096
+ ref: f,
1094
1097
  class: "top-projectSelector",
1095
1098
  modelValue: n.value,
1096
- "onUpdate:modelValue": R[1] || (R[1] = (p) => n.value = p),
1097
- items: x.value,
1098
- title: C.$i18n.Projects.Search_projects,
1099
+ "onUpdate:modelValue": R[1] || (R[1] = (v) => n.value = v),
1100
+ items: C.value,
1101
+ title: k.$i18n.Projects.Search_projects,
1099
1102
  modificator: e.modificator,
1100
1103
  searchFields: ["id", "name", "url"],
1101
- placeholder: g.value,
1104
+ placeholder: u.value,
1102
1105
  hasCloserBtn: "",
1103
- api: d.value === "api" ? v(l) : void 0,
1104
- apiSetSearchParams: d.value === "api" ? (...p) => v(Qt)(...p) : void 0,
1106
+ api: s.value === "api" ? m(l) : void 0,
1107
+ apiSetSearchParams: s.value === "api" ? (...v) => m(Jt)(...v) : void 0,
1105
1108
  useCache: "",
1106
1109
  appendSearchToResult: "",
1107
1110
  appendSearchAllowDuplicate: "",
1108
- appendSearchToResultCond: v(mt),
1111
+ appendSearchToResultCond: m(yt),
1109
1112
  appendWithoutSelect: "",
1110
1113
  buttonProps: e.buttonProps,
1111
1114
  openerShortcut: e.openerShortcut,
1112
1115
  onAppendItem: c,
1113
1116
  onOpen: I
1114
1117
  }, {
1115
- item: B(({ item: p }) => [
1116
- N("div", oo, [
1117
- N("div", ao, [
1118
- p.id ? (h(), j(F, { key: 0 }, [
1119
- W(b(v(vt)(p.name, 20)) + " ", 1),
1120
- N("span", lo, " id " + b(p.id), 1)
1121
- ], 64)) : (h(), j(F, { key: 1 }, [
1122
- p.listItemProps?.type ? M("", !0) : (h(), j("div", no, b(C.$i18n.Projects.Add_project) + ": ", 1)),
1123
- W(" " + b(p.name), 1)
1118
+ item: B(({ item: v }) => [
1119
+ N("div", lo, [
1120
+ N("div", no, [
1121
+ v.id ? (h(), A(F, { key: 0 }, [
1122
+ H(b(m(St)(v.name, 20)) + " ", 1),
1123
+ N("span", ro, " id " + b(v.id), 1)
1124
+ ], 64)) : (h(), A(F, { key: 1 }, [
1125
+ v.listItemProps?.type ? M("", !0) : (h(), A("div", io, b(k.$i18n.Projects.Add_project) + ": ", 1)),
1126
+ H(" " + b(v.name), 1)
1124
1127
  ], 64))
1125
1128
  ]),
1126
- p.id ? (h(), j(F, { key: 0 }, [
1127
- e.addLinksToProjects ? (h(), j("a", {
1129
+ v.id ? (h(), A(F, { key: 0 }, [
1130
+ e.addLinksToProjects ? (h(), A("a", {
1128
1131
  key: 0,
1129
1132
  class: "top-projectSelector_itemLink",
1130
- href: v(Yt)(p.id)
1131
- }, null, 8, ro)) : M("", !0),
1132
- C.$core.state.isMobile ? M("", !0) : (h(), A(y, {
1133
+ href: m(xe)(v.id),
1134
+ onClick: W((x) => m(Le)(m(xe)(v.id), x), ["prevent", "stop"])
1135
+ }, null, 8, so)) : M("", !0),
1136
+ k.$core.state.isMobile ? M("", !0) : (h(), j(y, {
1133
1137
  key: 1,
1134
1138
  class: "top-projectSelector_itemExtLink",
1135
- href: v(Ge)(p.url),
1139
+ href: m(Re)(v.url),
1136
1140
  "data-top-icon": "",
1137
1141
  color: "theme",
1138
1142
  target: "_blank",
1139
- onClick: R[0] || (R[0] = H(() => {
1143
+ onClick: R[0] || (R[0] = W(() => {
1140
1144
  }, ["stop"]))
1141
1145
  }, null, 8, ["href"])),
1142
- U(qt, {
1143
- id: p.id,
1144
- right: p.right ?? void 0,
1145
- url: v(Ge)(p.url)
1146
+ U(eo, {
1147
+ id: v.id,
1148
+ right: v.right ?? void 0,
1149
+ url: m(Re)(v.url)
1146
1150
  }, null, 8, ["id", "right", "url"])
1147
1151
  ], 64)) : M("", !0)
1148
1152
  ])
@@ -1151,14 +1155,14 @@ const Mt = /* @__PURE__ */ K({
1151
1155
  }, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
1152
1156
  };
1153
1157
  }
1154
- }), Oe = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, ve = (e, t) => {
1158
+ }), Ne = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, pe = (e, t) => {
1155
1159
  e = te(e);
1156
1160
  const o = t.find((a) => a.id === e);
1157
1161
  if (o)
1158
1162
  return o;
1159
- }, Eo = (e, t, o) => {
1163
+ }, _o = (e, t, o) => {
1160
1164
  t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
1161
- const a = ht.genElPopupOpener("div", t);
1165
+ const a = Qe.genElPopupOpener("div", t);
1162
1166
  return a.classList.add("top-tagSelector"), e.useTopButton && a.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || a.classList.add("top-tagSelector-custom"), e.mode === "filter" && a.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && a.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && a.classList.add("top-tagSelector-setter_several"), a.onclick = (n) => {
1163
1167
  n.preventDefault(), n.stopPropagation(), a.onclick = null;
1164
1168
  const l = _(e.modelValue), r = {
@@ -1168,24 +1172,24 @@ const Mt = /* @__PURE__ */ K({
1168
1172
  filters: e.filters,
1169
1173
  payload: e.payload
1170
1174
  };
1171
- Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, Pe(e.modelValue) || L(l, () => {
1175
+ Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, Ee(e.modelValue) || G(l, () => {
1172
1176
  e.modelValue = l.value, ne(a, e, o);
1173
1177
  }), a.click();
1174
- }, Pe(e.modelValue) ? L(e.modelValue, () => ne(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
1178
+ }, Ee(e.modelValue) ? G(e.modelValue, () => ne(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
1175
1179
  e.modelValue = n;
1176
1180
  const l = Z(a, "topTagSelectorTarget");
1177
1181
  l && (l.model.value = n), ne(a, e, o);
1178
1182
  }), ne(a, e, o), a;
1179
- }, Mo = (e, t) => {
1183
+ }, Vo = (e, t) => {
1180
1184
  Z(e, "topTagSelectorRender")?.(t);
1181
1185
  }, ne = (e, t, o) => {
1182
- const a = v(t.modelValue);
1186
+ const a = m(t.modelValue);
1183
1187
  if (e.classList.toggle("top-tagSelector-selectedOne", !a.length || a.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", a.length > 5), t.mode === "setter" && t.filters) {
1184
1188
  e.innerHTML = `<div>${o}</div>`;
1185
1189
  return;
1186
1190
  }
1187
1191
  if (e.innerHTML = "", !a.length && t.mode === "filter") {
1188
- const n = Ue({
1192
+ const n = De({
1189
1193
  id: "all",
1190
1194
  colorId: "",
1191
1195
  name: w().Common?.All_tags ?? "",
@@ -1194,18 +1198,18 @@ const Mt = /* @__PURE__ */ K({
1194
1198
  e.append(n);
1195
1199
  }
1196
1200
  a.forEach((n) => {
1197
- const l = Ue({
1201
+ const l = De({
1198
1202
  id: te(n),
1199
- colorId: ve(n, t.tags)?.color_id ?? "",
1200
- name: ve(n, t.tags)?.name ?? "",
1203
+ colorId: pe(n, t.tags)?.color_id ?? "",
1204
+ name: pe(n, t.tags)?.name ?? "",
1201
1205
  state: te(n) === n ? "selected" : "excluded"
1202
1206
  });
1203
1207
  e.append(l);
1204
1208
  });
1205
- }, Ue = (e) => {
1209
+ }, De = (e) => {
1206
1210
  const t = document.createElement("div");
1207
1211
  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;
1208
- }, io = [
1212
+ }, uo = [
1209
1213
  {
1210
1214
  id: "1",
1211
1215
  name: "Without Tag",
@@ -1256,7 +1260,7 @@ const Mt = /* @__PURE__ */ K({
1256
1260
  name: "Turquoise",
1257
1261
  color_id: "10"
1258
1262
  }
1259
- ], so = ["data-tag_id", "data-tag_color_id", "title"], Te = /* @__PURE__ */ K({
1263
+ ], co = ["data-tag_id", "data-tag_color_id", "title"], Ae = /* @__PURE__ */ K({
1260
1264
  __name: "tagIcon",
1261
1265
  props: {
1262
1266
  id: {},
@@ -1265,7 +1269,7 @@ const Mt = /* @__PURE__ */ K({
1265
1269
  state: {}
1266
1270
  },
1267
1271
  setup(e) {
1268
- return (t, o) => (h(), j("div", {
1272
+ return (t, o) => (h(), A("div", {
1269
1273
  class: oe({
1270
1274
  "top-tagSelector_tagIcon": !0,
1271
1275
  "top-tagSelector-active": !!e.state,
@@ -1274,11 +1278,11 @@ const Mt = /* @__PURE__ */ K({
1274
1278
  "data-tag_id": e.id,
1275
1279
  "data-tag_color_id": e.colorId,
1276
1280
  title: e.name
1277
- }, null, 10, so));
1281
+ }, null, 10, co));
1278
1282
  }
1279
- }), uo = ["contenteditable", "onKeydown"], Ne = /* @__PURE__ */ K({
1283
+ }), fo = ["contenteditable", "onKeydown"], Fe = /* @__PURE__ */ K({
1280
1284
  __name: "tagPopupListItem",
1281
- props: /* @__PURE__ */ G({
1285
+ props: /* @__PURE__ */ L({
1282
1286
  editable: { type: Boolean },
1283
1287
  disabled: { type: Boolean },
1284
1288
  canExclude: { type: Boolean },
@@ -1292,25 +1296,25 @@ const Mt = /* @__PURE__ */ K({
1292
1296
  },
1293
1297
  nameModifiers: {}
1294
1298
  }),
1295
- emits: /* @__PURE__ */ G(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1299
+ emits: /* @__PURE__ */ L(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1296
1300
  setup(e, { emit: t }) {
1297
1301
  const o = e, a = t, n = P(e, "name"), l = _(null), r = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
1298
1302
  contenteditable: i.value,
1299
- onpaste: (f) => f.preventDefault()
1300
- } : {}), i = _(!1), u = async () => {
1301
- i.value = !0, await tt(), l.value?.focus();
1302
- }, g = () => {
1303
- const f = l.value?.innerText;
1304
- if (!f) return x();
1305
- l.value && (l.value.innerText = f), i.value = !1, a("update:name", f);
1306
- }, x = async () => {
1303
+ onpaste: (g) => g.preventDefault()
1304
+ } : {}), i = _(!1), f = async () => {
1305
+ i.value = !0, await nt(), l.value?.focus();
1306
+ }, u = () => {
1307
+ const g = l.value?.innerText;
1308
+ if (!g) return C();
1309
+ l.value && (l.value.innerText = g), i.value = !1, a("update:name", g);
1310
+ }, C = async () => {
1307
1311
  l.value && (l.value.innerText = o.name), i.value = !1;
1308
- }, d = (f) => {
1312
+ }, s = (g) => {
1309
1313
  if (i.value || o.disabled) return;
1310
- let s = "selected";
1311
- o.canExclude && (f.ctrlKey || f.metaKey) && (s = "excluded"), o.state == s && (s = ""), s === "" && a("unselect"), s === "selected" && a("select"), s === "excluded" && a("exclude");
1314
+ let d = "selected";
1315
+ o.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && a("unselect"), d === "selected" && a("select"), d === "excluded" && a("exclude");
1312
1316
  };
1313
- return (f, s) => (h(), A(Ae, {
1317
+ return (g, d) => (h(), j(Be, {
1314
1318
  class: oe({
1315
1319
  "top-tagSelector_tagListItem": !0,
1316
1320
  "top-tagSelector_tagListItem-inEdit": i.value,
@@ -1319,47 +1323,47 @@ const Mt = /* @__PURE__ */ K({
1319
1323
  "top-tagSelector-active": !!e.state,
1320
1324
  "top-tagSelector-excluded": e.state === "excluded"
1321
1325
  }),
1322
- onClick: H(d, ["stop"])
1326
+ onClick: W(s, ["stop"])
1323
1327
  }, {
1324
1328
  default: B(() => [
1325
- U(Te, {
1329
+ U(Ae, {
1326
1330
  id: e.id,
1327
1331
  name: n.value,
1328
1332
  colorId: e.colorId,
1329
1333
  state: e.state
1330
1334
  }, null, 8, ["id", "name", "colorId", "state"]),
1331
- N("span", We({
1335
+ N("span", Je({
1332
1336
  ref_key: "elName",
1333
1337
  ref: l,
1334
1338
  class: "top-tagSelector_tagListItemName",
1335
1339
  contenteditable: i.value ? "plaintext-only" : !1
1336
1340
  }, r.value, {
1337
1341
  onKeydown: [
1338
- Ee(H(g, ["stop"]), ["enter"]),
1339
- Ee(H(x, ["stop"]), ["esc"])
1342
+ Me(W(u, ["stop"]), ["enter"]),
1343
+ Me(W(C, ["stop"]), ["esc"])
1340
1344
  ]
1341
- }), b(n.value), 17, uo),
1342
- e.editable ? (h(), j(F, { key: 0 }, [
1343
- i.value ? (h(), j("span", {
1345
+ }), b(n.value), 17, fo),
1346
+ e.editable ? (h(), A(F, { key: 0 }, [
1347
+ i.value ? (h(), A("span", {
1344
1348
  key: 1,
1345
1349
  "data-top-icon": "",
1346
1350
  class: "top-tagSelector_edit",
1347
- onClick: H(g, ["stop"])
1348
- })) : (h(), j("span", {
1351
+ onClick: W(u, ["stop"])
1352
+ })) : (h(), A("span", {
1349
1353
  key: 0,
1350
1354
  "data-top-icon": "",
1351
1355
  class: "top-tagSelector_edit",
1352
- onClick: u
1356
+ onClick: f
1353
1357
  }))
1354
1358
  ], 64)) : M("", !0)
1355
1359
  ]),
1356
1360
  _: 1
1357
1361
  }, 8, ["class"]));
1358
1362
  }
1359
- }), co = { key: 1 }, fo = /* @__PURE__ */ K({
1363
+ }), go = { key: 1 }, mo = /* @__PURE__ */ K({
1360
1364
  inheritAttrs: !1,
1361
1365
  __name: "popupOpener",
1362
- props: /* @__PURE__ */ G({
1366
+ props: /* @__PURE__ */ L({
1363
1367
  modelValue: {},
1364
1368
  id: {},
1365
1369
  tags: {},
@@ -1385,10 +1389,10 @@ const Mt = /* @__PURE__ */ K({
1385
1389
  payload: t.payload
1386
1390
  };
1387
1391
  return (r, i) => {
1388
- const u = ot("top-data");
1389
- return h(), A(dt, { id: e.id }, {
1392
+ const f = rt("top-data");
1393
+ return h(), j(ft, { id: e.id }, {
1390
1394
  default: B(() => [
1391
- at((h(), A(lt(v(a)), We({
1395
+ it((h(), j(st(m(a)), Je({
1392
1396
  class: {
1393
1397
  "top-tagSelector": !0,
1394
1398
  "top-tagSelector-useTopButton": t.useTopButton,
@@ -1403,35 +1407,35 @@ const Mt = /* @__PURE__ */ K({
1403
1407
  color: "theme",
1404
1408
  styling: e.styling
1405
1409
  }, r.$attrs), {
1406
- [v(n)]: B(() => [
1407
- !o.value.length && e.mode === "filter" ? (h(), A(Te, {
1410
+ [m(n)]: B(() => [
1411
+ !o.value.length && e.mode === "filter" ? (h(), j(Ae, {
1408
1412
  key: 0,
1409
1413
  id: "all",
1410
1414
  colorId: "",
1411
1415
  name: r.$i18n.Common.All_tags ?? "",
1412
1416
  state: ""
1413
1417
  }, null, 8, ["name"])) : M("", !0),
1414
- e.mode === "setter" && e.filters ? (h(), j("div", co, [
1415
- nt(r.$slots, "default")
1416
- ])) : (h(!0), j(F, { key: 2 }, pe(o.value, (g) => (h(), A(Te, {
1417
- id: v(te)(g),
1418
- colorId: v(ve)(g, e.tags)?.color_id ?? "",
1419
- name: v(ve)(g, e.tags)?.name ?? "",
1420
- state: v(te)(g) === g ? "selected" : "excluded"
1418
+ e.mode === "setter" && e.filters ? (h(), A("div", go, [
1419
+ dt(r.$slots, "default")
1420
+ ])) : (h(!0), A(F, { key: 2 }, ve(o.value, (u) => (h(), j(Ae, {
1421
+ id: m(te)(u),
1422
+ colorId: m(pe)(u, e.tags)?.color_id ?? "",
1423
+ name: m(pe)(u, e.tags)?.name ?? "",
1424
+ state: m(te)(u) === u ? "selected" : "excluded"
1421
1425
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1422
1426
  ]),
1423
1427
  _: 2
1424
1428
  }, 1040, ["class", "styling"])), [
1425
- [u, l, "topTagSelectorTarget"]
1429
+ [f, l, "topTagSelectorTarget"]
1426
1430
  ])
1427
1431
  ]),
1428
1432
  _: 3
1429
1433
  }, 8, ["id"]);
1430
1434
  };
1431
1435
  }
1432
- }), _o = /* @__PURE__ */ K({
1436
+ }), Go = /* @__PURE__ */ K({
1433
1437
  __name: "tagSelector",
1434
- props: /* @__PURE__ */ G({
1438
+ props: /* @__PURE__ */ L({
1435
1439
  modelValue: {},
1436
1440
  tags: {},
1437
1441
  tagsEditable: { type: Boolean },
@@ -1449,66 +1453,66 @@ const Mt = /* @__PURE__ */ K({
1449
1453
  },
1450
1454
  modelModifiers: {},
1451
1455
  tags: {
1452
- default: De(io)
1456
+ default: qe(uo)
1453
1457
  },
1454
1458
  tagsModifiers: {}
1455
1459
  }),
1456
- emits: /* @__PURE__ */ G(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1460
+ emits: /* @__PURE__ */ L(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1457
1461
  setup(e, { emit: t }) {
1458
- const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i = it((y, p) => {
1459
- r(y, p);
1462
+ const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i = ct((y, v) => {
1463
+ r(y, v);
1460
1464
  }, a.emitDelay);
1461
1465
  a.singleMode && !n.value.length && (n.value = [l.value[0].id]);
1462
- const u = a.id ?? "top-popup-id-" + Math.random(), g = _("add"), x = () => {
1463
- const y = " " + o.Common.Tags?.toLowerCase(), p = /* @__PURE__ */ new Map();
1464
- return p.set("add", { value: "add", title: o.Common.Add + y }), p.set("replace", { value: "replace", title: o.Common.Replace + y }), p.set("delete", { value: "delete", title: o.Common.Delete + y }), p;
1466
+ const f = a.id ?? "top-popup-id-" + Math.random(), u = _("add"), C = () => {
1467
+ const y = " " + o.Common.Tags?.toLowerCase(), v = /* @__PURE__ */ new Map();
1468
+ return v.set("add", { value: "add", title: o.Common.Add + y }), v.set("replace", { value: "replace", title: o.Common.Replace + y }), v.set("delete", { value: "delete", title: o.Common.Delete + y }), v;
1465
1469
  };
1466
- let d = qe({
1470
+ let s = He({
1467
1471
  model: n,
1468
1472
  mode: "filter",
1469
1473
  targetId: void 0,
1470
1474
  filters: void 0,
1471
1475
  payload: void 0
1472
1476
  });
1473
- L(n, () => {
1477
+ G(n, () => {
1474
1478
  i("selector", n.value);
1475
1479
  });
1476
- const f = E(() => {
1477
- if (d.value.mode === "setter" && a.maxTagsForSetter && !d.value.filters)
1478
- return d.value.model.value.length >= a.maxTagsForSetter;
1479
- }), s = (y) => {
1480
+ const g = E(() => {
1481
+ if (s.value.mode === "setter" && a.maxTagsForSetter && !s.value.filters)
1482
+ return s.value.model.value.length >= a.maxTagsForSetter;
1483
+ }), d = (y) => {
1480
1484
  if (y !== "all") {
1481
- if (d.value.model.value.includes(y)) return "selected";
1482
- if (d.value.model.value.includes(Oe(y))) return "excluded";
1485
+ if (s.value.model.value.includes(y)) return "selected";
1486
+ if (s.value.model.value.includes(Ne(y))) return "excluded";
1483
1487
  }
1484
- return y === "all" && !d.value.model.value.length ? "selected" : "";
1485
- }, c = (y, p) => {
1486
- const k = Oe(y);
1487
- let T = d.value.model.value.filter((O) => O !== y && O !== k);
1488
- p === "select" && T.push(y), p === "exclude" && T.push(k), d.value.mode === "setter" && d.value.targetId !== void 0 && a.requiredForSetter && (T.length || T.push("1"), T.length === 2 && d.value.model.value.length === 1 && d.value.model.value[0] === "1" && (T = T.filter((O) => O !== "1"))), a.singleMode && !d.value.filters && (T.length || (T = d.value.model.value), T.length > 1 && (T = [T[T.length - 1]])), T.sort((O, ae) => {
1488
+ return y === "all" && !s.value.model.value.length ? "selected" : "";
1489
+ }, c = (y, v) => {
1490
+ const x = Ne(y);
1491
+ let T = s.value.model.value.filter((O) => O !== y && O !== x);
1492
+ v === "select" && T.push(y), v === "exclude" && T.push(x), s.value.mode === "setter" && s.value.targetId !== void 0 && a.requiredForSetter && (T.length || T.push("1"), T.length === 2 && s.value.model.value.length === 1 && s.value.model.value[0] === "1" && (T = T.filter((O) => O !== "1"))), a.singleMode && !s.value.filters && (T.length || (T = s.value.model.value), T.length > 1 && (T = [T[T.length - 1]])), T.sort((O, ae) => {
1489
1493
  if (!a.tags) return 0;
1490
1494
  const J = a.tags.findIndex((Y) => Y.id === O), z = a.tags.findIndex((Y) => Y.id === ae);
1491
1495
  return J - z;
1492
- }), d.value.model.value = T, d.value.mode === "setter" && d.value.targetId !== void 0 && i("setter", {
1496
+ }), s.value.model.value = T, s.value.mode === "setter" && s.value.targetId !== void 0 && i("setter", {
1493
1497
  tagsIds: T,
1494
- targetId: d.value.targetId,
1495
- payload: d.value.payload
1498
+ targetId: s.value.targetId,
1499
+ payload: s.value.payload
1496
1500
  });
1497
- }, m = E(() => {
1501
+ }, p = E(() => {
1498
1502
  let y = "top-tagSelector_popup";
1499
- return d.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), d.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
1503
+ return s.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), s.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
1500
1504
  }), I = () => {
1501
1505
  const y = prompt("", "New tag");
1502
1506
  if (!y || y === "New tag") return;
1503
- const p = l.value.length + 1;
1507
+ const v = l.value.length + 1;
1504
1508
  l.value.push({
1505
- id: String(p),
1509
+ id: String(v),
1506
1510
  name: y,
1507
- color_id: String((p - 1) % 10 + 1)
1511
+ color_id: String((v - 1) % 10 + 1)
1508
1512
  }), r("tagsChanged", l.value);
1509
- }, C = (y) => {
1510
- if (d.value = Z(y.elPopupOpener, "topTagSelectorTarget"), !d.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1511
- if (d.value.filters && (g.value = "add", d.value.model.value = []), !X.$?.ui.sortable) {
1513
+ }, k = (y) => {
1514
+ if (s.value = Z(y.elPopupOpener, "topTagSelectorTarget"), !s.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1515
+ if (s.value.filters && (u.value = "add", s.value.model.value = []), !X.$?.ui.sortable) {
1512
1516
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1513
1517
  return;
1514
1518
  }
@@ -1519,9 +1523,9 @@ const Mt = /* @__PURE__ */ K({
1519
1523
  */
1520
1524
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
1521
1525
  distance: 10,
1522
- stop: function(p, k) {
1526
+ stop: function(v, x) {
1523
1527
  if (!l.value) return;
1524
- const T = $(k.item).parent().find("[data-tag_id]"), O = [];
1528
+ const T = $(x.item).parent().find("[data-tag_id]"), O = [];
1525
1529
  T.each((ae, J) => {
1526
1530
  if (!l.value) return;
1527
1531
  const z = $(J).attr("data-tag_id");
@@ -1535,91 +1539,91 @@ const Mt = /* @__PURE__ */ K({
1535
1539
  }, R = (y) => {
1536
1540
  X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
1537
1541
  };
1538
- return (y, p) => (h(), j(F, null, [
1539
- U(fo, {
1542
+ return (y, v) => (h(), A(F, null, [
1543
+ U(mo, {
1540
1544
  modelValue: n.value,
1541
- "onUpdate:modelValue": p[0] || (p[0] = (k) => n.value = k),
1542
- id: v(u),
1545
+ "onUpdate:modelValue": v[0] || (v[0] = (x) => n.value = x),
1546
+ id: m(f),
1543
1547
  tags: l.value,
1544
1548
  styling: e.styling,
1545
1549
  mode: "filter",
1546
1550
  useTopButton: e.useTopButton
1547
1551
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1548
1552
  U(je, {
1549
- id: v(u),
1550
- class: oe(m.value),
1551
- onOpen: p[4] || (p[4] = (k) => C(k)),
1552
- onClose: p[5] || (p[5] = (k) => R(k)),
1553
+ id: m(f),
1554
+ class: oe(p.value),
1555
+ onOpen: v[4] || (v[4] = (x) => k(x)),
1556
+ onClose: v[5] || (v[5] = (x) => R(x)),
1553
1557
  "transition-duration": 50
1554
- }, rt({
1558
+ }, ut({
1555
1559
  contentList: B(() => [
1556
- v(d).mode === "filter" && !e.singleMode ? (h(), A(Ne, {
1560
+ m(s).mode === "filter" && !e.singleMode ? (h(), j(Fe, {
1557
1561
  key: 0,
1558
1562
  id: "all",
1559
1563
  colorId: "",
1560
1564
  name: y.$i18n.Common.All_tags ?? "",
1561
- state: v(d).model.value.length ? "" : "selected",
1562
- onSelect: p[3] || (p[3] = (k) => v(d).model.value = [])
1565
+ state: m(s).model.value.length ? "" : "selected",
1566
+ onSelect: v[3] || (v[3] = (x) => m(s).model.value = [])
1563
1567
  }, null, 8, ["name", "state"])) : M("", !0),
1564
- (h(!0), j(F, null, pe(l.value, (k) => (h(), A(Ne, {
1565
- key: k.id,
1566
- id: k.id,
1567
- colorId: k.color_id,
1568
- name: k.name,
1569
- state: s(k.id),
1570
- canExclude: v(d).mode === "filter" && !e.singleMode,
1568
+ (h(!0), A(F, null, ve(l.value, (x) => (h(), j(Fe, {
1569
+ key: x.id,
1570
+ id: x.id,
1571
+ colorId: x.color_id,
1572
+ name: x.name,
1573
+ state: d(x.id),
1574
+ canExclude: m(s).mode === "filter" && !e.singleMode,
1571
1575
  editable: e.tagsEditable,
1572
- disabled: f.value && s(k.id) === "",
1573
- onUnselect: (T) => c(k.id, "unselect"),
1574
- onSelect: (T) => c(k.id, "select"),
1575
- onExclude: (T) => c(k.id, "exclude"),
1576
+ disabled: g.value && d(x.id) === "",
1577
+ onUnselect: (T) => c(x.id, "unselect"),
1578
+ onSelect: (T) => c(x.id, "select"),
1579
+ onExclude: (T) => c(x.id, "exclude"),
1576
1580
  "onUpdate:name": (T) => {
1577
- k.name = T, v(i)("tagsChanged", l.value);
1581
+ x.name = T, m(i)("tagsChanged", l.value);
1578
1582
  }
1579
1583
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1580
- e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), A(Ae, {
1584
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j(Be, {
1581
1585
  key: 1,
1582
1586
  "data-top-icon": "",
1583
- onClick: H(I, ["stop"])
1587
+ onClick: W(I, ["stop"])
1584
1588
  }, {
1585
1589
  default: B(() => [
1586
- W(b(y.$i18n.Common.Add), 1)
1590
+ H(b(y.$i18n.Common.Add), 1)
1587
1591
  ]),
1588
1592
  _: 1
1589
1593
  })) : M("", !0)
1590
1594
  ]),
1591
1595
  _: 2
1592
1596
  }, [
1593
- v(d).mode === "setter" && v(d).filters ? {
1597
+ m(s).mode === "setter" && m(s).filters ? {
1594
1598
  name: "header",
1595
1599
  fn: B(() => [
1596
- U(xe, {
1597
- modelValue: g.value,
1598
- "onUpdate:modelValue": p[1] || (p[1] = (k) => g.value = k),
1599
- options: x()
1600
+ U(Ce, {
1601
+ modelValue: u.value,
1602
+ "onUpdate:modelValue": v[1] || (v[1] = (x) => u.value = x),
1603
+ options: C()
1600
1604
  }, null, 8, ["modelValue", "options"])
1601
1605
  ]),
1602
1606
  key: "0"
1603
1607
  } : void 0,
1604
- v(d).mode === "setter" && v(d).filters ? {
1608
+ m(s).mode === "setter" && m(s).filters ? {
1605
1609
  name: "footer",
1606
1610
  fn: B(() => [
1607
1611
  U(ee, { color: "theme" }, {
1608
1612
  default: B(() => [
1609
- W(b(y.$i18n.Common.Cancel), 1)
1613
+ H(b(y.$i18n.Common.Cancel), 1)
1610
1614
  ]),
1611
1615
  _: 1
1612
1616
  }),
1613
1617
  U(ee, {
1614
- onClick: p[2] || (p[2] = (k) => v(i)("setter", {
1615
- tagsIds: v(d).model.value,
1616
- filters: v(d).filters,
1617
- filtersAction: g.value,
1618
- payload: v(d).payload
1618
+ onClick: v[2] || (v[2] = (x) => m(i)("setter", {
1619
+ tagsIds: m(s).model.value,
1620
+ filters: m(s).filters,
1621
+ filtersAction: u.value,
1622
+ payload: m(s).payload
1619
1623
  }))
1620
1624
  }, {
1621
1625
  default: B(() => [
1622
- W(b(g.value === "add" ? y.$i18n.Common.Add : "") + " " + b(g.value === "replace" ? y.$i18n.Common.Replace : "") + " " + b(g.value === "delete" ? y.$i18n.Common.Delete : ""), 1)
1626
+ H(b(u.value === "add" ? y.$i18n.Common.Add : "") + " " + b(u.value === "replace" ? y.$i18n.Common.Replace : "") + " " + b(u.value === "delete" ? y.$i18n.Common.Delete : ""), 1)
1623
1627
  ]),
1624
1628
  _: 1
1625
1629
  })
@@ -1631,19 +1635,19 @@ const Mt = /* @__PURE__ */ K({
1631
1635
  }
1632
1636
  });
1633
1637
  export {
1634
- Bo as TopCompetitorSelector,
1635
- bo as TopGroupSelector,
1636
- Po as TopProjectSelector,
1637
- $o as TopRegionSelector,
1638
- _o as TopTagSelector,
1639
- fo as TopTagSelectorPopupOpener,
1640
- Te as TopTagSelectorTagIcon,
1641
- to as clearCache,
1642
- At as dialogRegionSelector,
1643
- jt as findRegion,
1644
- Eo as genElTopTagSelectorPopupOpener,
1645
- Ye as genSearcherByKey,
1646
- Mo as renderElTopTagSelectorPopupOpener,
1647
- wo as useItemsFromCompetitors
1638
+ wo as TopCompetitorSelector,
1639
+ Eo as TopGroupSelector,
1640
+ Mo as TopProjectSelector,
1641
+ Po as TopRegionSelector,
1642
+ Go as TopTagSelector,
1643
+ mo as TopTagSelectorPopupOpener,
1644
+ Ae as TopTagSelectorTagIcon,
1645
+ ao as clearCache,
1646
+ wt as dialogRegionSelector,
1647
+ $t as findRegion,
1648
+ _o as genElTopTagSelectorPopupOpener,
1649
+ Ze as genSearcherByKey,
1650
+ Vo as renderElTopTagSelectorPopupOpener,
1651
+ bo as useItemsFromCompetitors
1648
1652
  };
1649
1653
  //# sourceMappingURL=project.js.map