forbidden-DMCh6qho.mjs
6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { _ as _sfc_main$1 } from './Card-DYSPsF5s.mjs';
import { _ as _sfc_main$3 } from './Badge-DxP8LLFm.mjs';
import { _ as _sfc_main$2 } from './Alert-D2pk4r51.mjs';
import { d as useRoute$1, e as useRouter, u as useAppI18n, _ as _sfc_main$9 } from './server.mjs';
import { defineComponent, computed, mergeProps, withCtx, unref, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import '@iconify/utils';
import 'consola';
import 'perfect-debounce';
import 'tailwindcss/colors';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "forbidden",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute$1();
const router = useRouter();
const { t } = useAppI18n();
const from = computed(() => {
const raw = route.query.from;
if (typeof raw !== "string" || !raw.startsWith("/")) {
return "/";
}
return raw;
});
return (_ctx, _push, _parent, _attrs) => {
const _component_UCard = _sfc_main$1;
const _component_UBadge = _sfc_main$3;
const _component_UAlert = _sfc_main$2;
const _component_UButton = _sfc_main$9;
_push(`<main${ssrRenderAttrs(mergeProps({ class: "min-h-screen bg-gradient-to-br from-default via-elevated/20 to-warning/10" }, _attrs))}><div class="mx-auto flex min-h-screen max-w-3xl items-center justify-center px-4 py-10">`);
_push(ssrRenderComponent(_component_UCard, { class: "w-full max-w-xl shadow-sm ring-1 ring-default" }, {
header: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="space-y-2"${_scopeId}>`);
_push2(ssrRenderComponent(_component_UBadge, {
color: "warning",
variant: "soft",
class: "rounded-full"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(t)("permission.forbidden.badge"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(t)("permission.forbidden.badge")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`<h1 class="text-2xl font-semibold text-highlighted"${_scopeId}>${ssrInterpolate(unref(t)("permission.forbidden.title"))}</h1><p class="text-sm text-toned"${_scopeId}>${ssrInterpolate(unref(t)("permission.forbidden.description"))}</p></div>`);
} else {
return [
createVNode("div", { class: "space-y-2" }, [
createVNode(_component_UBadge, {
color: "warning",
variant: "soft",
class: "rounded-full"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("permission.forbidden.badge")), 1)
]),
_: 1
}),
createVNode("h1", { class: "text-2xl font-semibold text-highlighted" }, toDisplayString(unref(t)("permission.forbidden.title")), 1),
createVNode("p", { class: "text-sm text-toned" }, toDisplayString(unref(t)("permission.forbidden.description")), 1)
])
];
}
}),
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div class="space-y-4"${_scopeId}>`);
_push2(ssrRenderComponent(_component_UAlert, {
color: "warning",
variant: "soft",
icon: "i-lucide-shield-alert",
title: unref(t)("permission.forbidden.fromTitle"),
description: unref(from)
}, null, _parent2, _scopeId));
_push2(`<div class="flex flex-wrap gap-2"${_scopeId}>`);
_push2(ssrRenderComponent(_component_UButton, {
color: "primary",
icon: "i-lucide-house",
label: unref(t)("permission.forbidden.backLogin"),
to: "/login"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_UButton, {
color: "neutral",
variant: "outline",
icon: "i-lucide-arrow-left",
label: unref(t)("permission.forbidden.goBack"),
onClick: ($event) => unref(router).back()
}, null, _parent2, _scopeId));
_push2(`</div></div>`);
} else {
return [
createVNode("div", { class: "space-y-4" }, [
createVNode(_component_UAlert, {
color: "warning",
variant: "soft",
icon: "i-lucide-shield-alert",
title: unref(t)("permission.forbidden.fromTitle"),
description: unref(from)
}, null, 8, ["title", "description"]),
createVNode("div", { class: "flex flex-wrap gap-2" }, [
createVNode(_component_UButton, {
color: "primary",
icon: "i-lucide-house",
label: unref(t)("permission.forbidden.backLogin"),
to: "/login"
}, null, 8, ["label"]),
createVNode(_component_UButton, {
color: "neutral",
variant: "outline",
icon: "i-lucide-arrow-left",
label: unref(t)("permission.forbidden.goBack"),
onClick: ($event) => unref(router).back()
}, null, 8, ["label", "onClick"])
])
])
];
}
}),
_: 1
}, _parent));
_push(`</div></main>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/forbidden.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };
//# sourceMappingURL=forbidden-DMCh6qho.mjs.map