@topvisor/ui 1.4.3-fixTabsView.2 → 1.4.3-fixTabsView.4
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.
- package/assets/themes/dark.css +1 -1
- package/assets/themes/light.css +1 -1
- package/icomoon/Topvisor icons.json +272 -249
- package/icomoon/demo.html +15 -1
- package/icomoon/fonts/Topvisor-2.eot +0 -0
- package/icomoon/fonts/Topvisor-2.svg +1 -0
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +8 -5
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +500 -495
- package/project/project.js.map +1 -1
- package/src/components/project/projectSelector/utils.d.ts +6 -2
package/project/project.js
CHANGED
|
@@ -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 A, unref as m, createBlock as j, withCtx as B, Fragment as F, renderList as
|
|
7
|
-
import { u as w, C as X, e as ee, q as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { u as
|
|
11
|
-
import { getSearcherGIcon as
|
|
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
|
|
16
|
-
import { ellipsis as
|
|
17
|
-
import {
|
|
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
|
-
|
|
20
|
-
const St = { class: "top-competitorSelector" }, It = { 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__ */
|
|
22
|
+
props: /* @__PURE__ */ L({
|
|
23
23
|
modelValue: {},
|
|
24
24
|
items: {},
|
|
25
25
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -38,8 +38,8 @@ const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
38
38
|
content: ""
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
return (n, l) => (h(), A("div",
|
|
42
|
-
m(X).state.isMobile ? (h(), j(
|
|
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",
|
|
@@ -54,7 +54,7 @@ const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
54
54
|
})
|
|
55
55
|
]),
|
|
56
56
|
contentList: B(() => [
|
|
57
|
-
(h(!0), A(F, null,
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
63
63
|
onClick: () => o.value = [r.value]
|
|
64
64
|
}, {
|
|
65
65
|
default: B(() => [
|
|
66
|
-
N("span",
|
|
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(), j(
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
81
81
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
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 ===
|
|
87
|
+
icon: n.id === Pe(t) ? "" : "",
|
|
88
88
|
content: n.name
|
|
89
|
-
}))), D = -1, S = -2,
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
96
96
|
9: "GoogleStore",
|
|
97
97
|
20: "Yandex.com",
|
|
98
98
|
21: "Yandex.com.tr"
|
|
99
|
-
},
|
|
99
|
+
}, _e = {
|
|
100
100
|
key: S,
|
|
101
101
|
name: "--",
|
|
102
102
|
index: S
|
|
103
|
-
},
|
|
103
|
+
}, Xe = {
|
|
104
104
|
key: S,
|
|
105
105
|
name: "--",
|
|
106
|
-
regions: [
|
|
107
|
-
regionByIndex: /* @__PURE__ */ new Map([[S,
|
|
108
|
-
},
|
|
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: [
|
|
116
|
-
regionByIndex: /* @__PURE__ */ new Map([[S,
|
|
117
|
-
},
|
|
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:
|
|
122
|
-
index:
|
|
121
|
+
key: se,
|
|
122
|
+
index: se,
|
|
123
123
|
lang: "ru",
|
|
124
124
|
name: "Without region"
|
|
125
|
-
},
|
|
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 =
|
|
128
|
-
},
|
|
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
|
|
136
|
-
r.regionByIndex.set(
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
142
142
|
if (n.has(l)) return;
|
|
143
143
|
const r = {
|
|
144
144
|
key: l,
|
|
145
|
-
name:
|
|
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
|
-
},
|
|
152
|
-
const t =
|
|
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 = { ...
|
|
159
|
+
const a = { ...jt() };
|
|
160
160
|
o.regionByIndex.set(a.index, a);
|
|
161
161
|
}), t;
|
|
162
|
-
},
|
|
163
|
-
const a =
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
169
169
|
}), n))
|
|
170
170
|
return !1;
|
|
171
171
|
}), n;
|
|
172
|
-
},
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
177
177
|
value: r.key,
|
|
178
178
|
title: r.name
|
|
179
179
|
};
|
|
180
|
-
e.addSearcherIcon && (i.icon =
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
197
197
|
searcherKey: a,
|
|
198
198
|
optionBySearcherKey: n
|
|
199
199
|
};
|
|
200
|
-
},
|
|
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(() => {
|
|
@@ -213,17 +213,17 @@ const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
r.device && (i += " (" + o.Common["Device_" + r.device] + ")");
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
const
|
|
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 ?
|
|
221
|
+
icon: r.device ? ht(r.device) : void 0
|
|
222
222
|
};
|
|
223
|
-
l.set(r.index,
|
|
223
|
+
l.set(r.index, u);
|
|
224
224
|
}), l;
|
|
225
225
|
});
|
|
226
|
-
return
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
231
231
|
a.value = i;
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
let
|
|
235
|
-
for (const [C,
|
|
236
|
-
const
|
|
237
|
-
if (typeof
|
|
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 (
|
|
239
|
+
if (g === f) {
|
|
240
240
|
i = C;
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
|
-
const
|
|
244
|
-
let c =
|
|
245
|
-
|
|
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
|
-
},
|
|
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 St = { class: "top-competitorSelector" }, It = { 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
|
|
272
|
+
return G(a, () => {
|
|
273
273
|
l();
|
|
274
274
|
}), e.addCompare && n(), {
|
|
275
275
|
regionsIndexes: a
|
|
276
276
|
};
|
|
277
|
-
},
|
|
278
|
-
const t = E(() =>
|
|
279
|
-
const
|
|
280
|
-
return t.value.forEach((
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
}),
|
|
285
|
-
}), n =
|
|
286
|
-
|
|
287
|
-
if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((
|
|
288
|
-
let
|
|
289
|
-
t.value.forEach((
|
|
290
|
-
if (e.onlySearcher &&
|
|
291
|
-
|
|
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 &&
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
const c = t.value.get(
|
|
298
|
-
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
305
|
+
}, f = () => {
|
|
306
306
|
if (e.onlySearcher || l.regionIndex.value === S) return;
|
|
307
|
-
let
|
|
307
|
+
let s = l.regionIndex.value;
|
|
308
308
|
if (e.forFrequency) {
|
|
309
|
-
const
|
|
310
|
-
|
|
309
|
+
const g = l.regionIndex.value;
|
|
310
|
+
s = $t(e.forFrequency, { searcher_key: i(), key: g }, e.searchers)?.index;
|
|
311
311
|
}
|
|
312
|
-
return
|
|
313
|
-
},
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
316
|
-
return t.value.get(
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
321
321
|
compare: r,
|
|
322
322
|
searcherByKey: t,
|
|
323
323
|
allRegionsIndexes: a,
|
|
324
|
-
getSearcher:
|
|
324
|
+
getSearcher: u,
|
|
325
325
|
getRegion: () => {
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
return
|
|
326
|
+
const s = f();
|
|
327
|
+
if (s !== void 0)
|
|
328
|
+
return u()?.regionByIndex?.get(s);
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
|
-
},
|
|
331
|
+
}, Po = /* @__PURE__ */ K({
|
|
332
332
|
__name: "regionSelector",
|
|
333
|
-
props: /* @__PURE__ */
|
|
333
|
+
props: /* @__PURE__ */ L({
|
|
334
334
|
projectId: {},
|
|
335
335
|
searchers: { default: () => [] },
|
|
336
336
|
modelValue: {},
|
|
@@ -354,37 +354,37 @@ const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
354
354
|
selectSearcher: l,
|
|
355
355
|
selectRegion: r,
|
|
356
356
|
compare: i,
|
|
357
|
-
searcherByKey:
|
|
358
|
-
allRegionsIndexes:
|
|
357
|
+
searcherByKey: f,
|
|
358
|
+
allRegionsIndexes: u,
|
|
359
359
|
getSearcher: C,
|
|
360
|
-
getRegion:
|
|
361
|
-
} =
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
c.enabled && c.regions.forEach((
|
|
365
|
-
|
|
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
|
-
}),
|
|
368
|
-
regions:
|
|
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
|
|
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 && !
|
|
381
|
-
}), n.value &&
|
|
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 }),
|
|
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 && !
|
|
386
|
-
let
|
|
387
|
-
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
394
|
} else {
|
|
395
|
-
let
|
|
396
|
-
if (o.forFrequency && (c =
|
|
397
|
-
c !== void 0 &&
|
|
398
|
-
else if (
|
|
399
|
-
let
|
|
400
|
-
o.forFrequency && (
|
|
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
401
|
I.regionByIndex.forEach((k) => {
|
|
402
|
-
k.index !==
|
|
402
|
+
k.index !== se && k.index !== S && p.add(k.key);
|
|
403
403
|
});
|
|
404
|
-
})),
|
|
404
|
+
})), p.has(d[0]) || (d = [], c !== void 0 && d.push(c));
|
|
405
405
|
} else
|
|
406
|
-
|
|
407
|
-
if (JSON.stringify(a.value) !== JSON.stringify(
|
|
408
|
-
a.value =
|
|
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,42 +422,42 @@ const St = { class: "top-competitorSelector" }, It = { 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
|
|
426
|
-
for (const c of
|
|
427
|
-
for (const
|
|
428
|
-
if ((o.forFrequency ?
|
|
429
|
-
|
|
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 (
|
|
432
|
+
if (d !== void 0)
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
|
-
|
|
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
440
|
getSearcher: C,
|
|
441
|
-
getRegion:
|
|
442
|
-
}), (
|
|
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(
|
|
448
|
+
U(Ce, {
|
|
449
449
|
options: m(l).optionBySearcherKey.value,
|
|
450
450
|
modelValue: m(l).searcherKey.value,
|
|
451
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
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 && m(l).searcherKey.value !== m(D) ? (h(), j(
|
|
455
|
+
!e.onlySearcher && m(l).searcherKey.value !== m(D) ? (h(), j(Ce, {
|
|
456
456
|
key: 0,
|
|
457
457
|
class: "top-select-region",
|
|
458
458
|
options: m(r).optionByRegionIndex.value,
|
|
459
459
|
modelValue: m(r).regionIndex.value,
|
|
460
|
-
"onUpdate:modelValue": c[1] || (c[1] = (
|
|
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
|
|
@@ -465,11 +465,11 @@ const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
465
465
|
e.addCompare && !e.onlySearcher && m(l).searcherKey.value === m(D) ? (h(), j(ee, {
|
|
466
466
|
key: 1,
|
|
467
467
|
name: "compare",
|
|
468
|
-
onClick:
|
|
468
|
+
onClick: g,
|
|
469
469
|
"data-count-compare-regions-indexes": m(i).regionsIndexes.value.length
|
|
470
470
|
}, {
|
|
471
471
|
default: B(() => [
|
|
472
|
-
H(b(
|
|
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 St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" },
|
|
|
490
490
|
name: "/",
|
|
491
491
|
path: "/"
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function _t(e) {
|
|
494
494
|
return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
|
|
495
495
|
}
|
|
496
|
-
const
|
|
497
|
-
l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name =
|
|
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),
|
|
500
|
-
}), o),
|
|
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
|
|
506
|
+
function ke(e, t, o) {
|
|
507
507
|
const a = Object.keys(e), n = a.map((l) => e[l]);
|
|
508
|
-
return
|
|
509
|
-
const
|
|
510
|
-
l.forEach((
|
|
511
|
-
if (!Object.is(
|
|
512
|
-
const
|
|
513
|
-
|
|
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
514
|
old: r[C],
|
|
515
|
-
new:
|
|
515
|
+
new: u
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
}), Object.keys(
|
|
518
|
+
}), Object.keys(f).length && t(f, i);
|
|
519
519
|
}, o);
|
|
520
520
|
}
|
|
521
|
-
const
|
|
521
|
+
const Gt = /* @__PURE__ */ K({
|
|
522
522
|
__name: "folders",
|
|
523
|
-
props: /* @__PURE__ */
|
|
523
|
+
props: /* @__PURE__ */ L({
|
|
524
524
|
folderId: {},
|
|
525
525
|
folder: {},
|
|
526
526
|
folders: {},
|
|
@@ -538,19 +538,19 @@ const _t = /* @__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 ?
|
|
542
|
-
const i =
|
|
543
|
-
return i.forEach((
|
|
544
|
-
|
|
545
|
-
}),
|
|
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
|
|
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 }),
|
|
553
|
+
}, { immediate: !0 }), ke({
|
|
554
554
|
modelFolder: a,
|
|
555
555
|
modelFolderId: o
|
|
556
556
|
}, async (i) => {
|
|
@@ -560,17 +560,17 @@ const _t = /* @__PURE__ */ K({
|
|
|
560
560
|
o.value = a.value.id;
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
|
-
let
|
|
564
|
-
|
|
565
|
-
}, { immediate: !0 }), (i,
|
|
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":
|
|
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
572
|
api: e.folders ? void 0 : m(n),
|
|
573
|
-
apiSetSearchParams: (...
|
|
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 _t = /* @__PURE__ */ K({
|
|
|
581
581
|
folder_id: q.id,
|
|
582
582
|
folder_path: q.path
|
|
583
583
|
}, ge = {
|
|
584
|
-
id:
|
|
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),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
596
|
+
}, Ut = {
|
|
597
597
|
key: 1,
|
|
598
598
|
class: "top-groupSelector_groupItemFolderPath"
|
|
599
|
-
},
|
|
599
|
+
}, Nt = /* @__PURE__ */ K({
|
|
600
600
|
__name: "groups",
|
|
601
|
-
props: /* @__PURE__ */
|
|
601
|
+
props: /* @__PURE__ */ L({
|
|
602
602
|
groupId: {},
|
|
603
603
|
group: {},
|
|
604
604
|
projectId: {},
|
|
@@ -619,9 +619,9 @@ const _t = /* @__PURE__ */ K({
|
|
|
619
619
|
group: { required: !0 },
|
|
620
620
|
groupModifiers: {}
|
|
621
621
|
}),
|
|
622
|
-
emits: /* @__PURE__ */
|
|
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 ?
|
|
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,
|
|
@@ -629,15 +629,15 @@ const _t = /* @__PURE__ */ K({
|
|
|
629
629
|
C
|
|
630
630
|
]
|
|
631
631
|
}), o.on !== void 0 && r?.params.filters?.push(ie("on", "EQUALS", [Number(o.on)]));
|
|
632
|
-
const
|
|
633
|
-
const c =
|
|
632
|
+
const s = E(() => {
|
|
633
|
+
const c = u.value ?? o.groups;
|
|
634
634
|
if (c)
|
|
635
|
-
return c.map((
|
|
636
|
-
}),
|
|
637
|
-
const
|
|
638
|
-
l.value =
|
|
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
|
-
|
|
640
|
+
ke({
|
|
641
641
|
projectId: () => o.projectId,
|
|
642
642
|
folderId: () => o.folder?.id,
|
|
643
643
|
canSelectAll: () => o.canSelectAll
|
|
@@ -648,11 +648,11 @@ const _t = /* @__PURE__ */ K({
|
|
|
648
648
|
checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
|
|
649
649
|
})), c.folderId && (C.values = [
|
|
650
650
|
o.folder?.id ?? 0
|
|
651
|
-
], o.groups && (
|
|
652
|
-
let
|
|
653
|
-
o.autoselect === "first" && (
|
|
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 }),
|
|
655
|
+
}, { immediate: !0 }), ke({
|
|
656
656
|
modelGroup: l,
|
|
657
657
|
modelGroupId: n
|
|
658
658
|
}, async (c) => {
|
|
@@ -663,72 +663,72 @@ const _t = /* @__PURE__ */ K({
|
|
|
663
663
|
}
|
|
664
664
|
if (!(o.canAdd && n.value === ye)) {
|
|
665
665
|
if (o.groups) {
|
|
666
|
-
let
|
|
667
|
-
if (!
|
|
668
|
-
|
|
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 =
|
|
671
|
-
I && !n.value ?
|
|
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 ===
|
|
675
|
-
const
|
|
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
679
|
C
|
|
680
680
|
]
|
|
681
681
|
});
|
|
682
|
-
|
|
682
|
+
p?.setOptions({
|
|
683
683
|
checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
|
|
684
684
|
});
|
|
685
|
-
const I = await
|
|
685
|
+
const I = await p.call();
|
|
686
686
|
if (!I.errors?.length && !I.result) return;
|
|
687
|
-
!I.errors && I.result[0] ?
|
|
687
|
+
!I.errors && I.result[0] ? g(I.result[0]) : g(fe);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}, { immediate: !0 });
|
|
692
|
-
const
|
|
692
|
+
const d = async (c) => {
|
|
693
693
|
if (o.canAdd !== "api" || !i) return;
|
|
694
|
-
const
|
|
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 ? (
|
|
700
|
+
I.result ? (g(I.result), a("addGroup", I.result)) : g(p), f.value?.resetCache(!0);
|
|
701
701
|
};
|
|
702
|
-
return (c,
|
|
702
|
+
return (c, p) => (h(), j($e, {
|
|
703
703
|
ref_key: "refSelector",
|
|
704
|
-
ref:
|
|
704
|
+
ref: f,
|
|
705
705
|
class: "top-groupSelector_group",
|
|
706
706
|
modelValue: l.value,
|
|
707
|
-
"onUpdate:modelValue":
|
|
708
|
-
items:
|
|
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
711
|
api: e.groups ? void 0 : m(r),
|
|
712
|
-
apiSetSearchParams: (...I) => m(
|
|
712
|
+
apiSetSearchParams: (...I) => m(ze)(...I, "name"),
|
|
713
713
|
appendSearchToResult: !!e.canAdd,
|
|
714
714
|
useAllItem: e.canSelectAll ? m(re)().name : !1,
|
|
715
715
|
addChanger: e.addChanger,
|
|
716
716
|
useCache: "",
|
|
717
|
-
onAppendItem:
|
|
717
|
+
onAppendItem: d
|
|
718
718
|
}, {
|
|
719
719
|
item: B(({ item: I }) => [
|
|
720
|
-
N("div",
|
|
721
|
-
I.id === m(ye) ? (h(), A("div",
|
|
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(), A("span",
|
|
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
|
-
}),
|
|
729
|
+
}), Dt = { class: "top-groupSelector" }, Eo = /* @__PURE__ */ K({
|
|
730
730
|
__name: "groupSelector",
|
|
731
|
-
props: /* @__PURE__ */
|
|
731
|
+
props: /* @__PURE__ */ L({
|
|
732
732
|
folderId: {},
|
|
733
733
|
folder: {},
|
|
734
734
|
groupId: {},
|
|
@@ -756,23 +756,23 @@ const _t = /* @__PURE__ */ K({
|
|
|
756
756
|
group: { default: fe },
|
|
757
757
|
groupModifiers: {}
|
|
758
758
|
}),
|
|
759
|
-
emits: /* @__PURE__ */
|
|
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,
|
|
762
|
-
n.value =
|
|
763
|
-
let
|
|
764
|
-
l.value || (
|
|
765
|
-
const C = (
|
|
766
|
-
let
|
|
767
|
-
o.groups &&
|
|
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 (
|
|
770
|
-
e.showFolders ? (h(), j(
|
|
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":
|
|
773
|
+
"onUpdate:folderId": g[0] || (g[0] = (d) => a.value = d),
|
|
774
774
|
folder: n.value,
|
|
775
|
-
"onUpdate:folder":
|
|
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 _t = /* @__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(), j(
|
|
784
|
+
e.showGroups ? (h(), j(Nt, {
|
|
785
785
|
key: 1,
|
|
786
786
|
groupId: l.value,
|
|
787
|
-
"onUpdate:groupId":
|
|
787
|
+
"onUpdate:groupId": g[2] || (g[2] = (d) => l.value = d),
|
|
788
788
|
group: r.value,
|
|
789
|
-
"onUpdate:group":
|
|
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,
|
|
@@ -803,7 +803,77 @@ const _t = /* @__PURE__ */ K({
|
|
|
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
|
-
}),
|
|
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,182 +881,115 @@ const _t = /* @__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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
],
|
|
882
|
-
return (
|
|
883
|
-
const
|
|
884
|
-
return h(), j(m(
|
|
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(
|
|
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), A(F, null,
|
|
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,
|
|
973
|
+
}, null, 8, Qt)
|
|
904
974
|
]))), 256)),
|
|
905
|
-
N("li",
|
|
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,
|
|
980
|
+
}, null, 8, Zt)
|
|
911
981
|
])
|
|
912
982
|
]),
|
|
913
983
|
_: 1
|
|
914
984
|
});
|
|
915
985
|
};
|
|
916
986
|
}
|
|
917
|
-
}),
|
|
918
|
-
id: null,
|
|
919
|
-
name: e,
|
|
920
|
-
listItemProps: {
|
|
921
|
-
type: "title"
|
|
922
|
-
}
|
|
923
|
-
}), ke = {
|
|
924
|
-
scheduledUpdate: !1,
|
|
925
|
-
manualUpdate: !1,
|
|
926
|
-
guestProjects: !1
|
|
927
|
-
}, Ht = (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
|
-
}, Jt = (e) => e.map((t) => ({
|
|
941
|
-
...t,
|
|
942
|
-
listItemProps: {
|
|
943
|
-
attrs: { title: t.name }
|
|
944
|
-
}
|
|
945
|
-
})), zt = (e, t, o) => {
|
|
946
|
-
if (!e || e.length === 0) return [];
|
|
947
|
-
t && Object.keys(ke).forEach((n) => ke[n] = !1);
|
|
948
|
-
const a = Jt(e);
|
|
949
|
-
return Ht(a, o);
|
|
950
|
-
}, Yt = (e) => {
|
|
951
|
-
if (!e) return;
|
|
952
|
-
e = e.replace(/#.*/, "");
|
|
953
|
-
let t = location.hash;
|
|
954
|
-
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, location.href = e;
|
|
955
|
-
}, Ge = (e) => {
|
|
956
|
-
const t = location.pathname.split("/");
|
|
957
|
-
let o = "project/dynamics/", a = "";
|
|
958
|
-
return t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), t[2] == "settings" && (a = location.hash), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (a = t[4] + "/"), "/" + o + e + "/" + a;
|
|
959
|
-
}, Le = (e) => {
|
|
960
|
-
let t = e.startsWith("http") ? e : "http://" + e;
|
|
961
|
-
return t = t.replace(/"/g, "%22"), t;
|
|
962
|
-
}, Qt = (e, t) => {
|
|
963
|
-
let o = e.params.filters ?? [];
|
|
964
|
-
o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
|
|
965
|
-
const a = ht(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
966
|
-
t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
|
|
967
|
-
}, Re = (e, t, o) => {
|
|
968
|
-
const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
|
|
969
|
-
return a.params = {
|
|
970
|
-
...o,
|
|
971
|
-
filters: [
|
|
972
|
-
ie("on", "GREATER_THAN_EQUALS", [0])
|
|
973
|
-
],
|
|
974
|
-
orders: [
|
|
975
|
-
le("user_id", "DESC", [t]),
|
|
976
|
-
le("on", "DESC"),
|
|
977
|
-
le("favorite", "DESC"),
|
|
978
|
-
le("id", "DESC")
|
|
979
|
-
]
|
|
980
|
-
}, a.options.onApiLoaded = (n, l, r) => {
|
|
981
|
-
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;
|
|
982
|
-
n.result = zt(n.result, i, u), r?.(n, l);
|
|
983
|
-
}, a;
|
|
984
|
-
}, Xt = (e) => e.gen("/add/projects_2/projects/"), me = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V = We(), et = _(0), Q = _(null), Ke = (e, t) => {
|
|
987
|
+
}), me = "ui_project_selector_total:", to = 1440 * 60 * 1e3, V = He(), at = _(0), Q = _(null), Oe = (e, t) => {
|
|
985
988
|
localStorage.setItem(
|
|
986
989
|
me + e,
|
|
987
|
-
JSON.stringify({ projectsTotal: t, expiresAt: Date.now() +
|
|
990
|
+
JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + to })
|
|
988
991
|
);
|
|
989
|
-
},
|
|
992
|
+
}, oo = (e) => {
|
|
990
993
|
const t = localStorage.getItem(me + e);
|
|
991
994
|
if (!t) return;
|
|
992
995
|
const { projectsTotal: o, expiresAt: a } = JSON.parse(t);
|
|
@@ -995,14 +998,14 @@ const _t = /* @__PURE__ */ K({
|
|
|
995
998
|
return;
|
|
996
999
|
}
|
|
997
1000
|
return o;
|
|
998
|
-
},
|
|
999
|
-
V.value = void 0, localStorage.removeItem(me + e), t &&
|
|
1000
|
-
},
|
|
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 = {
|
|
1001
1004
|
key: 0,
|
|
1002
1005
|
class: "top-comment"
|
|
1003
|
-
},
|
|
1006
|
+
}, so = ["href", "onClick"], Ue = 1e3, Mo = /* @__PURE__ */ K({
|
|
1004
1007
|
__name: "projectSelector",
|
|
1005
|
-
props: /* @__PURE__ */
|
|
1008
|
+
props: /* @__PURE__ */ L({
|
|
1006
1009
|
modelValue: {},
|
|
1007
1010
|
client: {},
|
|
1008
1011
|
addLinksToProjects: { type: Boolean, default: !0 },
|
|
@@ -1020,22 +1023,24 @@ const _t = /* @__PURE__ */ K({
|
|
|
1020
1023
|
const t = w();
|
|
1021
1024
|
if (!window.mo?.user?.id)
|
|
1022
1025
|
throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
|
|
1023
|
-
const o = window.mo.user.id, a = e, n = P(e, "modelValue"), l =
|
|
1026
|
+
const o = window.mo.user.id, a = e, n = P(e, "modelValue"), l = Ke(
|
|
1024
1027
|
a.client,
|
|
1025
1028
|
o
|
|
1026
|
-
), r =
|
|
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(() => {
|
|
1027
1030
|
if (!(!i.value && i.value !== 0))
|
|
1028
|
-
return i.value <
|
|
1031
|
+
return i.value < Ue ? "static" : "api";
|
|
1029
1032
|
});
|
|
1030
|
-
|
|
1031
|
-
|
|
1033
|
+
G(at, () => {
|
|
1034
|
+
p();
|
|
1035
|
+
}), G(n, () => {
|
|
1036
|
+
!n.value.id || !a.addLinksToProjects || Le(xe(n.value.id));
|
|
1032
1037
|
});
|
|
1033
|
-
const
|
|
1038
|
+
const g = async () => {
|
|
1034
1039
|
if (!Q.value) {
|
|
1035
|
-
const R =
|
|
1040
|
+
const R = Ke(
|
|
1036
1041
|
a.client,
|
|
1037
1042
|
o,
|
|
1038
|
-
{ limit:
|
|
1043
|
+
{ limit: Ue }
|
|
1039
1044
|
);
|
|
1040
1045
|
Q.value = R.call();
|
|
1041
1046
|
}
|
|
@@ -1045,17 +1050,17 @@ const _t = /* @__PURE__ */ K({
|
|
|
1045
1050
|
return;
|
|
1046
1051
|
}
|
|
1047
1052
|
return Q.value = null, k;
|
|
1048
|
-
},
|
|
1053
|
+
}, d = async () => {
|
|
1049
1054
|
if (i.value) return;
|
|
1050
|
-
const k = await
|
|
1051
|
-
k && (i.value = k.total,
|
|
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));
|
|
1052
1057
|
}, c = async (k) => {
|
|
1053
1058
|
const R = await r.changeParams({
|
|
1054
1059
|
url: k.name,
|
|
1055
1060
|
name: k.name
|
|
1056
1061
|
}).call();
|
|
1057
1062
|
if (!R.errors) {
|
|
1058
|
-
if (V.value &&
|
|
1063
|
+
if (V.value && s.value === "static") {
|
|
1059
1064
|
const y = {
|
|
1060
1065
|
id: Number(R.result),
|
|
1061
1066
|
user_id: o,
|
|
@@ -1066,82 +1071,82 @@ const _t = /* @__PURE__ */ K({
|
|
|
1066
1071
|
listItemProps: {
|
|
1067
1072
|
attrs: { title: k.name }
|
|
1068
1073
|
}
|
|
1069
|
-
},
|
|
1074
|
+
}, v = V.value.findIndex((x) => x.on === 0);
|
|
1070
1075
|
V.value = [
|
|
1071
|
-
...V.value.slice(0,
|
|
1076
|
+
...V.value.slice(0, v),
|
|
1072
1077
|
y,
|
|
1073
|
-
...V.value.slice(
|
|
1074
|
-
], i.value && (i.value += 1,
|
|
1078
|
+
...V.value.slice(v)
|
|
1079
|
+
], i.value && (i.value += 1, Oe(o, i.value));
|
|
1075
1080
|
}
|
|
1076
|
-
|
|
1081
|
+
s.value === "api" && ao(o);
|
|
1077
1082
|
}
|
|
1078
|
-
},
|
|
1079
|
-
|
|
1083
|
+
}, p = () => {
|
|
1084
|
+
s.value === "api" && f.value?.resetCache(!0);
|
|
1080
1085
|
}, I = async () => {
|
|
1081
|
-
if (V.value ||
|
|
1082
|
-
const k = await
|
|
1086
|
+
if (V.value || s.value !== "static") return;
|
|
1087
|
+
const k = await g();
|
|
1083
1088
|
k && (V.value = k.result);
|
|
1084
1089
|
};
|
|
1085
|
-
return
|
|
1086
|
-
await
|
|
1090
|
+
return lt(async () => {
|
|
1091
|
+
await d();
|
|
1087
1092
|
}), (k, R) => {
|
|
1088
|
-
const y =
|
|
1089
|
-
return h(), j(
|
|
1093
|
+
const y = We("TopButton");
|
|
1094
|
+
return h(), j($e, {
|
|
1090
1095
|
ref_key: "refSelector",
|
|
1091
|
-
ref:
|
|
1096
|
+
ref: f,
|
|
1092
1097
|
class: "top-projectSelector",
|
|
1093
1098
|
modelValue: n.value,
|
|
1094
|
-
"onUpdate:modelValue": R[1] || (R[1] = (
|
|
1099
|
+
"onUpdate:modelValue": R[1] || (R[1] = (v) => n.value = v),
|
|
1095
1100
|
items: C.value,
|
|
1096
1101
|
title: k.$i18n.Projects.Search_projects,
|
|
1097
1102
|
modificator: e.modificator,
|
|
1098
1103
|
searchFields: ["id", "name", "url"],
|
|
1099
|
-
placeholder:
|
|
1104
|
+
placeholder: u.value,
|
|
1100
1105
|
hasCloserBtn: "",
|
|
1101
|
-
api:
|
|
1102
|
-
apiSetSearchParams:
|
|
1106
|
+
api: s.value === "api" ? m(l) : void 0,
|
|
1107
|
+
apiSetSearchParams: s.value === "api" ? (...v) => m(Jt)(...v) : void 0,
|
|
1103
1108
|
useCache: "",
|
|
1104
1109
|
appendSearchToResult: "",
|
|
1105
1110
|
appendSearchAllowDuplicate: "",
|
|
1106
|
-
appendSearchToResultCond: m(
|
|
1111
|
+
appendSearchToResultCond: m(yt),
|
|
1107
1112
|
appendWithoutSelect: "",
|
|
1108
1113
|
buttonProps: e.buttonProps,
|
|
1109
1114
|
openerShortcut: e.openerShortcut,
|
|
1110
1115
|
onAppendItem: c,
|
|
1111
1116
|
onOpen: I
|
|
1112
1117
|
}, {
|
|
1113
|
-
item: B(({ item:
|
|
1114
|
-
N("div",
|
|
1115
|
-
N("div",
|
|
1116
|
-
|
|
1117
|
-
H(b(m(
|
|
1118
|
-
N("span",
|
|
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)
|
|
1119
1124
|
], 64)) : (h(), A(F, { key: 1 }, [
|
|
1120
|
-
|
|
1121
|
-
H(" " + b(
|
|
1125
|
+
v.listItemProps?.type ? M("", !0) : (h(), A("div", io, b(k.$i18n.Projects.Add_project) + ": ", 1)),
|
|
1126
|
+
H(" " + b(v.name), 1)
|
|
1122
1127
|
], 64))
|
|
1123
1128
|
]),
|
|
1124
|
-
|
|
1129
|
+
v.id ? (h(), A(F, { key: 0 }, [
|
|
1125
1130
|
e.addLinksToProjects ? (h(), A("a", {
|
|
1126
1131
|
key: 0,
|
|
1127
1132
|
class: "top-projectSelector_itemLink",
|
|
1128
|
-
href: m(
|
|
1129
|
-
onClick: W((x) => m(
|
|
1130
|
-
}, null, 8,
|
|
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),
|
|
1131
1136
|
k.$core.state.isMobile ? M("", !0) : (h(), j(y, {
|
|
1132
1137
|
key: 1,
|
|
1133
1138
|
class: "top-projectSelector_itemExtLink",
|
|
1134
|
-
href: m(
|
|
1139
|
+
href: m(Re)(v.url),
|
|
1135
1140
|
"data-top-icon": "",
|
|
1136
1141
|
color: "theme",
|
|
1137
1142
|
target: "_blank",
|
|
1138
1143
|
onClick: R[0] || (R[0] = W(() => {
|
|
1139
1144
|
}, ["stop"]))
|
|
1140
1145
|
}, null, 8, ["href"])),
|
|
1141
|
-
U(
|
|
1142
|
-
id:
|
|
1143
|
-
right:
|
|
1144
|
-
url: m(
|
|
1146
|
+
U(eo, {
|
|
1147
|
+
id: v.id,
|
|
1148
|
+
right: v.right ?? void 0,
|
|
1149
|
+
url: m(Re)(v.url)
|
|
1145
1150
|
}, null, 8, ["id", "right", "url"])
|
|
1146
1151
|
], 64)) : M("", !0)
|
|
1147
1152
|
])
|
|
@@ -1150,14 +1155,14 @@ const _t = /* @__PURE__ */ K({
|
|
|
1150
1155
|
}, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
|
|
1151
1156
|
};
|
|
1152
1157
|
}
|
|
1153
|
-
}),
|
|
1158
|
+
}), Ne = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, pe = (e, t) => {
|
|
1154
1159
|
e = te(e);
|
|
1155
1160
|
const o = t.find((a) => a.id === e);
|
|
1156
1161
|
if (o)
|
|
1157
1162
|
return o;
|
|
1158
|
-
},
|
|
1163
|
+
}, _o = (e, t, o) => {
|
|
1159
1164
|
t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1160
|
-
const a =
|
|
1165
|
+
const a = Qe.genElPopupOpener("div", t);
|
|
1161
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) => {
|
|
1162
1167
|
n.preventDefault(), n.stopPropagation(), a.onclick = null;
|
|
1163
1168
|
const l = _(e.modelValue), r = {
|
|
@@ -1167,15 +1172,15 @@ const _t = /* @__PURE__ */ K({
|
|
|
1167
1172
|
filters: e.filters,
|
|
1168
1173
|
payload: e.payload
|
|
1169
1174
|
};
|
|
1170
|
-
Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled,
|
|
1175
|
+
Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, Ee(e.modelValue) || G(l, () => {
|
|
1171
1176
|
e.modelValue = l.value, ne(a, e, o);
|
|
1172
1177
|
}), a.click();
|
|
1173
|
-
},
|
|
1178
|
+
}, Ee(e.modelValue) ? G(e.modelValue, () => ne(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
|
|
1174
1179
|
e.modelValue = n;
|
|
1175
1180
|
const l = Z(a, "topTagSelectorTarget");
|
|
1176
1181
|
l && (l.model.value = n), ne(a, e, o);
|
|
1177
1182
|
}), ne(a, e, o), a;
|
|
1178
|
-
},
|
|
1183
|
+
}, Vo = (e, t) => {
|
|
1179
1184
|
Z(e, "topTagSelectorRender")?.(t);
|
|
1180
1185
|
}, ne = (e, t, o) => {
|
|
1181
1186
|
const a = m(t.modelValue);
|
|
@@ -1184,7 +1189,7 @@ const _t = /* @__PURE__ */ K({
|
|
|
1184
1189
|
return;
|
|
1185
1190
|
}
|
|
1186
1191
|
if (e.innerHTML = "", !a.length && t.mode === "filter") {
|
|
1187
|
-
const n =
|
|
1192
|
+
const n = De({
|
|
1188
1193
|
id: "all",
|
|
1189
1194
|
colorId: "",
|
|
1190
1195
|
name: w().Common?.All_tags ?? "",
|
|
@@ -1193,18 +1198,18 @@ const _t = /* @__PURE__ */ K({
|
|
|
1193
1198
|
e.append(n);
|
|
1194
1199
|
}
|
|
1195
1200
|
a.forEach((n) => {
|
|
1196
|
-
const l =
|
|
1201
|
+
const l = De({
|
|
1197
1202
|
id: te(n),
|
|
1198
|
-
colorId:
|
|
1199
|
-
name:
|
|
1203
|
+
colorId: pe(n, t.tags)?.color_id ?? "",
|
|
1204
|
+
name: pe(n, t.tags)?.name ?? "",
|
|
1200
1205
|
state: te(n) === n ? "selected" : "excluded"
|
|
1201
1206
|
});
|
|
1202
1207
|
e.append(l);
|
|
1203
1208
|
});
|
|
1204
|
-
},
|
|
1209
|
+
}, De = (e) => {
|
|
1205
1210
|
const t = document.createElement("div");
|
|
1206
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;
|
|
1207
|
-
},
|
|
1212
|
+
}, uo = [
|
|
1208
1213
|
{
|
|
1209
1214
|
id: "1",
|
|
1210
1215
|
name: "Without Tag",
|
|
@@ -1255,7 +1260,7 @@ const _t = /* @__PURE__ */ K({
|
|
|
1255
1260
|
name: "Turquoise",
|
|
1256
1261
|
color_id: "10"
|
|
1257
1262
|
}
|
|
1258
|
-
],
|
|
1263
|
+
], co = ["data-tag_id", "data-tag_color_id", "title"], Ae = /* @__PURE__ */ K({
|
|
1259
1264
|
__name: "tagIcon",
|
|
1260
1265
|
props: {
|
|
1261
1266
|
id: {},
|
|
@@ -1273,11 +1278,11 @@ const _t = /* @__PURE__ */ K({
|
|
|
1273
1278
|
"data-tag_id": e.id,
|
|
1274
1279
|
"data-tag_color_id": e.colorId,
|
|
1275
1280
|
title: e.name
|
|
1276
|
-
}, null, 10,
|
|
1281
|
+
}, null, 10, co));
|
|
1277
1282
|
}
|
|
1278
|
-
}),
|
|
1283
|
+
}), fo = ["contenteditable", "onKeydown"], Fe = /* @__PURE__ */ K({
|
|
1279
1284
|
__name: "tagPopupListItem",
|
|
1280
|
-
props: /* @__PURE__ */
|
|
1285
|
+
props: /* @__PURE__ */ L({
|
|
1281
1286
|
editable: { type: Boolean },
|
|
1282
1287
|
disabled: { type: Boolean },
|
|
1283
1288
|
canExclude: { type: Boolean },
|
|
@@ -1291,25 +1296,25 @@ const _t = /* @__PURE__ */ K({
|
|
|
1291
1296
|
},
|
|
1292
1297
|
nameModifiers: {}
|
|
1293
1298
|
}),
|
|
1294
|
-
emits: /* @__PURE__ */
|
|
1299
|
+
emits: /* @__PURE__ */ L(["update:name", "unselect", "exclude", "select"], ["update:name"]),
|
|
1295
1300
|
setup(e, { emit: t }) {
|
|
1296
1301
|
const o = e, a = t, n = P(e, "name"), l = _(null), r = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
|
|
1297
1302
|
contenteditable: i.value,
|
|
1298
|
-
onpaste: (
|
|
1299
|
-
} : {}), i = _(!1),
|
|
1300
|
-
i.value = !0, await
|
|
1301
|
-
},
|
|
1302
|
-
const
|
|
1303
|
-
if (!
|
|
1304
|
-
l.value && (l.value.innerText =
|
|
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);
|
|
1305
1310
|
}, C = async () => {
|
|
1306
1311
|
l.value && (l.value.innerText = o.name), i.value = !1;
|
|
1307
|
-
},
|
|
1312
|
+
}, s = (g) => {
|
|
1308
1313
|
if (i.value || o.disabled) return;
|
|
1309
|
-
let
|
|
1310
|
-
o.canExclude && (
|
|
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");
|
|
1311
1316
|
};
|
|
1312
|
-
return (
|
|
1317
|
+
return (g, d) => (h(), j(Be, {
|
|
1313
1318
|
class: oe({
|
|
1314
1319
|
"top-tagSelector_tagListItem": !0,
|
|
1315
1320
|
"top-tagSelector_tagListItem-inEdit": i.value,
|
|
@@ -1318,47 +1323,47 @@ const _t = /* @__PURE__ */ K({
|
|
|
1318
1323
|
"top-tagSelector-active": !!e.state,
|
|
1319
1324
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1320
1325
|
}),
|
|
1321
|
-
onClick: W(
|
|
1326
|
+
onClick: W(s, ["stop"])
|
|
1322
1327
|
}, {
|
|
1323
1328
|
default: B(() => [
|
|
1324
|
-
U(
|
|
1329
|
+
U(Ae, {
|
|
1325
1330
|
id: e.id,
|
|
1326
1331
|
name: n.value,
|
|
1327
1332
|
colorId: e.colorId,
|
|
1328
1333
|
state: e.state
|
|
1329
1334
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
1330
|
-
N("span",
|
|
1335
|
+
N("span", Je({
|
|
1331
1336
|
ref_key: "elName",
|
|
1332
1337
|
ref: l,
|
|
1333
1338
|
class: "top-tagSelector_tagListItemName",
|
|
1334
1339
|
contenteditable: i.value ? "plaintext-only" : !1
|
|
1335
1340
|
}, r.value, {
|
|
1336
1341
|
onKeydown: [
|
|
1337
|
-
|
|
1338
|
-
|
|
1342
|
+
Me(W(u, ["stop"]), ["enter"]),
|
|
1343
|
+
Me(W(C, ["stop"]), ["esc"])
|
|
1339
1344
|
]
|
|
1340
|
-
}), b(n.value), 17,
|
|
1345
|
+
}), b(n.value), 17, fo),
|
|
1341
1346
|
e.editable ? (h(), A(F, { key: 0 }, [
|
|
1342
1347
|
i.value ? (h(), A("span", {
|
|
1343
1348
|
key: 1,
|
|
1344
1349
|
"data-top-icon": "",
|
|
1345
1350
|
class: "top-tagSelector_edit",
|
|
1346
|
-
onClick: W(
|
|
1351
|
+
onClick: W(u, ["stop"])
|
|
1347
1352
|
})) : (h(), A("span", {
|
|
1348
1353
|
key: 0,
|
|
1349
1354
|
"data-top-icon": "",
|
|
1350
1355
|
class: "top-tagSelector_edit",
|
|
1351
|
-
onClick:
|
|
1356
|
+
onClick: f
|
|
1352
1357
|
}))
|
|
1353
1358
|
], 64)) : M("", !0)
|
|
1354
1359
|
]),
|
|
1355
1360
|
_: 1
|
|
1356
1361
|
}, 8, ["class"]));
|
|
1357
1362
|
}
|
|
1358
|
-
}),
|
|
1363
|
+
}), go = { key: 1 }, mo = /* @__PURE__ */ K({
|
|
1359
1364
|
inheritAttrs: !1,
|
|
1360
1365
|
__name: "popupOpener",
|
|
1361
|
-
props: /* @__PURE__ */
|
|
1366
|
+
props: /* @__PURE__ */ L({
|
|
1362
1367
|
modelValue: {},
|
|
1363
1368
|
id: {},
|
|
1364
1369
|
tags: {},
|
|
@@ -1384,10 +1389,10 @@ const _t = /* @__PURE__ */ K({
|
|
|
1384
1389
|
payload: t.payload
|
|
1385
1390
|
};
|
|
1386
1391
|
return (r, i) => {
|
|
1387
|
-
const
|
|
1388
|
-
return h(), j(
|
|
1392
|
+
const f = rt("top-data");
|
|
1393
|
+
return h(), j(ft, { id: e.id }, {
|
|
1389
1394
|
default: B(() => [
|
|
1390
|
-
|
|
1395
|
+
it((h(), j(st(m(a)), Je({
|
|
1391
1396
|
class: {
|
|
1392
1397
|
"top-tagSelector": !0,
|
|
1393
1398
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1403,34 +1408,34 @@ const _t = /* @__PURE__ */ K({
|
|
|
1403
1408
|
styling: e.styling
|
|
1404
1409
|
}, r.$attrs), {
|
|
1405
1410
|
[m(n)]: B(() => [
|
|
1406
|
-
!o.value.length && e.mode === "filter" ? (h(), j(
|
|
1411
|
+
!o.value.length && e.mode === "filter" ? (h(), j(Ae, {
|
|
1407
1412
|
key: 0,
|
|
1408
1413
|
id: "all",
|
|
1409
1414
|
colorId: "",
|
|
1410
1415
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1411
1416
|
state: ""
|
|
1412
1417
|
}, null, 8, ["name"])) : M("", !0),
|
|
1413
|
-
e.mode === "setter" && e.filters ? (h(), A("div",
|
|
1414
|
-
|
|
1415
|
-
])) : (h(!0), A(F, { key: 2 },
|
|
1416
|
-
id: m(te)(
|
|
1417
|
-
colorId: m(
|
|
1418
|
-
name: m(
|
|
1419
|
-
state: m(te)(
|
|
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"
|
|
1420
1425
|
}, null, 8, ["id", "colorId", "name", "state"]))), 256))
|
|
1421
1426
|
]),
|
|
1422
1427
|
_: 2
|
|
1423
1428
|
}, 1040, ["class", "styling"])), [
|
|
1424
|
-
[
|
|
1429
|
+
[f, l, "topTagSelectorTarget"]
|
|
1425
1430
|
])
|
|
1426
1431
|
]),
|
|
1427
1432
|
_: 3
|
|
1428
1433
|
}, 8, ["id"]);
|
|
1429
1434
|
};
|
|
1430
1435
|
}
|
|
1431
|
-
}),
|
|
1436
|
+
}), Go = /* @__PURE__ */ K({
|
|
1432
1437
|
__name: "tagSelector",
|
|
1433
|
-
props: /* @__PURE__ */
|
|
1438
|
+
props: /* @__PURE__ */ L({
|
|
1434
1439
|
modelValue: {},
|
|
1435
1440
|
tags: {},
|
|
1436
1441
|
tagsEditable: { type: Boolean },
|
|
@@ -1448,66 +1453,66 @@ const _t = /* @__PURE__ */ K({
|
|
|
1448
1453
|
},
|
|
1449
1454
|
modelModifiers: {},
|
|
1450
1455
|
tags: {
|
|
1451
|
-
default:
|
|
1456
|
+
default: qe(uo)
|
|
1452
1457
|
},
|
|
1453
1458
|
tagsModifiers: {}
|
|
1454
1459
|
}),
|
|
1455
|
-
emits: /* @__PURE__ */
|
|
1460
|
+
emits: /* @__PURE__ */ L(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
1456
1461
|
setup(e, { emit: t }) {
|
|
1457
|
-
const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i =
|
|
1458
|
-
r(y,
|
|
1462
|
+
const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i = ct((y, v) => {
|
|
1463
|
+
r(y, v);
|
|
1459
1464
|
}, a.emitDelay);
|
|
1460
1465
|
a.singleMode && !n.value.length && (n.value = [l.value[0].id]);
|
|
1461
|
-
const
|
|
1462
|
-
const y = " " + o.Common.Tags?.toLowerCase(),
|
|
1463
|
-
return
|
|
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;
|
|
1464
1469
|
};
|
|
1465
|
-
let
|
|
1470
|
+
let s = He({
|
|
1466
1471
|
model: n,
|
|
1467
1472
|
mode: "filter",
|
|
1468
1473
|
targetId: void 0,
|
|
1469
1474
|
filters: void 0,
|
|
1470
1475
|
payload: void 0
|
|
1471
1476
|
});
|
|
1472
|
-
|
|
1477
|
+
G(n, () => {
|
|
1473
1478
|
i("selector", n.value);
|
|
1474
1479
|
});
|
|
1475
|
-
const
|
|
1476
|
-
if (
|
|
1477
|
-
return
|
|
1478
|
-
}),
|
|
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) => {
|
|
1479
1484
|
if (y !== "all") {
|
|
1480
|
-
if (
|
|
1481
|
-
if (
|
|
1485
|
+
if (s.value.model.value.includes(y)) return "selected";
|
|
1486
|
+
if (s.value.model.value.includes(Ne(y))) return "excluded";
|
|
1482
1487
|
}
|
|
1483
|
-
return y === "all" && !
|
|
1484
|
-
}, c = (y,
|
|
1485
|
-
const x =
|
|
1486
|
-
let T =
|
|
1487
|
-
|
|
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) => {
|
|
1488
1493
|
if (!a.tags) return 0;
|
|
1489
1494
|
const J = a.tags.findIndex((Y) => Y.id === O), z = a.tags.findIndex((Y) => Y.id === ae);
|
|
1490
1495
|
return J - z;
|
|
1491
|
-
}),
|
|
1496
|
+
}), s.value.model.value = T, s.value.mode === "setter" && s.value.targetId !== void 0 && i("setter", {
|
|
1492
1497
|
tagsIds: T,
|
|
1493
|
-
targetId:
|
|
1494
|
-
payload:
|
|
1498
|
+
targetId: s.value.targetId,
|
|
1499
|
+
payload: s.value.payload
|
|
1495
1500
|
});
|
|
1496
|
-
},
|
|
1501
|
+
}, p = E(() => {
|
|
1497
1502
|
let y = "top-tagSelector_popup";
|
|
1498
|
-
return
|
|
1503
|
+
return s.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), s.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
|
|
1499
1504
|
}), I = () => {
|
|
1500
1505
|
const y = prompt("", "New tag");
|
|
1501
1506
|
if (!y || y === "New tag") return;
|
|
1502
|
-
const
|
|
1507
|
+
const v = l.value.length + 1;
|
|
1503
1508
|
l.value.push({
|
|
1504
|
-
id: String(
|
|
1509
|
+
id: String(v),
|
|
1505
1510
|
name: y,
|
|
1506
|
-
color_id: String((
|
|
1511
|
+
color_id: String((v - 1) % 10 + 1)
|
|
1507
1512
|
}), r("tagsChanged", l.value);
|
|
1508
1513
|
}, k = (y) => {
|
|
1509
|
-
if (
|
|
1510
|
-
if (
|
|
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) {
|
|
1511
1516
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
1512
1517
|
return;
|
|
1513
1518
|
}
|
|
@@ -1518,7 +1523,7 @@ const _t = /* @__PURE__ */ K({
|
|
|
1518
1523
|
*/
|
|
1519
1524
|
cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
|
|
1520
1525
|
distance: 10,
|
|
1521
|
-
stop: function(
|
|
1526
|
+
stop: function(v, x) {
|
|
1522
1527
|
if (!l.value) return;
|
|
1523
1528
|
const T = $(x.item).parent().find("[data-tag_id]"), O = [];
|
|
1524
1529
|
T.each((ae, J) => {
|
|
@@ -1534,41 +1539,41 @@ const _t = /* @__PURE__ */ K({
|
|
|
1534
1539
|
}, R = (y) => {
|
|
1535
1540
|
X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
|
|
1536
1541
|
};
|
|
1537
|
-
return (y,
|
|
1538
|
-
U(
|
|
1542
|
+
return (y, v) => (h(), A(F, null, [
|
|
1543
|
+
U(mo, {
|
|
1539
1544
|
modelValue: n.value,
|
|
1540
|
-
"onUpdate:modelValue":
|
|
1541
|
-
id: m(
|
|
1545
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => n.value = x),
|
|
1546
|
+
id: m(f),
|
|
1542
1547
|
tags: l.value,
|
|
1543
1548
|
styling: e.styling,
|
|
1544
1549
|
mode: "filter",
|
|
1545
1550
|
useTopButton: e.useTopButton
|
|
1546
1551
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1547
|
-
U(
|
|
1548
|
-
id: m(
|
|
1549
|
-
class: oe(
|
|
1550
|
-
onOpen:
|
|
1551
|
-
onClose:
|
|
1552
|
+
U(je, {
|
|
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)),
|
|
1552
1557
|
"transition-duration": 50
|
|
1553
|
-
},
|
|
1558
|
+
}, ut({
|
|
1554
1559
|
contentList: B(() => [
|
|
1555
|
-
m(
|
|
1560
|
+
m(s).mode === "filter" && !e.singleMode ? (h(), j(Fe, {
|
|
1556
1561
|
key: 0,
|
|
1557
1562
|
id: "all",
|
|
1558
1563
|
colorId: "",
|
|
1559
1564
|
name: y.$i18n.Common.All_tags ?? "",
|
|
1560
|
-
state: m(
|
|
1561
|
-
onSelect:
|
|
1565
|
+
state: m(s).model.value.length ? "" : "selected",
|
|
1566
|
+
onSelect: v[3] || (v[3] = (x) => m(s).model.value = [])
|
|
1562
1567
|
}, null, 8, ["name", "state"])) : M("", !0),
|
|
1563
|
-
(h(!0), A(F, null,
|
|
1568
|
+
(h(!0), A(F, null, ve(l.value, (x) => (h(), j(Fe, {
|
|
1564
1569
|
key: x.id,
|
|
1565
1570
|
id: x.id,
|
|
1566
1571
|
colorId: x.color_id,
|
|
1567
1572
|
name: x.name,
|
|
1568
|
-
state:
|
|
1569
|
-
canExclude: m(
|
|
1573
|
+
state: d(x.id),
|
|
1574
|
+
canExclude: m(s).mode === "filter" && !e.singleMode,
|
|
1570
1575
|
editable: e.tagsEditable,
|
|
1571
|
-
disabled:
|
|
1576
|
+
disabled: g.value && d(x.id) === "",
|
|
1572
1577
|
onUnselect: (T) => c(x.id, "unselect"),
|
|
1573
1578
|
onSelect: (T) => c(x.id, "select"),
|
|
1574
1579
|
onExclude: (T) => c(x.id, "exclude"),
|
|
@@ -1576,7 +1581,7 @@ const _t = /* @__PURE__ */ K({
|
|
|
1576
1581
|
x.name = T, m(i)("tagsChanged", l.value);
|
|
1577
1582
|
}
|
|
1578
1583
|
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
1579
|
-
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j(
|
|
1584
|
+
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j(Be, {
|
|
1580
1585
|
key: 1,
|
|
1581
1586
|
"data-top-icon": "",
|
|
1582
1587
|
onClick: W(I, ["stop"])
|
|
@@ -1589,18 +1594,18 @@ const _t = /* @__PURE__ */ K({
|
|
|
1589
1594
|
]),
|
|
1590
1595
|
_: 2
|
|
1591
1596
|
}, [
|
|
1592
|
-
m(
|
|
1597
|
+
m(s).mode === "setter" && m(s).filters ? {
|
|
1593
1598
|
name: "header",
|
|
1594
1599
|
fn: B(() => [
|
|
1595
|
-
U(
|
|
1596
|
-
modelValue:
|
|
1597
|
-
"onUpdate:modelValue":
|
|
1600
|
+
U(Ce, {
|
|
1601
|
+
modelValue: u.value,
|
|
1602
|
+
"onUpdate:modelValue": v[1] || (v[1] = (x) => u.value = x),
|
|
1598
1603
|
options: C()
|
|
1599
1604
|
}, null, 8, ["modelValue", "options"])
|
|
1600
1605
|
]),
|
|
1601
1606
|
key: "0"
|
|
1602
1607
|
} : void 0,
|
|
1603
|
-
m(
|
|
1608
|
+
m(s).mode === "setter" && m(s).filters ? {
|
|
1604
1609
|
name: "footer",
|
|
1605
1610
|
fn: B(() => [
|
|
1606
1611
|
U(ee, { color: "theme" }, {
|
|
@@ -1610,15 +1615,15 @@ const _t = /* @__PURE__ */ K({
|
|
|
1610
1615
|
_: 1
|
|
1611
1616
|
}),
|
|
1612
1617
|
U(ee, {
|
|
1613
|
-
onClick:
|
|
1614
|
-
tagsIds: m(
|
|
1615
|
-
filters: m(
|
|
1616
|
-
filtersAction:
|
|
1617
|
-
payload: m(
|
|
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
|
|
1618
1623
|
}))
|
|
1619
1624
|
}, {
|
|
1620
1625
|
default: B(() => [
|
|
1621
|
-
H(b(
|
|
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)
|
|
1622
1627
|
]),
|
|
1623
1628
|
_: 1
|
|
1624
1629
|
})
|
|
@@ -1630,19 +1635,19 @@ const _t = /* @__PURE__ */ K({
|
|
|
1630
1635
|
}
|
|
1631
1636
|
});
|
|
1632
1637
|
export {
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
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
|
|
1647
1652
|
};
|
|
1648
1653
|
//# sourceMappingURL=project.js.map
|