1149 lines
67 KiB
JavaScript
1149 lines
67 KiB
JavaScript
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined,
|
||
"[project]/app/billing/page.tsx [app-client] (ecmascript)", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"default",
|
||
()=>BillingPage
|
||
]);
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/jsx-dev-runtime.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$file$2d$text$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__FileText$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/file-text.mjs [app-client] (ecmascript) <export default as FileText>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$circle$2d$check$2d$big$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__CheckCircle$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/circle-check-big.mjs [app-client] (ecmascript) <export default as CheckCircle>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$clock$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Clock$3e$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/clock.mjs [app-client] (ecmascript) <export default as Clock>");
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/client/app-dir/link.js [app-client] (ecmascript)");
|
||
;
|
||
var _s = __turbopack_context__.k.signature();
|
||
// /opt/erp-system/app/billing/page.tsx
|
||
'use client';
|
||
;
|
||
;
|
||
;
|
||
function BillingPage() {
|
||
_s();
|
||
const [entries, setEntries] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useState"])([]);
|
||
const [loading, setLoading] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useState"])(true);
|
||
(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$index$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["useEffect"])({
|
||
"BillingPage.useEffect": ()=>{
|
||
fetchEntries();
|
||
}
|
||
}["BillingPage.useEffect"], []);
|
||
const fetchEntries = async ()=>{
|
||
setLoading(true);
|
||
const res = await fetch('/api/billing');
|
||
if (res.ok) setEntries(await res.json());
|
||
setLoading(false);
|
||
};
|
||
const markAsBilled = async (entryIds)=>{
|
||
if (!confirm(`Möchtest du diese ${entryIds.length} Einträge wirklich als 'Abgerechnet' markieren? Sie verschwinden danach aus dieser Liste.`)) return;
|
||
const res = await fetch('/api/billing', {
|
||
method: 'PUT',
|
||
headers: {
|
||
'Content-Type': 'application/json'
|
||
},
|
||
body: JSON.stringify({
|
||
entryIds
|
||
})
|
||
});
|
||
if (res.ok) fetchEntries();
|
||
else alert('Fehler beim Aktualisieren der Einträge.');
|
||
};
|
||
// Gruppierungs-Logik nach Kunden-ID
|
||
const groupedData = entries.reduce((acc, entry)=>{
|
||
const cid = entry.ticket.customerId;
|
||
if (!acc[cid]) {
|
||
acc[cid] = {
|
||
customer: entry.ticket.customer,
|
||
entries: [],
|
||
totalMins: 0
|
||
};
|
||
}
|
||
acc[cid].entries.push(entry);
|
||
acc[cid].totalMins += entry.durationMins;
|
||
return acc;
|
||
}, {});
|
||
const groups = Object.values(groupedData);
|
||
if (loading) return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "p-8 text-slate-500 font-medium animate-pulse",
|
||
children: "Lade Abrechnungsdaten..."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 47,
|
||
columnNumber: 23
|
||
}, this);
|
||
return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "max-w-7xl mx-auto space-y-6",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "flex items-center justify-between",
|
||
children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("h1", {
|
||
className: "text-2xl font-bold text-slate-900 flex items-center gap-2",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$file$2d$text$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__FileText$3e$__["FileText"], {
|
||
className: "w-6 h-6 text-indigo-600"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 54,
|
||
columnNumber: 13
|
||
}, this),
|
||
" Abrechnung"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 53,
|
||
columnNumber: 11
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-slate-500 mt-1",
|
||
children: "Offene, noch nicht berechnete Zeiten gebündelt nach Kunden."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 56,
|
||
columnNumber: 11
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 52,
|
||
columnNumber: 9
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 51,
|
||
columnNumber: 7
|
||
}, this),
|
||
groups.length === 0 ? /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "bg-white p-12 rounded-xl shadow-sm border border-slate-200 text-center",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$clock$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__Clock$3e$__["Clock"], {
|
||
className: "w-12 h-12 text-slate-300 mx-auto mb-3"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 62,
|
||
columnNumber: 11
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("h3", {
|
||
className: "text-lg font-medium text-slate-900",
|
||
children: "Alles erledigt"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 63,
|
||
columnNumber: 11
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-slate-500 mt-1",
|
||
children: "Es liegen aktuell keine unberechneten Zeiteinträge vor."
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 64,
|
||
columnNumber: 11
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 61,
|
||
columnNumber: 9
|
||
}, this) : /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "space-y-8",
|
||
children: groups.map((group, idx)=>{
|
||
const customerName = group.customer.companyName || `${group.customer.firstName} ${group.customer.lastName}`;
|
||
const totalHours = (group.totalMins / 60).toFixed(2);
|
||
const allEntryIds = group.entries.map((e)=>e.id);
|
||
return /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "bg-slate-50 p-6 border-b border-slate-200 flex flex-col md:flex-row md:items-center justify-between gap-4",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("h2", {
|
||
className: "text-xl font-bold text-slate-900",
|
||
children: customerName
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 77,
|
||
columnNumber: 21
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-slate-500 text-sm mt-1",
|
||
children: [
|
||
"Insgesamt ",
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("strong", {
|
||
className: "text-slate-800",
|
||
children: [
|
||
group.totalMins,
|
||
" Minuten"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 78,
|
||
columnNumber: 74
|
||
}, this),
|
||
" (",
|
||
totalHours,
|
||
" Stunden) abzurechnen."
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 78,
|
||
columnNumber: 21
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 76,
|
||
columnNumber: 19
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("div", {
|
||
className: "flex gap-3",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"], {
|
||
href: `/billing/${group.customer.id}`,
|
||
className: "bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition flex items-center gap-2 font-medium shadow-sm text-sm",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$file$2d$text$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__FileText$3e$__["FileText"], {
|
||
className: "w-4 h-4"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 85,
|
||
columnNumber: 23
|
||
}, this),
|
||
" Rechnung erstellen"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 81,
|
||
columnNumber: 21
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("button", {
|
||
onClick: ()=>markAsBilled(allEntryIds),
|
||
className: "bg-emerald-600 text-white px-4 py-2 rounded-lg hover:bg-emerald-700 transition flex items-center gap-2 font-medium shadow-sm text-sm",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$circle$2d$check$2d$big$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__$3c$export__default__as__CheckCircle$3e$__["CheckCircle"], {
|
||
className: "w-4 h-4"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 91,
|
||
columnNumber: 23
|
||
}, this),
|
||
" Als abgerechnet markieren"
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 87,
|
||
columnNumber: 21
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 80,
|
||
columnNumber: 19
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 75,
|
||
columnNumber: 17
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("table", {
|
||
className: "w-full text-left text-sm",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("thead", {
|
||
className: "text-slate-500 font-medium border-b border-slate-100",
|
||
children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("tr", {
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("th", {
|
||
className: "py-3 px-6",
|
||
children: "Datum"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 99,
|
||
columnNumber: 23
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("th", {
|
||
className: "py-3 px-6",
|
||
children: "Ticket"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 100,
|
||
columnNumber: 23
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("th", {
|
||
className: "py-3 px-6 w-1/2",
|
||
children: "Leistungsbeschreibung"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 101,
|
||
columnNumber: 23
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("th", {
|
||
className: "py-3 px-6 text-right",
|
||
children: "Dauer"
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 102,
|
||
columnNumber: 23
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 98,
|
||
columnNumber: 21
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 97,
|
||
columnNumber: 19
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("tbody", {
|
||
className: "divide-y divide-slate-50",
|
||
children: group.entries.map((entry)=>/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("tr", {
|
||
className: "hover:bg-slate-50/50",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("td", {
|
||
className: "py-3 px-6 text-slate-500",
|
||
children: new Date(entry.createdAt).toLocaleDateString('de-DE')
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 108,
|
||
columnNumber: 25
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("td", {
|
||
className: "py-3 px-6 font-medium text-indigo-600 hover:text-indigo-800",
|
||
children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$client$2f$app$2d$dir$2f$link$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"], {
|
||
href: `/tickets/${entry.ticketId}`,
|
||
children: [
|
||
"#",
|
||
entry.ticketId
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 110,
|
||
columnNumber: 27
|
||
}, this)
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 109,
|
||
columnNumber: 25
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("td", {
|
||
className: "py-3 px-6",
|
||
children: [
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-slate-900 font-medium mb-0.5",
|
||
children: entry.ticket.title
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 113,
|
||
columnNumber: 27
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("p", {
|
||
className: "text-slate-600 text-xs",
|
||
children: entry.description
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 114,
|
||
columnNumber: 27
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 112,
|
||
columnNumber: 25
|
||
}, this),
|
||
/*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f$react$2f$jsx$2d$dev$2d$runtime$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__["jsxDEV"])("td", {
|
||
className: "py-3 px-6 text-right font-semibold text-slate-800",
|
||
children: [
|
||
entry.durationMins,
|
||
" Min."
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 116,
|
||
columnNumber: 25
|
||
}, this)
|
||
]
|
||
}, entry.id, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 107,
|
||
columnNumber: 23
|
||
}, this))
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 105,
|
||
columnNumber: 19
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 96,
|
||
columnNumber: 17
|
||
}, this)
|
||
]
|
||
}, idx, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 74,
|
||
columnNumber: 15
|
||
}, this);
|
||
})
|
||
}, void 0, false, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 67,
|
||
columnNumber: 9
|
||
}, this)
|
||
]
|
||
}, void 0, true, {
|
||
fileName: "[project]/app/billing/page.tsx",
|
||
lineNumber: 50,
|
||
columnNumber: 5
|
||
}, this);
|
||
}
|
||
_s(BillingPage, "SYm0Akn46qVA7WdG5Z+f7xq5O+g=");
|
||
_c = BillingPage;
|
||
var _c;
|
||
__turbopack_context__.k.register(_c, "BillingPage");
|
||
if (typeof globalThis.$RefreshHelpers$ === 'object' && globalThis.$RefreshHelpers !== null) {
|
||
__turbopack_context__.k.registerExports(__turbopack_context__.m, globalThis.$RefreshHelpers$);
|
||
}
|
||
}),
|
||
"[project]/node_modules/lucide-react/dist/esm/icons/circle-check-big.mjs [app-client] (ecmascript)", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"__iconNode",
|
||
()=>__iconNode,
|
||
"default",
|
||
()=>CircleCheckBig
|
||
]);
|
||
/**
|
||
* @license lucide-react v1.14.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/ var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/createLucideIcon.mjs [app-client] (ecmascript)");
|
||
;
|
||
const __iconNode = [
|
||
[
|
||
"path",
|
||
{
|
||
d: "M21.801 10A10 10 0 1 1 17 3.335",
|
||
key: "yps3ct"
|
||
}
|
||
],
|
||
[
|
||
"path",
|
||
{
|
||
d: "m9 11 3 3L22 4",
|
||
key: "1pflzl"
|
||
}
|
||
]
|
||
];
|
||
const CircleCheckBig = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"])("circle-check-big", __iconNode);
|
||
;
|
||
}),
|
||
"[project]/node_modules/lucide-react/dist/esm/icons/circle-check-big.mjs [app-client] (ecmascript) <export default as CheckCircle>", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"CheckCircle",
|
||
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$circle$2d$check$2d$big$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"]
|
||
]);
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$circle$2d$check$2d$big$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/circle-check-big.mjs [app-client] (ecmascript)");
|
||
}),
|
||
"[project]/node_modules/lucide-react/dist/esm/icons/clock.mjs [app-client] (ecmascript)", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"__iconNode",
|
||
()=>__iconNode,
|
||
"default",
|
||
()=>Clock
|
||
]);
|
||
/**
|
||
* @license lucide-react v1.14.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/ var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/createLucideIcon.mjs [app-client] (ecmascript)");
|
||
;
|
||
const __iconNode = [
|
||
[
|
||
"circle",
|
||
{
|
||
cx: "12",
|
||
cy: "12",
|
||
r: "10",
|
||
key: "1mglay"
|
||
}
|
||
],
|
||
[
|
||
"path",
|
||
{
|
||
d: "M12 6v6l4 2",
|
||
key: "mmk7yg"
|
||
}
|
||
]
|
||
];
|
||
const Clock = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"])("clock", __iconNode);
|
||
;
|
||
}),
|
||
"[project]/node_modules/lucide-react/dist/esm/icons/clock.mjs [app-client] (ecmascript) <export default as Clock>", ((__turbopack_context__) => {
|
||
"use strict";
|
||
|
||
__turbopack_context__.s([
|
||
"Clock",
|
||
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$clock$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__["default"]
|
||
]);
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$clock$2e$mjs__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/lucide-react/dist/esm/icons/clock.mjs [app-client] (ecmascript)");
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
// Format function modified from nodejs
|
||
// Copyright Joyent, Inc. and other Node contributors.
|
||
//
|
||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||
// copy of this software and associated documentation files (the
|
||
// "Software"), to deal in the Software without restriction, including
|
||
// without limitation the rights to use, copy, modify, merge, publish,
|
||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
||
// persons to whom the Software is furnished to do so, subject to the
|
||
// following conditions:
|
||
//
|
||
// The above copyright notice and this permission notice shall be included
|
||
// in all copies or substantial portions of the Software.
|
||
//
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
0 && (module.exports = {
|
||
formatUrl: null,
|
||
formatWithValidation: null,
|
||
urlObjectKeys: null
|
||
});
|
||
function _export(target, all) {
|
||
for(var name in all)Object.defineProperty(target, name, {
|
||
enumerable: true,
|
||
get: all[name]
|
||
});
|
||
}
|
||
_export(exports, {
|
||
formatUrl: function() {
|
||
return formatUrl;
|
||
},
|
||
formatWithValidation: function() {
|
||
return formatWithValidation;
|
||
},
|
||
urlObjectKeys: function() {
|
||
return urlObjectKeys;
|
||
}
|
||
});
|
||
const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)");
|
||
const _querystring = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/querystring.js [app-client] (ecmascript)"));
|
||
const slashedProtocols = /https?|ftp|gopher|file/;
|
||
function formatUrl(urlObj) {
|
||
let { auth, hostname } = urlObj;
|
||
let protocol = urlObj.protocol || '';
|
||
let pathname = urlObj.pathname || '';
|
||
let hash = urlObj.hash || '';
|
||
let query = urlObj.query || '';
|
||
let host = false;
|
||
auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : '';
|
||
if (urlObj.host) {
|
||
host = auth + urlObj.host;
|
||
} else if (hostname) {
|
||
host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname);
|
||
if (urlObj.port) {
|
||
host += ':' + urlObj.port;
|
||
}
|
||
}
|
||
if (query && typeof query === 'object') {
|
||
query = String(_querystring.urlQueryToSearchParams(query));
|
||
}
|
||
let search = urlObj.search || query && `?${query}` || '';
|
||
if (protocol && !protocol.endsWith(':')) protocol += ':';
|
||
if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
|
||
host = '//' + (host || '');
|
||
if (pathname && pathname[0] !== '/') pathname = '/' + pathname;
|
||
} else if (!host) {
|
||
host = '';
|
||
}
|
||
if (hash && hash[0] !== '#') hash = '#' + hash;
|
||
if (search && search[0] !== '?') search = '?' + search;
|
||
pathname = pathname.replace(/[?#]/g, encodeURIComponent);
|
||
search = search.replace('#', '%23');
|
||
return `${protocol}${host}${pathname}${search}${hash}`;
|
||
}
|
||
const urlObjectKeys = [
|
||
'auth',
|
||
'hash',
|
||
'host',
|
||
'hostname',
|
||
'href',
|
||
'path',
|
||
'pathname',
|
||
'port',
|
||
'protocol',
|
||
'query',
|
||
'search',
|
||
'slashes'
|
||
];
|
||
function formatWithValidation(url) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (url !== null && typeof url === 'object') {
|
||
Object.keys(url).forEach((key)=>{
|
||
if (!urlObjectKeys.includes(key)) {
|
||
console.warn(`Unknown key passed via urlObject into url.format: ${key}`);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
return formatUrl(url);
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/client/use-merged-ref.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "useMergedRef", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return useMergedRef;
|
||
}
|
||
});
|
||
const _react = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)");
|
||
function useMergedRef(refA, refB) {
|
||
const cleanupA = (0, _react.useRef)(null);
|
||
const cleanupB = (0, _react.useRef)(null);
|
||
// NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
|
||
// (this happens often if the user doesn't pass a ref to Link/Form/Image)
|
||
// But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),
|
||
// and the user might pass that ref into ref-merging library that doesn't support cleanup refs
|
||
// (because it hasn't been updated for React 19)
|
||
// which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
|
||
// So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
|
||
return (0, _react.useCallback)((current)=>{
|
||
if (current === null) {
|
||
const cleanupFnA = cleanupA.current;
|
||
if (cleanupFnA) {
|
||
cleanupA.current = null;
|
||
cleanupFnA();
|
||
}
|
||
const cleanupFnB = cleanupB.current;
|
||
if (cleanupFnB) {
|
||
cleanupB.current = null;
|
||
cleanupFnB();
|
||
}
|
||
} else {
|
||
if (refA) {
|
||
cleanupA.current = applyRef(refA, current);
|
||
}
|
||
if (refB) {
|
||
cleanupB.current = applyRef(refB, current);
|
||
}
|
||
}
|
||
}, [
|
||
refA,
|
||
refB
|
||
]);
|
||
}
|
||
function applyRef(refA, current) {
|
||
if (typeof refA === 'function') {
|
||
const cleanup = refA(current);
|
||
if (typeof cleanup === 'function') {
|
||
return cleanup;
|
||
} else {
|
||
return ()=>refA(null);
|
||
}
|
||
} else {
|
||
refA.current = current;
|
||
return ()=>{
|
||
refA.current = null;
|
||
};
|
||
}
|
||
}
|
||
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
||
Object.defineProperty(exports.default, '__esModule', {
|
||
value: true
|
||
});
|
||
Object.assign(exports.default, exports);
|
||
module.exports = exports.default;
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "isLocalURL", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return isLocalURL;
|
||
}
|
||
});
|
||
const _utils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils.js [app-client] (ecmascript)");
|
||
const _hasbasepath = __turbopack_context__.r("[project]/node_modules/next/dist/client/has-base-path.js [app-client] (ecmascript)");
|
||
function isLocalURL(url) {
|
||
// prevent a hydration mismatch on href for url with anchor refs
|
||
if (!(0, _utils.isAbsoluteUrl)(url)) return true;
|
||
try {
|
||
// absolute urls can be local if they are on the same origin
|
||
const locationOrigin = (0, _utils.getLocationOrigin)();
|
||
const resolved = new URL(url, locationOrigin);
|
||
return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
|
||
} catch (_) {
|
||
return false;
|
||
}
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/shared/lib/utils/error-once.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
Object.defineProperty(exports, "errorOnce", {
|
||
enumerable: true,
|
||
get: function() {
|
||
return errorOnce;
|
||
}
|
||
});
|
||
let errorOnce = (_)=>{};
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
const errors = new Set();
|
||
errorOnce = (msg)=>{
|
||
if (!errors.has(msg)) {
|
||
console.error(msg);
|
||
}
|
||
errors.add(msg);
|
||
};
|
||
}
|
||
}),
|
||
"[project]/node_modules/next/dist/client/app-dir/link.js [app-client] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
||
"use strict";
|
||
|
||
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$build$2f$polyfills$2f$process$2e$js__$5b$app$2d$client$5d$__$28$ecmascript$29$__ = /*#__PURE__*/ __turbopack_context__.i("[project]/node_modules/next/dist/build/polyfills/process.js [app-client] (ecmascript)");
|
||
'use client';
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
0 && (module.exports = {
|
||
default: null,
|
||
useLinkStatus: null
|
||
});
|
||
function _export(target, all) {
|
||
for(var name in all)Object.defineProperty(target, name, {
|
||
enumerable: true,
|
||
get: all[name]
|
||
});
|
||
}
|
||
_export(exports, {
|
||
/**
|
||
* A React component that extends the HTML `<a>` element to provide
|
||
* [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
|
||
* and client-side navigation. This is the primary way to navigate between routes in Next.js.
|
||
*
|
||
* @remarks
|
||
* - Prefetching is only enabled in production.
|
||
*
|
||
* @see https://nextjs.org/docs/app/api-reference/components/link
|
||
*/ default: function() {
|
||
return LinkComponent;
|
||
},
|
||
useLinkStatus: function() {
|
||
return useLinkStatus;
|
||
}
|
||
});
|
||
const _interop_require_wildcard = __turbopack_context__.r("[project]/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-client] (ecmascript)");
|
||
const _jsxruntime = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/jsx-runtime.js [app-client] (ecmascript)");
|
||
const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/node_modules/next/dist/compiled/react/index.js [app-client] (ecmascript)"));
|
||
const _formaturl = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-client] (ecmascript)");
|
||
const _approutercontextsharedruntime = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js [app-client] (ecmascript)");
|
||
const _usemergedref = __turbopack_context__.r("[project]/node_modules/next/dist/client/use-merged-ref.js [app-client] (ecmascript)");
|
||
const _utils = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils.js [app-client] (ecmascript)");
|
||
const _addbasepath = __turbopack_context__.r("[project]/node_modules/next/dist/client/add-base-path.js [app-client] (ecmascript)");
|
||
const _warnonce = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/warn-once.js [app-client] (ecmascript)");
|
||
const _routerreducertypes = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js [app-client] (ecmascript)");
|
||
const _links = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/links.js [app-client] (ecmascript)");
|
||
const _islocalurl = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-client] (ecmascript)");
|
||
const _types = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/segment-cache/types.js [app-client] (ecmascript)");
|
||
const _erroronce = __turbopack_context__.r("[project]/node_modules/next/dist/shared/lib/utils/error-once.js [app-client] (ecmascript)");
|
||
function isModifiedEvent(event) {
|
||
const eventTarget = event.currentTarget;
|
||
const target = eventTarget.getAttribute('target');
|
||
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
|
||
event.nativeEvent && event.nativeEvent.which === 2;
|
||
}
|
||
function linkClicked(e, href, linkInstanceRef, replace, scroll, onNavigate, transitionTypes) {
|
||
if (typeof window !== 'undefined') {
|
||
const { nodeName } = e.currentTarget;
|
||
// anchors inside an svg have a lowercase nodeName
|
||
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
|
||
if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute('download')) {
|
||
// ignore click for browser’s default behavior
|
||
return;
|
||
}
|
||
if (!(0, _islocalurl.isLocalURL)(href)) {
|
||
if (replace) {
|
||
// browser default behavior does not replace the history state
|
||
// so we need to do it manually
|
||
e.preventDefault();
|
||
location.replace(href);
|
||
}
|
||
// ignore click for browser’s default behavior
|
||
return;
|
||
}
|
||
e.preventDefault();
|
||
if (onNavigate) {
|
||
let isDefaultPrevented = false;
|
||
onNavigate({
|
||
preventDefault: ()=>{
|
||
isDefaultPrevented = true;
|
||
}
|
||
});
|
||
if (isDefaultPrevented) {
|
||
return;
|
||
}
|
||
}
|
||
const { dispatchNavigateAction } = __turbopack_context__.r("[project]/node_modules/next/dist/client/components/app-router-instance.js [app-client] (ecmascript)");
|
||
_react.default.startTransition(()=>{
|
||
dispatchNavigateAction(href, replace ? 'replace' : 'push', scroll === false ? _routerreducertypes.ScrollBehavior.NoScroll : _routerreducertypes.ScrollBehavior.Default, linkInstanceRef.current, transitionTypes);
|
||
});
|
||
}
|
||
}
|
||
function formatStringOrUrl(urlObjOrString) {
|
||
if (typeof urlObjOrString === 'string') {
|
||
return urlObjOrString;
|
||
}
|
||
return (0, _formaturl.formatUrl)(urlObjOrString);
|
||
}
|
||
function LinkComponent(props) {
|
||
const [linkStatus, setOptimisticLinkStatus] = (0, _react.useOptimistic)(_links.IDLE_LINK_STATUS);
|
||
let children;
|
||
const linkInstanceRef = (0, _react.useRef)(null);
|
||
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, onClick, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, onNavigate, transitionTypes, ref: forwardedRef, unstable_dynamicOnHover, ...restProps } = props;
|
||
children = childrenProp;
|
||
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
|
||
children = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
||
children: children
|
||
});
|
||
}
|
||
const router = _react.default.useContext(_approutercontextsharedruntime.AppRouterContext);
|
||
const prefetchEnabled = prefetchProp !== false;
|
||
const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : _types.FetchStrategy.PPR;
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
function createPropError(args) {
|
||
return Object.defineProperty(new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (typeof window !== 'undefined' ? "\nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||
value: "E319",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
// TypeScript trick for type-guarding:
|
||
const requiredPropsGuard = {
|
||
href: true
|
||
};
|
||
const requiredProps = Object.keys(requiredPropsGuard);
|
||
requiredProps.forEach((key)=>{
|
||
if (key === 'href') {
|
||
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string` or `object`',
|
||
actual: props[key] === null ? 'null' : typeof props[key]
|
||
});
|
||
}
|
||
} else {
|
||
// TypeScript trick for type-guarding:
|
||
const _ = key;
|
||
}
|
||
});
|
||
// TypeScript trick for type-guarding:
|
||
const optionalPropsGuard = {
|
||
as: true,
|
||
replace: true,
|
||
scroll: true,
|
||
shallow: true,
|
||
passHref: true,
|
||
prefetch: true,
|
||
unstable_dynamicOnHover: true,
|
||
onClick: true,
|
||
onMouseEnter: true,
|
||
onTouchStart: true,
|
||
legacyBehavior: true,
|
||
onNavigate: true,
|
||
transitionTypes: true
|
||
};
|
||
const optionalProps = Object.keys(optionalPropsGuard);
|
||
optionalProps.forEach((key)=>{
|
||
const valType = typeof props[key];
|
||
if (key === 'as') {
|
||
if (props[key] && valType !== 'string' && valType !== 'object') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string` or `object`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart' || key === 'onNavigate') {
|
||
if (props[key] && valType !== 'function') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`function`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'legacyBehavior' || key === 'unstable_dynamicOnHover') {
|
||
if (props[key] != null && valType !== 'boolean') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`boolean`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'prefetch') {
|
||
if (props[key] != null && valType !== 'boolean' && props[key] !== 'auto') {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`boolean | "auto"`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else if (key === 'transitionTypes') {
|
||
if (props[key] != null && !Array.isArray(props[key])) {
|
||
throw createPropError({
|
||
key,
|
||
expected: '`string[]`',
|
||
actual: valType
|
||
});
|
||
}
|
||
} else {
|
||
// TypeScript trick for type-guarding:
|
||
const _ = key;
|
||
}
|
||
});
|
||
}
|
||
const resolvedHref = asProp || hrefProp;
|
||
const formattedHref = formatStringOrUrl(resolvedHref);
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (props.locale) {
|
||
(0, _warnonce.warnOnce)('The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization');
|
||
}
|
||
if (!asProp) {
|
||
let href;
|
||
if (typeof resolvedHref === 'string') {
|
||
href = resolvedHref;
|
||
} else if (typeof resolvedHref === 'object' && typeof resolvedHref.pathname === 'string') {
|
||
href = resolvedHref.pathname;
|
||
}
|
||
if (href) {
|
||
const hasDynamicSegment = href.split('/').some((segment)=>segment.startsWith('[') && segment.endsWith(']'));
|
||
if (hasDynamicSegment) {
|
||
throw Object.defineProperty(new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`), "__NEXT_ERROR_CODE", {
|
||
value: "E267",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
}
|
||
}
|
||
// This will return the first child, if multiple are provided it will throw an error
|
||
let child;
|
||
if (legacyBehavior) {
|
||
if (children?.$$typeof === Symbol.for('react.lazy')) {
|
||
throw Object.defineProperty(new Error(`\`<Link legacyBehavior>\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \`<a>\` tag.`), "__NEXT_ERROR_CODE", {
|
||
value: "E863",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (onClick) {
|
||
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
|
||
}
|
||
if (onMouseEnterProp) {
|
||
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${formattedHref}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
|
||
}
|
||
try {
|
||
child = _react.default.Children.only(children);
|
||
} catch (err) {
|
||
if (!children) {
|
||
throw Object.defineProperty(new Error(`No children were passed to <Link> with \`href\` of \`${formattedHref}\` but one child is required https://nextjs.org/docs/messages/link-no-children`), "__NEXT_ERROR_CODE", {
|
||
value: "E320",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
throw Object.defineProperty(new Error(`Multiple children were passed to <Link> with \`href\` of \`${formattedHref}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (typeof window !== 'undefined' ? " \nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
||
value: "E266",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
} else //TURBOPACK unreachable
|
||
;
|
||
} else {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (children?.type === 'a') {
|
||
throw Object.defineProperty(new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'), "__NEXT_ERROR_CODE", {
|
||
value: "E209",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
}
|
||
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
|
||
// Use a callback ref to attach an IntersectionObserver to the anchor tag on
|
||
// mount. In the future we will also use this to keep track of all the
|
||
// currently mounted <Link> instances, e.g. so we can re-prefetch them after
|
||
// a revalidation or refresh.
|
||
const observeLinkVisibilityOnMount = _react.default.useCallback({
|
||
"LinkComponent.useCallback[observeLinkVisibilityOnMount]": (element)=>{
|
||
if (router !== null) {
|
||
linkInstanceRef.current = (0, _links.mountLinkInstance)(element, formattedHref, router, fetchStrategy, prefetchEnabled, setOptimisticLinkStatus);
|
||
}
|
||
return ({
|
||
"LinkComponent.useCallback[observeLinkVisibilityOnMount]": ()=>{
|
||
if (linkInstanceRef.current) {
|
||
(0, _links.unmountLinkForCurrentNavigation)(linkInstanceRef.current);
|
||
linkInstanceRef.current = null;
|
||
}
|
||
(0, _links.unmountPrefetchableInstance)(element);
|
||
}
|
||
})["LinkComponent.useCallback[observeLinkVisibilityOnMount]"];
|
||
}
|
||
}["LinkComponent.useCallback[observeLinkVisibilityOnMount]"], [
|
||
prefetchEnabled,
|
||
formattedHref,
|
||
router,
|
||
fetchStrategy,
|
||
setOptimisticLinkStatus
|
||
]);
|
||
const mergedRef = (0, _usemergedref.useMergedRef)(observeLinkVisibilityOnMount, childRef);
|
||
const childProps = {
|
||
ref: mergedRef,
|
||
onClick (e) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
if (!e) {
|
||
throw Object.defineProperty(new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`), "__NEXT_ERROR_CODE", {
|
||
value: "E312",
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
}
|
||
}
|
||
if (!legacyBehavior && typeof onClick === 'function') {
|
||
onClick(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
|
||
child.props.onClick(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if (e.defaultPrevented) {
|
||
return;
|
||
}
|
||
linkClicked(e, formattedHref, linkInstanceRef, replace, scroll, onNavigate, transitionTypes);
|
||
},
|
||
onMouseEnter (e) {
|
||
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
|
||
onMouseEnterProp(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
|
||
child.props.onMouseEnter(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
return;
|
||
}
|
||
//TURBOPACK unreachable
|
||
;
|
||
const upgradeToDynamicPrefetch = undefined;
|
||
},
|
||
onTouchStart: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : function onTouchStart(e) {
|
||
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
|
||
onTouchStartProp(e);
|
||
}
|
||
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
|
||
child.props.onTouchStart(e);
|
||
}
|
||
if (!router) {
|
||
return;
|
||
}
|
||
if (!prefetchEnabled) {
|
||
return;
|
||
}
|
||
const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true;
|
||
(0, _links.onNavigationIntent)(e.currentTarget, upgradeToDynamicPrefetch);
|
||
}
|
||
};
|
||
// If the url is absolute, we can bypass the logic to prepend the basePath.
|
||
if ((0, _utils.isAbsoluteUrl)(formattedHref)) {
|
||
childProps.href = formattedHref;
|
||
} else if (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
|
||
childProps.href = (0, _addbasepath.addBasePath)(formattedHref);
|
||
}
|
||
let link;
|
||
if (legacyBehavior) {
|
||
if ("TURBOPACK compile-time truthy", 1) {
|
||
(0, _erroronce.errorOnce)('`legacyBehavior` is deprecated and will be removed in a future ' + 'release. A codemod is available to upgrade your components:\n\n' + 'npx @next/codemod@latest new-link .\n\n' + 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components');
|
||
}
|
||
link = /*#__PURE__*/ _react.default.cloneElement(child, childProps);
|
||
} else {
|
||
link = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
||
...restProps,
|
||
...childProps,
|
||
children: children
|
||
});
|
||
}
|
||
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkStatusContext.Provider, {
|
||
value: linkStatus,
|
||
children: link
|
||
});
|
||
}
|
||
const LinkStatusContext = /*#__PURE__*/ (0, _react.createContext)(_links.IDLE_LINK_STATUS);
|
||
const useLinkStatus = ()=>{
|
||
return (0, _react.useContext)(LinkStatusContext);
|
||
};
|
||
function getFetchStrategyFromPrefetchProp(prefetchProp) {
|
||
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
||
;
|
||
else {
|
||
return prefetchProp === null || prefetchProp === 'auto' ? _types.FetchStrategy.PPR : // (although invalid values should've been filtered out by prop validation in dev)
|
||
_types.FetchStrategy.Full;
|
||
}
|
||
}
|
||
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
||
Object.defineProperty(exports.default, '__esModule', {
|
||
value: true
|
||
});
|
||
Object.assign(exports.default, exports);
|
||
module.exports = exports.default;
|
||
}
|
||
}),
|
||
]);
|
||
|
||
//# sourceMappingURL=_0s4_wls._.js.map
|