@huyooo/ui 0.5.15 → 0.5.17
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/dist/{AuthkitAuthModal-z2tnXCf6.js → AuthkitAuthModal-CPyOF0SH.js} +17 -16
- package/dist/{AuthkitAuthorize-RSe0DQNQ.js → AuthkitAuthorize-DuQ4CKWT.js} +4 -5
- package/dist/{FeedbackItem-44CGbXN_.js → FeedbackItem-DGAsK3HZ.js} +1 -1
- package/dist/{FeedbackModal-DdTqdVlw.js → FeedbackModal-5C17AhkV.js} +4 -3
- package/dist/{Menu-BKBnsDJ8.js → Menu-Cxo8Rpu3.js} +5 -6
- package/dist/{MessageHandle-Cagv57D0.js → MessageHandle-thVNUp0p.js} +1 -1
- package/dist/{UserPanel-hGYAeWcj.js → UserPanel-B-gZUacS.js} +6 -6
- package/dist/{WidthContainer-6YR2TCen.js → WidthContainer-zVThjFve.js} +31 -39
- package/dist/authkit.js +3 -3
- package/dist/common.js +2 -2
- package/dist/components/HeaderMenus.vue.d.ts +1 -1
- package/dist/composables/Authkit/useAuthMenu.d.ts +9 -6
- package/dist/composables.js +2 -2
- package/dist/feedback.js +2 -2
- package/dist/index.js +14 -14
- package/dist/message.js +1 -1
- package/dist/pay.js +1 -1
- package/dist/referrer.js +1 -1
- package/dist/style.css +1 -1
- package/dist/useSEO-BLlxOmk2.js +617 -0
- package/dist/user.js +1 -1
- package/package.json +1 -1
- package/dist/useSEO-BkqUiuvw.js +0 -589
- /package/dist/{PaySubscriptions-Bva3INxJ.js → PaySubscriptions-CnPLduJz.js} +0 -0
- /package/dist/{ReferrerReferees-g-CcDpVO.js → ReferrerReferees-B3Ek3gAn.js} +0 -0
- /package/dist/{AuthkitAuthModal.vue_vue_type_style_index_1_lang-BpOmabWi.js → useAuthkitAuthModal-BpOmabWi.js} +0 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { ref as M, computed as h, watch as V, toValue as z, isRef as N, hasInjectionContext as G, inject as W, watchEffect as B, getCurrentInstance as F, onBeforeUnmount as J, onDeactivated as Q, onActivated as Z } from "vue";
|
|
2
|
+
import { useRouter as _, useRoute as x } from "vue-router";
|
|
3
|
+
import { u as R } from "./useAuthkitAppsAuthPageInfo-BifS1KOG.js";
|
|
4
|
+
import { a as U } from "./useAuthkitUsersProfile-zbKT0W_h.js";
|
|
5
|
+
const $ = M({
|
|
6
|
+
key: "",
|
|
7
|
+
name: ""
|
|
8
|
+
});
|
|
9
|
+
function be() {
|
|
10
|
+
function e(t, n) {
|
|
11
|
+
$.value.key = t, $.value.name = n;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
activeDoc: $,
|
|
15
|
+
setActiveDoc: e
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function we(e, t = "default") {
|
|
19
|
+
const n = document;
|
|
20
|
+
if (n && typeof n.startViewTransition == "function") {
|
|
21
|
+
const r = document.body;
|
|
22
|
+
r.classList.add(`vt-${t}`), n.startViewTransition(() => {
|
|
23
|
+
try {
|
|
24
|
+
e();
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
}).finished.finally(() => {
|
|
28
|
+
r.classList.remove(`vt-${t}`);
|
|
29
|
+
});
|
|
30
|
+
} else
|
|
31
|
+
e();
|
|
32
|
+
}
|
|
33
|
+
function Se(e, t, n) {
|
|
34
|
+
var r;
|
|
35
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
36
|
+
const s = e[o];
|
|
37
|
+
if (((r = s.meta) == null ? void 0 : r.menuType) === t)
|
|
38
|
+
return s.path;
|
|
39
|
+
}
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
function Ae(e) {
|
|
43
|
+
const t = _(), {
|
|
44
|
+
appsData: n
|
|
45
|
+
} = R(), {
|
|
46
|
+
isLoggedIn: r,
|
|
47
|
+
userProfile: o
|
|
48
|
+
} = U(), s = h(() => {
|
|
49
|
+
var m;
|
|
50
|
+
return !r.value || !o.value ? [] : ((m = o.value.permissions) == null ? void 0 : m.map((l) => l.permissionKey)) || [];
|
|
51
|
+
});
|
|
52
|
+
function i(m) {
|
|
53
|
+
return (n.value.publicRoutes || []).some((d) => d.permissionKey === m);
|
|
54
|
+
}
|
|
55
|
+
function c(m) {
|
|
56
|
+
return r.value ? s.value.includes(m) : !1;
|
|
57
|
+
}
|
|
58
|
+
function a(m) {
|
|
59
|
+
var l;
|
|
60
|
+
return {
|
|
61
|
+
path: m.path,
|
|
62
|
+
name: m.name,
|
|
63
|
+
meta: m.meta,
|
|
64
|
+
children: (l = m.children) == null ? void 0 : l.map((d) => a(d))
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function p(m, l) {
|
|
68
|
+
const d = [];
|
|
69
|
+
for (const u of m) {
|
|
70
|
+
if (u.path === "/" || u.path === "/:catchAll(.*)")
|
|
71
|
+
continue;
|
|
72
|
+
const f = u.meta;
|
|
73
|
+
if ((f == null ? void 0 : f.menuType) === l) {
|
|
74
|
+
const w = u.path;
|
|
75
|
+
if (i(w) || c(w)) {
|
|
76
|
+
const E = {
|
|
77
|
+
name: (f == null ? void 0 : f.menuName) || (f == null ? void 0 : f.title) || (typeof u.name == "string" ? u.name : u.path),
|
|
78
|
+
path: u.path,
|
|
79
|
+
icon: (f == null ? void 0 : f.menuIcon) || (f == null ? void 0 : f.icon),
|
|
80
|
+
hidden: f == null ? void 0 : f.hidden
|
|
81
|
+
};
|
|
82
|
+
if (u.children && u.children.length > 0) {
|
|
83
|
+
const O = p(u.children, l);
|
|
84
|
+
O.length > 0 && (E.children = O);
|
|
85
|
+
}
|
|
86
|
+
d.push(E);
|
|
87
|
+
}
|
|
88
|
+
} else if (u.children && u.children.length > 0) {
|
|
89
|
+
const w = p(u.children, l);
|
|
90
|
+
d.push(...w);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return d;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
menus: h(() => {
|
|
97
|
+
if (!e)
|
|
98
|
+
return [];
|
|
99
|
+
const d = t.getRoutes().filter((u) => u.path === "/" || u.path === "/:catchAll(.*)" ? !1 : u.path.split("/").filter((I) => I).length === 1).map(a);
|
|
100
|
+
return console.log(p(d, e), "过滤菜单"), p(d, e);
|
|
101
|
+
}),
|
|
102
|
+
isRoutePublic: i,
|
|
103
|
+
hasPermission: (m) => i(m) ? !0 : c(m),
|
|
104
|
+
isLoggedIn: r
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function $e() {
|
|
108
|
+
const e = _(), t = x(), {
|
|
109
|
+
appsAuthPageInfoApi: n,
|
|
110
|
+
appsData: r,
|
|
111
|
+
appsAuthPageInfoSuccess: o
|
|
112
|
+
} = R(), {
|
|
113
|
+
userProfile: s,
|
|
114
|
+
isLoggedIn: i,
|
|
115
|
+
usersProfileSuccess: c
|
|
116
|
+
} = U(), a = M(!1);
|
|
117
|
+
function p(l) {
|
|
118
|
+
return (r.value.publicRoutes || []).some((u) => u.permissionKey === l);
|
|
119
|
+
}
|
|
120
|
+
function y(l) {
|
|
121
|
+
var u;
|
|
122
|
+
return !i.value || !s.value ? !1 : (((u = s.value.permissions) == null ? void 0 : u.map((f) => f.permissionKey)) || []).includes(l);
|
|
123
|
+
}
|
|
124
|
+
function m(l) {
|
|
125
|
+
var d, u;
|
|
126
|
+
if (!o.value) {
|
|
127
|
+
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成", l);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (a.value = !0, p(l)) {
|
|
131
|
+
console.log("权限检查通过:公开路由", l), a.value = !1;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!c.value) {
|
|
135
|
+
console.log("权限检查跳过:usersProfileSuccess 未加载完成,等待...", l), a.value = !1;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (!i.value) {
|
|
139
|
+
console.log("权限检查失败:未登录,重定向到首页", l), e.replace("/"), a.value = !1;
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
y(l) ? console.log("权限检查通过:有权限", l) : (console.log("权限检查失败:无权限,重定向到首页", l, {
|
|
143
|
+
permissions: (u = (d = s.value) == null ? void 0 : d.permissions) == null ? void 0 : u.map((f) => f.permissionKey)
|
|
144
|
+
}), e.replace("/")), a.value = !1;
|
|
145
|
+
}
|
|
146
|
+
return n(), V(() => t.path, (l) => {
|
|
147
|
+
m(l);
|
|
148
|
+
}), V([o, c], ([l]) => {
|
|
149
|
+
l && m(t.path);
|
|
150
|
+
}), {
|
|
151
|
+
isChecking: a,
|
|
152
|
+
isRoutePublic: p,
|
|
153
|
+
hasPermission: y
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]), Te = /* @__PURE__ */ new Set([
|
|
157
|
+
"base",
|
|
158
|
+
"meta",
|
|
159
|
+
"link",
|
|
160
|
+
"style",
|
|
161
|
+
"script",
|
|
162
|
+
"noscript"
|
|
163
|
+
]), Pe = /* @__PURE__ */ new Set([
|
|
164
|
+
"title",
|
|
165
|
+
"base",
|
|
166
|
+
"htmlAttrs",
|
|
167
|
+
"bodyAttrs",
|
|
168
|
+
"meta",
|
|
169
|
+
"link",
|
|
170
|
+
"style",
|
|
171
|
+
"script",
|
|
172
|
+
"noscript"
|
|
173
|
+
]), ee = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]), te = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]), Me = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]), j = /* @__PURE__ */ new Set([
|
|
174
|
+
"theme-color",
|
|
175
|
+
"google-site-verification",
|
|
176
|
+
"og",
|
|
177
|
+
"article",
|
|
178
|
+
"book",
|
|
179
|
+
"profile",
|
|
180
|
+
"twitter",
|
|
181
|
+
"author"
|
|
182
|
+
]), b = {
|
|
183
|
+
META: /* @__PURE__ */ new Set(["twitter"]),
|
|
184
|
+
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
|
185
|
+
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
|
186
|
+
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
|
187
|
+
}, ne = {
|
|
188
|
+
articleExpirationTime: "article:expiration_time",
|
|
189
|
+
articleModifiedTime: "article:modified_time",
|
|
190
|
+
articlePublishedTime: "article:published_time",
|
|
191
|
+
bookReleaseDate: "book:release_date",
|
|
192
|
+
fbAppId: "fb:app_id",
|
|
193
|
+
ogAudioSecureUrl: "og:audio:secure_url",
|
|
194
|
+
ogAudioUrl: "og:audio",
|
|
195
|
+
ogImageSecureUrl: "og:image:secure_url",
|
|
196
|
+
ogImageUrl: "og:image",
|
|
197
|
+
ogSiteName: "og:site_name",
|
|
198
|
+
ogVideoSecureUrl: "og:video:secure_url",
|
|
199
|
+
ogVideoUrl: "og:video",
|
|
200
|
+
profileFirstName: "profile:first_name",
|
|
201
|
+
profileLastName: "profile:last_name",
|
|
202
|
+
profileUsername: "profile:username",
|
|
203
|
+
msapplicationConfig: "msapplication-Config",
|
|
204
|
+
msapplicationTileColor: "msapplication-TileColor",
|
|
205
|
+
msapplicationTileImage: "msapplication-TileImage"
|
|
206
|
+
}, K = {
|
|
207
|
+
appleItunesApp: {
|
|
208
|
+
unpack: {
|
|
209
|
+
entrySeparator: ", ",
|
|
210
|
+
// @ts-expect-error untyped
|
|
211
|
+
resolve: ({ key: e, value: t }) => `${g(e)}=${t}`
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
refresh: {
|
|
215
|
+
metaKey: "http-equiv",
|
|
216
|
+
unpack: {
|
|
217
|
+
entrySeparator: ";",
|
|
218
|
+
// @ts-expect-error untyped
|
|
219
|
+
resolve: ({ key: e, value: t }) => e === "seconds" ? `${t}` : void 0
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
robots: {
|
|
223
|
+
unpack: {
|
|
224
|
+
entrySeparator: ", ",
|
|
225
|
+
// @ts-expect-error untyped
|
|
226
|
+
resolve: ({ key: e, value: t }) => typeof t == "boolean" ? g(e) : `${g(e)}:${t}`
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
contentSecurityPolicy: {
|
|
230
|
+
metaKey: "http-equiv",
|
|
231
|
+
unpack: {
|
|
232
|
+
entrySeparator: "; ",
|
|
233
|
+
// @ts-expect-error untyped
|
|
234
|
+
resolve: ({ key: e, value: t }) => `${g(e)} ${t}`
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
charset: {}
|
|
238
|
+
};
|
|
239
|
+
function g(e) {
|
|
240
|
+
const t = e.replace(/([A-Z])/g, "-$1").toLowerCase(), n = t.indexOf("-");
|
|
241
|
+
return n === -1 ? t : b.META.has(t.slice(0, n)) || b.OG.has(t.slice(0, n)) ? e.replace(/([A-Z])/g, ":$1").toLowerCase() : t;
|
|
242
|
+
}
|
|
243
|
+
function D(e) {
|
|
244
|
+
return Object.fromEntries(Object.entries(e).filter(([t, n]) => String(n) !== "false" && t));
|
|
245
|
+
}
|
|
246
|
+
function T(e) {
|
|
247
|
+
return Array.isArray(e) ? e.map(T) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [g(t), T(n)]));
|
|
248
|
+
}
|
|
249
|
+
function L(e, t = {}) {
|
|
250
|
+
const { entrySeparator: n = "", keyValueSeparator: r = "", wrapValue: o, resolve: s } = t;
|
|
251
|
+
return Object.entries(e).map(([i, c]) => {
|
|
252
|
+
if (s) {
|
|
253
|
+
const p = s({ key: i, value: c });
|
|
254
|
+
if (p !== void 0)
|
|
255
|
+
return p;
|
|
256
|
+
}
|
|
257
|
+
const a = typeof c == "object" ? L(c, t) : typeof c == "number" ? c.toString() : typeof c == "string" && o ? `${o}${c.replace(new RegExp(o, "g"), `\\${o}`)}${o}` : c;
|
|
258
|
+
return `${i}${r}${a}`;
|
|
259
|
+
}).join(n);
|
|
260
|
+
}
|
|
261
|
+
function C(e, t) {
|
|
262
|
+
const n = D(t), r = g(e), o = H(r);
|
|
263
|
+
if (!j.has(r))
|
|
264
|
+
return [{ [o]: r, ...n }];
|
|
265
|
+
const s = Object.fromEntries(
|
|
266
|
+
Object.entries(n).map(([i, c]) => [`${e}${i === "url" ? "" : `${i[0].toUpperCase()}${i.slice(1)}`}`, c])
|
|
267
|
+
);
|
|
268
|
+
return S(s || {}).sort((i, c) => {
|
|
269
|
+
var a, p;
|
|
270
|
+
return (((a = i[o]) == null ? void 0 : a.length) || 0) - (((p = c[o]) == null ? void 0 : p.length) || 0);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function H(e) {
|
|
274
|
+
var r;
|
|
275
|
+
if (((r = K[e]) == null ? void 0 : r.metaKey) === "http-equiv" || b.HTTP_EQUIV.has(e))
|
|
276
|
+
return "http-equiv";
|
|
277
|
+
const t = g(e), n = t.indexOf(":");
|
|
278
|
+
return n === -1 ? "name" : b.OG.has(t.slice(0, n)) ? "property" : "name";
|
|
279
|
+
}
|
|
280
|
+
function re(e) {
|
|
281
|
+
return ne[e] || g(e);
|
|
282
|
+
}
|
|
283
|
+
function oe(e, t) {
|
|
284
|
+
var n;
|
|
285
|
+
return t === "refresh" ? `${e.seconds};url=${e.url}` : L(T(e), {
|
|
286
|
+
keyValueSeparator: "=",
|
|
287
|
+
entrySeparator: ", ",
|
|
288
|
+
resolve: ({ value: r, key: o }) => r === null ? "" : typeof r == "boolean" ? o : void 0,
|
|
289
|
+
// @ts-expect-error untyped
|
|
290
|
+
...(n = K[t]) == null ? void 0 : n.unpack
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function S(e) {
|
|
294
|
+
const t = [], n = {};
|
|
295
|
+
for (const [o, s] of Object.entries(e)) {
|
|
296
|
+
if (Array.isArray(s)) {
|
|
297
|
+
if (o === "themeColor") {
|
|
298
|
+
s.forEach((i) => {
|
|
299
|
+
typeof i == "object" && i !== null && t.push({ name: "theme-color", ...i });
|
|
300
|
+
});
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
for (const i of s)
|
|
304
|
+
if (typeof i == "object" && i !== null) {
|
|
305
|
+
const c = [], a = [];
|
|
306
|
+
for (const [p, y] of Object.entries(i)) {
|
|
307
|
+
const m = `${o}${p === "url" ? "" : `:${p}`}`, l = S({ [m]: y });
|
|
308
|
+
(p === "url" ? c : a).push(...l);
|
|
309
|
+
}
|
|
310
|
+
t.push(...c, ...a);
|
|
311
|
+
} else
|
|
312
|
+
t.push(...typeof i == "string" ? S({ [o]: i }) : C(o, i));
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (typeof s == "object" && s)
|
|
316
|
+
if (b.MEDIA.has(o)) {
|
|
317
|
+
const i = o.startsWith("twitter") ? "twitter" : "og", c = o.replace(/^(og|twitter)/, "").toLowerCase(), a = i === "twitter" ? "name" : "property";
|
|
318
|
+
s.url && t.push({
|
|
319
|
+
[a]: `${i}:${c}`,
|
|
320
|
+
content: s.url
|
|
321
|
+
}), s.secureUrl && t.push({
|
|
322
|
+
[a]: `${i}:${c}:secure_url`,
|
|
323
|
+
content: s.secureUrl
|
|
324
|
+
});
|
|
325
|
+
for (const [p, y] of Object.entries(s))
|
|
326
|
+
p !== "url" && p !== "secureUrl" && t.push({
|
|
327
|
+
[a]: `${i}:${c}:${p}`,
|
|
328
|
+
// @ts-expect-error untyped
|
|
329
|
+
content: y
|
|
330
|
+
});
|
|
331
|
+
} else j.has(g(o)) ? t.push(...C(o, s)) : n[o] = D(s);
|
|
332
|
+
else
|
|
333
|
+
n[o] = s;
|
|
334
|
+
}
|
|
335
|
+
const r = Object.entries(n).map(([o, s]) => {
|
|
336
|
+
if (o === "charset")
|
|
337
|
+
return { charset: s === null ? "_null" : s };
|
|
338
|
+
const i = H(o), c = re(o), a = s === null ? "_null" : typeof s == "object" ? oe(s, o) : typeof s == "number" ? s.toString() : s;
|
|
339
|
+
return i === "http-equiv" ? { "http-equiv": c, content: a } : { [i]: c, content: a };
|
|
340
|
+
});
|
|
341
|
+
return [...t, ...r].map(
|
|
342
|
+
(o) => "content" in o && o.content === "_null" ? { ...o, content: null } : o
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
const se = {
|
|
346
|
+
key: "flatMeta",
|
|
347
|
+
hooks: {
|
|
348
|
+
"entries:normalize": (e) => {
|
|
349
|
+
const t = [];
|
|
350
|
+
e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(S(n.props).map((r) => ({
|
|
351
|
+
...n,
|
|
352
|
+
tag: "meta",
|
|
353
|
+
props: r
|
|
354
|
+
}))), !1)).filter(Boolean).concat(...t);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}, ie = ["name", "property", "http-equiv"], ce = /* @__PURE__ */ new Set([
|
|
358
|
+
"viewport",
|
|
359
|
+
"description",
|
|
360
|
+
"keywords",
|
|
361
|
+
"robots"
|
|
362
|
+
]);
|
|
363
|
+
function je(e) {
|
|
364
|
+
const t = e.split(":");
|
|
365
|
+
return t.length ? j.has(t[1]) : !1;
|
|
366
|
+
}
|
|
367
|
+
function ve(e) {
|
|
368
|
+
const { props: t, tag: n } = e;
|
|
369
|
+
if (ee.has(n))
|
|
370
|
+
return n;
|
|
371
|
+
if (n === "link" && t.rel === "canonical")
|
|
372
|
+
return "canonical";
|
|
373
|
+
if (t.charset)
|
|
374
|
+
return "charset";
|
|
375
|
+
if (e.tag === "meta") {
|
|
376
|
+
for (const r of ie)
|
|
377
|
+
if (t[r] !== void 0) {
|
|
378
|
+
const o = t[r], s = o.includes(":"), i = ce.has(o), a = !(s || i) && e.key ? `:key:${e.key}` : "";
|
|
379
|
+
return `${n}:${o}${a}`;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (e.key)
|
|
383
|
+
return `${n}:key:${e.key}`;
|
|
384
|
+
if (t.id)
|
|
385
|
+
return `${n}:id:${t.id}`;
|
|
386
|
+
if (Y.has(n)) {
|
|
387
|
+
const r = e.textContent || e.innerHTML;
|
|
388
|
+
if (r)
|
|
389
|
+
return `${n}:content:${r}`;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function Ie(e) {
|
|
393
|
+
const t = e._h || e._d;
|
|
394
|
+
if (t)
|
|
395
|
+
return t;
|
|
396
|
+
const n = e.textContent || e.innerHTML;
|
|
397
|
+
return n || `${e.tag}:${Object.entries(e.props).map(([r, o]) => `${r}:${String(o)}`).join(",")}`;
|
|
398
|
+
}
|
|
399
|
+
function A(e, t, n) {
|
|
400
|
+
typeof e === "function" && (!n || n !== "titleTemplate" && !(n[0] === "o" && n[1] === "n")) && (e = e());
|
|
401
|
+
let o;
|
|
402
|
+
if (t && (o = t(n, e)), Array.isArray(o))
|
|
403
|
+
return o.map((s) => A(s, t));
|
|
404
|
+
if ((o == null ? void 0 : o.constructor) === Object) {
|
|
405
|
+
const s = {};
|
|
406
|
+
for (const i of Object.keys(o))
|
|
407
|
+
s[i] = A(o[i], t, i);
|
|
408
|
+
return s;
|
|
409
|
+
}
|
|
410
|
+
return o;
|
|
411
|
+
}
|
|
412
|
+
function ae(e, t) {
|
|
413
|
+
const n = e === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
|
|
414
|
+
function r(o) {
|
|
415
|
+
const s = o.trim();
|
|
416
|
+
if (s)
|
|
417
|
+
if (e === "style") {
|
|
418
|
+
const [i, ...c] = s.split(":").map((a) => a.trim());
|
|
419
|
+
i && c.length && n.set(i, c.join(":"));
|
|
420
|
+
} else
|
|
421
|
+
s.split(" ").filter(Boolean).forEach((i) => n.add(i));
|
|
422
|
+
}
|
|
423
|
+
return typeof t == "string" ? e === "style" ? t.split(";").forEach(r) : r(t) : Array.isArray(t) ? t.forEach((o) => r(o)) : t && typeof t == "object" && Object.entries(t).forEach(([o, s]) => {
|
|
424
|
+
s && s !== "false" && (e === "style" ? n.set(o.trim(), s) : r(o));
|
|
425
|
+
}), n;
|
|
426
|
+
}
|
|
427
|
+
function le(e, t) {
|
|
428
|
+
return e.props = e.props || {}, t ? e.tag === "templateParams" ? (e.props = t, e) : (Object.entries(t).forEach(([n, r]) => {
|
|
429
|
+
if (r === null) {
|
|
430
|
+
e.props[n] = null;
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (n === "class" || n === "style") {
|
|
434
|
+
e.props[n] = ae(n, r);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (te.has(n)) {
|
|
438
|
+
if (["textContent", "innerHTML"].includes(n) && typeof r == "object") {
|
|
439
|
+
let i = t.type;
|
|
440
|
+
if (t.type || (i = "application/json"), !(i != null && i.endsWith("json")) && i !== "speculationrules")
|
|
441
|
+
return;
|
|
442
|
+
t.type = i, e.props.type = i, e[n] = JSON.stringify(r);
|
|
443
|
+
} else
|
|
444
|
+
e[n] = r;
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const o = String(r), s = n.startsWith("data-");
|
|
448
|
+
o === "true" || o === "" ? e.props[n] = s ? o : !0 : !r && s && o === "false" ? e.props[n] = "false" : r !== void 0 && (e.props[n] = r);
|
|
449
|
+
}), e) : e;
|
|
450
|
+
}
|
|
451
|
+
function ue(e, t) {
|
|
452
|
+
const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r = le({ tag: e, props: {} }, n);
|
|
453
|
+
return r.key && X.has(r.tag) && (r.props["data-hid"] = r._h = r.key), r.tag === "script" && typeof r.innerHTML == "object" && (r.innerHTML = JSON.stringify(r.innerHTML), r.props.type = r.props.type || "application/json"), Array.isArray(r.props.content) ? r.props.content.map((o) => ({ ...r, props: { ...r.props, content: o } })) : r;
|
|
454
|
+
}
|
|
455
|
+
function Ee(e, t) {
|
|
456
|
+
if (!e)
|
|
457
|
+
return [];
|
|
458
|
+
typeof e == "function" && (e = e());
|
|
459
|
+
const n = (o, s) => {
|
|
460
|
+
for (let i = 0; i < t.length; i++)
|
|
461
|
+
s = t[i](o, s);
|
|
462
|
+
return s;
|
|
463
|
+
};
|
|
464
|
+
e = n(void 0, e);
|
|
465
|
+
const r = [];
|
|
466
|
+
return e = A(e, n), Object.entries(e || {}).forEach(([o, s]) => {
|
|
467
|
+
if (s !== void 0)
|
|
468
|
+
for (const i of Array.isArray(s) ? s : [s])
|
|
469
|
+
r.push(ue(o, i));
|
|
470
|
+
}), r.flat();
|
|
471
|
+
}
|
|
472
|
+
const pe = (e, t) => N(t) ? z(t) : t, k = "usehead";
|
|
473
|
+
// @__NO_SIDE_EFFECTS__
|
|
474
|
+
function Oe(e) {
|
|
475
|
+
return {
|
|
476
|
+
install(n) {
|
|
477
|
+
n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(k, e);
|
|
478
|
+
}
|
|
479
|
+
}.install;
|
|
480
|
+
}
|
|
481
|
+
// @__NO_SIDE_EFFECTS__
|
|
482
|
+
function q() {
|
|
483
|
+
if (G()) {
|
|
484
|
+
const e = W(k);
|
|
485
|
+
if (!e)
|
|
486
|
+
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
487
|
+
return e;
|
|
488
|
+
}
|
|
489
|
+
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
490
|
+
}
|
|
491
|
+
function v(e, t = {}) {
|
|
492
|
+
const n = t.head || /* @__PURE__ */ q();
|
|
493
|
+
return n.ssr ? n.push(e || {}, t) : fe(n, e, t);
|
|
494
|
+
}
|
|
495
|
+
function fe(e, t, n = {}) {
|
|
496
|
+
const r = M(!1);
|
|
497
|
+
let o;
|
|
498
|
+
return B(() => {
|
|
499
|
+
const i = r.value ? {} : A(t, pe);
|
|
500
|
+
o ? o.patch(i) : o = e.push(i, n);
|
|
501
|
+
}), F() && (J(() => {
|
|
502
|
+
o.dispose();
|
|
503
|
+
}), Q(() => {
|
|
504
|
+
r.value = !0;
|
|
505
|
+
}), Z(() => {
|
|
506
|
+
r.value = !1;
|
|
507
|
+
})), o;
|
|
508
|
+
}
|
|
509
|
+
function P(e = {}, t = {}) {
|
|
510
|
+
(t.head || /* @__PURE__ */ q()).use(se);
|
|
511
|
+
const { title: r, titleTemplate: o, ...s } = e;
|
|
512
|
+
return v({
|
|
513
|
+
title: r,
|
|
514
|
+
titleTemplate: o,
|
|
515
|
+
_flatMeta: s
|
|
516
|
+
}, t);
|
|
517
|
+
}
|
|
518
|
+
function Ve() {
|
|
519
|
+
function e(n) {
|
|
520
|
+
P({
|
|
521
|
+
ogSiteName: n.siteName,
|
|
522
|
+
ogLocale: n.locale
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
function t(n) {
|
|
526
|
+
const {
|
|
527
|
+
title: r,
|
|
528
|
+
description: o,
|
|
529
|
+
keywords: s,
|
|
530
|
+
image: i,
|
|
531
|
+
url: c,
|
|
532
|
+
type: a = "website"
|
|
533
|
+
} = n, p = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
|
|
534
|
+
v({
|
|
535
|
+
title: r,
|
|
536
|
+
link: c ? [{
|
|
537
|
+
rel: "canonical",
|
|
538
|
+
href: c
|
|
539
|
+
}] : []
|
|
540
|
+
}), P({
|
|
541
|
+
description: p || o,
|
|
542
|
+
keywords: s,
|
|
543
|
+
ogTitle: r,
|
|
544
|
+
ogDescription: p || o,
|
|
545
|
+
ogType: a === "product" ? void 0 : a,
|
|
546
|
+
// product 类型不被支持,跳过
|
|
547
|
+
ogUrl: c,
|
|
548
|
+
ogImage: i,
|
|
549
|
+
twitterCard: "summary_large_image",
|
|
550
|
+
twitterTitle: r,
|
|
551
|
+
twitterDescription: p || o,
|
|
552
|
+
twitterImage: i
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
return {
|
|
556
|
+
setGlobalSEO: e,
|
|
557
|
+
setPageSEO: t
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function Ce() {
|
|
561
|
+
const e = x(), t = () => e.meta;
|
|
562
|
+
v({
|
|
563
|
+
title: h(() => t().title || ""),
|
|
564
|
+
link: h(() => {
|
|
565
|
+
const n = t();
|
|
566
|
+
return n.url ? [{
|
|
567
|
+
rel: "canonical",
|
|
568
|
+
href: n.url
|
|
569
|
+
}] : [];
|
|
570
|
+
})
|
|
571
|
+
}), P({
|
|
572
|
+
description: h(() => {
|
|
573
|
+
const r = t().description;
|
|
574
|
+
if (r)
|
|
575
|
+
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
576
|
+
}),
|
|
577
|
+
keywords: h(() => t().keywords),
|
|
578
|
+
ogTitle: h(() => t().title),
|
|
579
|
+
ogDescription: h(() => {
|
|
580
|
+
const r = t().description;
|
|
581
|
+
if (r)
|
|
582
|
+
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
583
|
+
}),
|
|
584
|
+
ogType: h(() => {
|
|
585
|
+
const r = t().type || "website";
|
|
586
|
+
return r === "product" ? void 0 : r;
|
|
587
|
+
}),
|
|
588
|
+
ogUrl: h(() => t().url),
|
|
589
|
+
ogImage: h(() => t().image),
|
|
590
|
+
twitterCard: "summary_large_image",
|
|
591
|
+
twitterTitle: h(() => t().title),
|
|
592
|
+
twitterDescription: h(() => {
|
|
593
|
+
const r = t().description;
|
|
594
|
+
if (r)
|
|
595
|
+
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
596
|
+
}),
|
|
597
|
+
twitterImage: h(() => t().image)
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
export {
|
|
601
|
+
Te as H,
|
|
602
|
+
Me as U,
|
|
603
|
+
Pe as V,
|
|
604
|
+
Ae as a,
|
|
605
|
+
$e as b,
|
|
606
|
+
Ve as c,
|
|
607
|
+
Ce as d,
|
|
608
|
+
ve as e,
|
|
609
|
+
Se as f,
|
|
610
|
+
le as g,
|
|
611
|
+
Ie as h,
|
|
612
|
+
je as i,
|
|
613
|
+
Ee as n,
|
|
614
|
+
be as u,
|
|
615
|
+
Oe as v,
|
|
616
|
+
we as w
|
|
617
|
+
};
|
package/dist/user.js
CHANGED