/opt/canhelp/apps/web/.next/cache/webpack/server-production
NameSizeModeActions
0.pack925145390644editdlrm
1.pack12673790644editdlrm
2.pack43735990644editdlrm
3.pack7451990644editdlrm
4.pack65204660644editdlrm
5.pack259717610644editdlrm
6.pack7518430644editdlrm
7.pack46388840644editdlrm
8.pack48452960644editdlrm
9.pack97020644editdlrm
10.pack27038500644editdlrm
11.pack1361530644editdlrm
12.pack24060644editdlrm
13.pack4277340644editdlrm
14.pack6358240644editdlrm
15.pack19769150644editdlrm
16.pack85740644editdlrm
17.pack24591570644editdlrm
18.pack119171890644editdlrm
19.pack768050644editdlrm
20.pack31443360644editdlrm
21.pack60115380644editdlrm
22.pack10241010644editdlrm
index.pack77214480644editdlrm
index.pack.old84399530644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/server-production/22.pack (1024101B)
wpcYwebpack/lib/cache/PackFileCacheStrategyPackContentItems %ResolverCachePlugin|normal|default|alias=|false|dependencyType=|esm|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|import|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|fullySpecified=|true|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/specialists/page.tsxUResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/empty|client-only$=|next/dist/compiled/client-only/error|next/dist/compiled/server-only$=|next/dist/compiled/server-only/empty|next/dist/compiled/client-only$=|next/dist/compiled/client-only/error|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation.react-server|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/specialists/page.tsx#Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/specialists/page.tsx|rsc+FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/specialists/page.tsx|rscKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/specialists/page.tsx|rsc|0997d6643e94138f|webpack-runtimeCompilation/assets|chunk755MinifierWebpackPlugin|../app/specialists/page.jswebpack/lib/cache/ResolverCachePlugin`_ResolverCachePluginCacheMisscontextpathrequestqueryfragmentmoduledirectoryfileinternalfullySpecifieddescriptionFilePathdescriptionFileDatadescriptionFileRootrelativePath  /opt/canhelp/apps/web/src/app/specialists/page.tsx0/opt/canhelp/apps/web/package.jsonnameversionprivatescriptsdependenciesdevDependenciesweb0.1.0 devbuildstartlinttypechecknext dev --port 3000next buildnext startnext linttsc --noEmit @canhelp/shared@marsidev/react-turnstilebetter-authnanostoresnextreactreact-domsocket.io-clientzod*^1.5.0^1.2.7^1.2.0^15.1.6^19.0.0^4.8.1^3.24.1@types/node@types/react@types/react-domautoprefixerpostcsstailwindcsstypescript^22.10.7^19.0.6^19.0.3^10.4.20^8.5.1^3.4.17^5.7.3/opt/canhelp/apps/web./src/app/specialists/page.tsxwebpack/lib/FileSystemInfoSnapshot@ yB yB /opt/canhelp/apps/web/src/app/specialists/opt/canhelp/apps/web/src/app/opt/canhelp/apps/web/src/opt/canhelp/apps/opt/canhelp/opt/safeTimetimestamphash!eyBeyBd659fc12c42d40f9!yByBefd2df26ae5e3ca0@/opt/canhelp/apps/web/src/app/specialists/package.json/opt/canhelp/apps/web/src/app/package.json/opt/canhelp/apps/web/src/package.json issuerissuerLayercompilerrscserver @ yB`/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/package.json/opt/canhelp/apps/web/opt/canhelp/apps/package.json/opt/canhelp/apps/web/opt/canhelp/package.json/opt/canhelp/apps/web/opt/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.js/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.mjs/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.ts/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.jsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/specialists/page.tsx.wasmwebpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } exportsTypesideEffectFreenamespace  javascript/autoaliasmainFieldsconditionNames`$server-only$client-only$next/dist/compiled/server-only$next/dist/compiled/client-only$/opt/canhelp/node_modules/next/head.js/opt/canhelp/node_modules/next/image.js/opt/canhelp/node_modules/next/constants.js/opt/canhelp/node_modules/next/router.js/opt/canhelp/node_modules/next/dynamic.js/opt/canhelp/node_modules/next/script.js/opt/canhelp/node_modules/next/link.js/opt/canhelp/node_modules/next/form.js/opt/canhelp/node_modules/next/navigation.js/opt/canhelp/node_modules/next/headers.js/opt/canhelp/node_modules/next/og.js/opt/canhelp/node_modules/next/server.js/opt/canhelp/node_modules/next/document.js/opt/canhelp/node_modules/next/app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.tsqnext/dist/compiled/server-only/emptynext/dist/compiled/client-only/errornext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigation.react-servernext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/server/route-modules/app-page/vendored/rsc/reactnext/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-domnext/dist/compiled/react-dom/clientnext/dist/compiled/react-dom/server.nodenext/dist/compiled/react-dom/server.browsernext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/static.nodenext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-dom/static.edgenext/dist/compiled/react-server-dom-webpack/client.nodenext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-servernext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-staticnext/dist/client/dev/noop-turbopack-hmr/opt/canhelp/node_modules/next(mainreact-server...`cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependenciesmassetsassetsInfostrictexportsArgumenttopLevelDeclarationssnapshot webpack/lib/util/LazySet/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js webpack/DefinePlugin_hashwebpack/DefinePlugin process.env.NEXT_PUBLIC_API_URL4028310f"https://api.canhelp.gr"bae806072a871d8atypeactionIdsclientRefsclientEntryTypeisClientReft  __webpack_exports__*default*SpecialistsPage yB  V`webpack/lib/dependencies/HarmonyCompatibilityDependency dwebpack/lib/dependencies/ConstDependency`? `?a@] ``^@ `'A `HA `5A8 `3A9o `6Ap `QA `QAG `3webpack/lib/dependencies/HarmonyExportHeaderDependency AWTC AHTC a @ A c00 A " cK `?webpack/lib/dependencies/HarmonyImportSideEffectDependencyreact/jsx-runtime `?next/link `next/headers `'@/lib/api `H@/lib/translations `5@/lib/formatName `3@/lib/formatLastSeen `6@/components/FavoriteSpecialistButton `Q @/components/SpecialistsFiltersClient `Q @/components/PlanBadge `3webpack/lib/dependencies/HarmonyExportSpecifierDependency`ʇdefault a @webpack/lib/dependencies/HarmonyImportSpecifierDependencya cookies A    c% getTranslations AXg   c getSpecialists A   c  getCategories A   c% % getLocations A   c& & jsx_jsx A    cKK jsxs_jsxs A     cM M%  A~    cPP"  A    cR,R1  A   cU*U.  A   cY*Y. SpecialistsFiltersClient A 4  cY/YG  A   cdd#  A   cgmgq  A   ci4i9  A   crArE  AKO   ct4t8  A   cx+x/ formatShortName A   c{4{C  A   c}5}:  A!   @`6@`: Link A"& 4 @`;@`?  Aos   @`6@`: FavoriteSpecialistButton At 4 @`;@`S  A9>  yy @`6@`;  A  uu @`>@`B  AW[  qq @`Y@`]  A    mm @`>@`C  A   ii @`F@`J  AB"G"  ee @`F@`K  A##  {aa @`{@` PlanBadge A## 4v nn C  Af%j%  rXX C Ak%t% 4o gg C  AU'Z'  kQQ C  A((  gMM @`V@`Z  A ++  cII @`]@`b xy A+,/,  _EE @`V@`Z tu A--  [AA @`V@`Z vw A//  W== @`r@`w lm A_1c1  S99 @`V@`Z no A33  O55 @`m@`r de A 5 5  K11 @`V@`Z fg Ak8p8  G-- @`]@`b \] Ai9m9  C)) @`a@`e ^_ A::  ?%% @`W@`\ TU A==  ;!! @`6@`: PQ A[>_>  7 @`I@`M formatLastSeen A>?  2$$ @`6@`D GH A@ @  . @`8@`< CD AA A  * @`E@`I A AA 4' @`J@`N webpack/lib/ModuleGraphRestoreProvidedData  providedcanMangleProvideterminalBindingexportsInfo  sourcesdataruntimeRequirementsjavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Kwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } C buffersourcesizemapshash/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined! ;// ./src/lib/formatLastSeen.ts  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Pfunction formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_SV69 Z]$' O R ! $  C __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); }  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined339342__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined510513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined907910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10781081__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12601266undefined15471551__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17751778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18821885__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20842087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22962299__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24462450__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26392642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27722775__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29772980__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31053108__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33343338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34773480__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37373740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_^P$- W  5   x{A(0,react_jsx_runtime.jsx)(0,react_jsx_runtime.jsxs)$ ;// ./src/app/specialists/page.tsx  cKwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } eA>@\^_79npFHVXf ! _  ~ KN "_%ort9=WZ  B"F"####f%i%k%s%U'Y'(( +++,\.,--//_1b133 5 5k8o8i9l9::==[>^>>>@ @A A AA__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._"https://api.canhelp.gr"0__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._O async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await __WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = __WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ __WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), __WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-3", children: __WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); }  WCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } 062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined12561286"https://api.canhelp.gr"undefined129113130undefined14861499__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17351747__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17781789__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined32313234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33273331__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34543457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35653569__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37573760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39833986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39884011__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined45534557__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined47504753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48634867__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53115314__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54515454__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56565659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined58695883__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined61436147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined64296432__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64346437__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined67676770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67726795__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined72257229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined74457448__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined77677770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82048208__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined84348437__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined87708774__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined90889091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90939101__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined95749577__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95799587__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1006910073__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1046010463__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102011024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1130711310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1168811691__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1227112275__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1263912642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1321313217__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1357713580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1444314447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1469714700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1508315087__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1563915642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1596315966__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1611416127__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1639016393__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1664816651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1665316656__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined`4_WdP)  r 9 ;A jlEP _+/{.x3 -!"O"##%%&'O(()*!*r*_K,,,,./003\3w44;6689::=R=>?cBBCCrEEG0HqIIGOJJKLLIMKMM(0,headers/* cookies */.UL)(0,translations/* getTranslations */.$)(0,api/* getSpecialists */.F7)(0,api/* getCategories */.bW)(0,api/* getLocations */.Vs)SpecialistsFiltersClient.SpecialistsFiltersClientformatShortName(link_default())FavoriteSpecialistButton.FavoriteSpecialistButtonPlanBadgeformatLastSeenbuffersourcesizemaps)v_// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ;// ./src/lib/formatLastSeen.ts function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } ;// ./src/app/specialists/page.tsx async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await (0,headers/* cookies */.UL)(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = (0,translations/* getTranslations */.$)(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ (0,api/* getSpecialists */.F7)({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(SpecialistsFiltersClient.SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(FavoriteSpecialistButton.FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap `ConcatSourceRawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourceReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined RawSource! ;// ./src/lib/formatLastSeen.ts Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined339342__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined510513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined907910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10781081__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12601266undefined15471551__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17751778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18821885__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20842087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22962299__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24462450__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26392642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27722775__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29772980__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31053108__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33343338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34773480__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37373740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined276350(0,react_jsx_runtime.jsx)undefined518592(0,react_jsx_runtime.jsx)undefined9861060(0,react_jsx_runtime.jsx)undefined12281302(0,react_jsx_runtime.jsx)undefined17611837(0,react_jsx_runtime.jsxs)undefined20612135(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined25122586(0,react_jsx_runtime.jsx)undefined27952869(0,react_jsx_runtime.jsx)undefined30163092(0,react_jsx_runtime.jsxs)undefined32813355(0,react_jsx_runtime.jsx)undefined34853559(0,react_jsx_runtime.jsx)undefined37613835(0,react_jsx_runtime.jsx)undefined39604034(0,react_jsx_runtime.jsx)undefined42604336(0,react_jsx_runtime.jsxs)undefined44754549(0,react_jsx_runtime.jsx)undefined48064880(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx E062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined12561286"https://api.canhelp.gr"undefined129113130undefined14861499__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17351747__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17781789__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined32313234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33273331__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34543457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35653569__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37573760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39833986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39884011__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined45534557__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined47504753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48634867__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53115314__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54515454__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56565659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined58695883__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined61436147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined64296432__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64346437__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined67676770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67726795__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined72257229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined74457448__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined77677770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82048208__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined84348437__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined87708774__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined90889091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90939101__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined95749577__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95799587__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1006910073__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1046010463__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102011024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1130711310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1168811691__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1227112275__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1263912642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1321313217__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1357713580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1444314447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1469714700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1508315087__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1563915642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1596315966__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1611416127__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1639016393__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1664816651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1665316656__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10281124(0,api/* getSpecialists */.F7)undefined13601454(0,api/* getCategories */.bW)undefined14851577(0,api/* getLocations */.Vs)undefined30193093(0,react_jsx_runtime.jsx)undefined31863262(0,react_jsx_runtime.jsxs)undefined33853459(0,react_jsx_runtime.jsx)undefined35673643(0,react_jsx_runtime.jsxs)undefined38313905(0,react_jsx_runtime.jsx)undefined41284202(0,react_jsx_runtime.jsx)undefined42044315SpecialistsFiltersClient.SpecialistsFiltersClientundefined48574933(0,react_jsx_runtime.jsxs)undefined51265200(0,react_jsx_runtime.jsx)undefined53105386(0,react_jsx_runtime.jsxs)undefined58305904(0,react_jsx_runtime.jsx)undefined60416115(0,react_jsx_runtime.jsx)undefined63176391(0,react_jsx_runtime.jsx)undefined66016699formatShortNameundefined69597035(0,react_jsx_runtime.jsxs)undefined73177391(0,react_jsx_runtime.jsx)undefined73937470(link_default())undefined78007874(0,react_jsx_runtime.jsx)undefined78767987FavoriteSpecialistButton.FavoriteSpecialistButtonundefined84178493(0,react_jsx_runtime.jsxs)undefined87098783(0,react_jsx_runtime.jsx)undefined91029176(0,react_jsx_runtime.jsx)undefined96109686(0,react_jsx_runtime.jsxs)undefined99129986(0,react_jsx_runtime.jsx)undefined1031910395(0,react_jsx_runtime.jsxs)undefined1070910783(0,react_jsx_runtime.jsx)undefined1078510866PlanBadgeundefined1133911413(0,react_jsx_runtime.jsx)undefined1141511496PlanBadgeundefined1197812054(0,react_jsx_runtime.jsxs)undefined1244112515(0,react_jsx_runtime.jsx)undefined1307213148(0,react_jsx_runtime.jsxs)undefined1343113505(0,react_jsx_runtime.jsx)undefined1388313957(0,react_jsx_runtime.jsx)undefined1453714613(0,react_jsx_runtime.jsxs)undefined1497715051(0,react_jsx_runtime.jsx)undefined1562215698(0,react_jsx_runtime.jsxs)undefined1605816132(0,react_jsx_runtime.jsx)undefined1699517071(0,react_jsx_runtime.jsxs)undefined1732117395(0,react_jsx_runtime.jsx)undefined1777817854(0,react_jsx_runtime.jsxs)undefined1840618480(0,react_jsx_runtime.jsx)undefined1880118875(0,react_jsx_runtime.jsx)undefined1902319119formatLastSeenundefined1938219456(0,react_jsx_runtime.jsx)undefined1971119785(0,react_jsx_runtime.jsx)undefined1978719864(link_default())undefined `react_jsx_runtimereact_jsx_runtime_namespaceObjectreact_jsx_runtime_defaultapp_dir_linklink_namespaceObjectlink_defaultheadersapitranslationsshortName:formatName_namespaceObjectformatLastSeen_namespaceObjectNtierConfignStarIconVerifiedIconPlanBadge_namespaceObjectpage_namespaceObject __webpack_require__.d__webpack_require__.r__webpack_require____webpack_require__.n  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`Cwebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceb(() => { var exports = {}; exports.id = 755; exports.ids = [755]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 17320:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); D+0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))buffersourcesizemapshash0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined, /***/ 19121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ })  Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("stream");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ })  #module.exports = require("stream");, /***/ 28354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 29021:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; module.exports = require("fs");  /***/ }) M/***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ })  module.exports = require("fs");, /***/ 29294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 30284:  "webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcej/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } c N}R%{!$(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(); const [isFavorite, setIsFavorite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialFavorite); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(specialistId); setIsFavorite(false); } else { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSourcej/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ })  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(); const [isFavorite, setIsFavorite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialFavorite); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(specialistId); setIsFavorite(false); } else { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } /***/ })   _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; j/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 30472:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); D+0Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))buffersourcesizemapshash/Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); P0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23)); /***/ })  P0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined, /***/ 33873:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");, /***/ 34631:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tls");  /***/ }) |N/***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }) }  module.exports = require("tls");, /***/ 41025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) s/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }) tw xyzamodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");y{, /***/ 50815:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash-/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const SpecialistsFiltersClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) j/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const SpecialistsFiltersClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); /***/ }) kn  oo/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); L// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefinednp, /***/ 55511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) _Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) `c def#module.exports = require("crypto");eg, /***/ 55591:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; "module.exports = require("https");  /***/ }) VP/***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }) WZ [\]"module.exports = require("https");\^, /***/ 57650:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); `=D(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)buffersourcesizemapshash-/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const FavoriteSpecialistButton = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined /***/ }) M/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const FavoriteSpecialistButton = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); /***/ }) NQ  RR/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); qL// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );RT, /***/ 60928:  1webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Kwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } C buffersourcesizemapshash/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined! ;// ./src/lib/formatLastSeen.ts  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } Pfunction formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_SV69 Z]$' O R ! $  C __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); }  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined339342__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined510513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined907910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10781081__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12601266undefined15471551__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17751778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18821885__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20842087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22962299__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24462450__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26392642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27722775__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29772980__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31053108__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33343338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34773480__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37373740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_^P$- W  5   x{A(0,react_jsx_runtime.jsx)(0,react_jsx_runtime.jsxs)$ ;// ./src/app/specialists/page.tsx  cKwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } eA>@\^_79npFHVXf ! _  ~ KN "_%ort9=WZ  B"F"####f%i%k%s%U'Y'(( +++,\.,--//_1b133 5 5k8o8i9l9::==[>^>>>@ @A A AA__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._"https://api.canhelp.gr"0__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._O async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await __WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = __WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ __WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), __WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-3", children: __WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); }  WCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } 062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined12561286"https://api.canhelp.gr"undefined129113130undefined14861499__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17351747__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17781789__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined32313234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33273331__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34543457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35653569__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37573760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39833986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39884011__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined45534557__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined47504753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48634867__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53115314__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54515454__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56565659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined58695883__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined61436147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined64296432__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64346437__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined67676770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67726795__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined72257229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined74457448__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined77677770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82048208__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined84348437__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined87708774__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined90889091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90939101__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined95749577__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95799587__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1006910073__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1046010463__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102011024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1130711310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1168811691__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1227112275__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1263912642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1321313217__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1357713580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1444314447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1469714700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1508315087__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1563915642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1596315966__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1611416127__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1639016393__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1664816651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1665316656__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined`4_WdP)  r 9 ;A jlEP _+/{.x3 -!"O"##%%&'O(()*!*r*_K,,,,./003\3w44;6689::=R=>?cBBCCrEEG0HqIIGOJJKLLIMKMM(0,headers/* cookies */.UL)(0,translations/* getTranslations */.$)(0,api/* getSpecialists */.F7)(0,api/* getCategories */.bW)(0,api/* getLocations */.Vs)SpecialistsFiltersClient.SpecialistsFiltersClientformatShortName(link_default())FavoriteSpecialistButton.FavoriteSpecialistButtonPlanBadgeformatLastSeenbuffersourcesizemapshashv_// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ;// ./src/lib/formatLastSeen.ts function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } ;// ./src/app/specialists/page.tsx async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await (0,headers/* cookies */.UL)(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = (0,translations/* getTranslations */.$)(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ (0,api/* getSpecialists */.F7)({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(SpecialistsFiltersClient.SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(FavoriteSpecialistButton.FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap `ConcatSourceRawSource=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourceReplaceSourceRawSource$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefined RawSource! ;// ./src/lib/formatLastSeen.ts Wexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined339342__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined510513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined907910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10781081__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12601266undefined15471551__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17751778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18821885__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20842087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22962299__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24462450__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26392642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27722775__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29772980__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31053108__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33343338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34773480__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37373740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined276350(0,react_jsx_runtime.jsx)undefined518592(0,react_jsx_runtime.jsx)undefined9861060(0,react_jsx_runtime.jsx)undefined12281302(0,react_jsx_runtime.jsx)undefined17611837(0,react_jsx_runtime.jsxs)undefined20612135(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined25122586(0,react_jsx_runtime.jsx)undefined27952869(0,react_jsx_runtime.jsx)undefined30163092(0,react_jsx_runtime.jsxs)undefined32813355(0,react_jsx_runtime.jsx)undefined34853559(0,react_jsx_runtime.jsx)undefined37613835(0,react_jsx_runtime.jsx)undefined39604034(0,react_jsx_runtime.jsx)undefined42604336(0,react_jsx_runtime.jsxs)undefined44754549(0,react_jsx_runtime.jsx)undefined48064880(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx WCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } 062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined12561286"https://api.canhelp.gr"undefined129113130undefined14861499__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17351747__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17781789__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined32313234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33273331__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34543457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35653569__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37573760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39833986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39884011__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined45534557__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined47504753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48634867__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53115314__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54515454__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56565659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined58695883__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined61436147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined64296432__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64346437__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined67676770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67726795__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined72257229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined74457448__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined77677770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82048208__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined84348437__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined87708774__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined90889091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90939101__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined95749577__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95799587__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1006910073__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1046010463__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102011024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1130711310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1168811691__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1227112275__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1263912642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1321313217__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1357713580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1444314447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1469714700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1508315087__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1563915642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1596315966__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1611416127__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1639016393__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1664816651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1665316656__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10281124(0,api/* getSpecialists */.F7)undefined13601454(0,api/* getCategories */.bW)undefined14851577(0,api/* getLocations */.Vs)undefined30193093(0,react_jsx_runtime.jsx)undefined31863262(0,react_jsx_runtime.jsxs)undefined33853459(0,react_jsx_runtime.jsx)undefined35673643(0,react_jsx_runtime.jsxs)undefined38313905(0,react_jsx_runtime.jsx)undefined41284202(0,react_jsx_runtime.jsx)undefined42044315SpecialistsFiltersClient.SpecialistsFiltersClientundefined48574933(0,react_jsx_runtime.jsxs)undefined51265200(0,react_jsx_runtime.jsx)undefined53105386(0,react_jsx_runtime.jsxs)undefined58305904(0,react_jsx_runtime.jsx)undefined60416115(0,react_jsx_runtime.jsx)undefined63176391(0,react_jsx_runtime.jsx)undefined66016699formatShortNameundefined69597035(0,react_jsx_runtime.jsxs)undefined73177391(0,react_jsx_runtime.jsx)undefined73937470(link_default())undefined78007874(0,react_jsx_runtime.jsx)undefined78767987FavoriteSpecialistButton.FavoriteSpecialistButtonundefined84178493(0,react_jsx_runtime.jsxs)undefined87098783(0,react_jsx_runtime.jsx)undefined91029176(0,react_jsx_runtime.jsx)undefined96109686(0,react_jsx_runtime.jsxs)undefined99129986(0,react_jsx_runtime.jsx)undefined1031910395(0,react_jsx_runtime.jsxs)undefined1070910783(0,react_jsx_runtime.jsx)undefined1078510866PlanBadgeundefined1133911413(0,react_jsx_runtime.jsx)undefined1141511496PlanBadgeundefined1197812054(0,react_jsx_runtime.jsxs)undefined1244112515(0,react_jsx_runtime.jsx)undefined1307213148(0,react_jsx_runtime.jsxs)undefined1343113505(0,react_jsx_runtime.jsx)undefined1388313957(0,react_jsx_runtime.jsx)undefined1453714613(0,react_jsx_runtime.jsxs)undefined1497715051(0,react_jsx_runtime.jsx)undefined1562215698(0,react_jsx_runtime.jsxs)undefined1605816132(0,react_jsx_runtime.jsx)undefined1699517071(0,react_jsx_runtime.jsxs)undefined1732117395(0,react_jsx_runtime.jsx)undefined1777817854(0,react_jsx_runtime.jsxs)undefined1840618480(0,react_jsx_runtime.jsx)undefined1880118875(0,react_jsx_runtime.jsx)undefined1902319119formatLastSeenundefined1938219456(0,react_jsx_runtime.jsx)undefined1971119785(0,react_jsx_runtime.jsx)undefined1978719864(link_default())undefined /***/ }) C_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ;// ./src/lib/formatLastSeen.ts function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } ;// ./src/app/specialists/page.tsx async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await (0,headers/* cookies */.UL)(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = (0,translations/* getTranslations */.$)(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ (0,api/* getSpecialists */.F7)({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(SpecialistsFiltersClient.SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(FavoriteSpecialistButton.FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } /***/ }) DG `HH=// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts  ReplaceSourcef$/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } 136142undefined523529undefinedF! ;// ./src/lib/formatLastSeen.ts cWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefinedC // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx `import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } 9062undefined339342__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined510513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined907910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10781081__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined12601266undefined15471551__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17751778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined18821885__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20842087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22962299__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24462450__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26392642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27722775__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined29772980__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31053108__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33343338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34773480__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined37373740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined276350(0,react_jsx_runtime.jsx)undefined518592(0,react_jsx_runtime.jsx)undefined9861060(0,react_jsx_runtime.jsx)undefined12281302(0,react_jsx_runtime.jsx)undefined17611837(0,react_jsx_runtime.jsxs)undefined20612135(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined25122586(0,react_jsx_runtime.jsx)undefined27952869(0,react_jsx_runtime.jsx)undefined30163092(0,react_jsx_runtime.jsxs)undefined32813355(0,react_jsx_runtime.jsx)undefined34853559(0,react_jsx_runtime.jsx)undefined37613835(0,react_jsx_runtime.jsx)undefined39604034(0,react_jsx_runtime.jsx)undefined42604336(0,react_jsx_runtime.jsxs)undefined44754549(0,react_jsx_runtime.jsx)undefined48064880(0,react_jsx_runtime.jsx)undefinedRawSource$ ;// ./src/app/specialists/page.tsx \WCimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; import { cookies } from 'next/headers'; import { getSpecialists, getCategories, getLocations } from '@/lib/api'; import { getTranslations } from '@/lib/translations'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { FavoriteSpecialistButton } from '@/components/FavoriteSpecialistButton'; import { SpecialistsFiltersClient } from '@/components/SpecialistsFiltersClient'; import { PlanBadge } from '@/components/PlanBadge'; export default async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await cookies(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = getTranslations(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ getSpecialists({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ _jsx("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ _jsx("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ _jsx(SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ _jsxs("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ _jsx(Link, { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ _jsx(FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ _jsx("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ _jsx("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ _jsx(Link, { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } 062undefined6492undefined94132undefined134205undefined207259undefined261311undefined313366undefined368448undefined450530undefined532582undefined584598undefined762768__WEBPACK_MODULE_REFERENCE__2_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined856870__WEBPACK_MODULE_REFERENCE__4_5b226765745472616e736c6174696f6e73225d_call_directImport_asiSafe1__._undefined12561286"https://api.canhelp.gr"undefined129113130undefined14861499__WEBPACK_MODULE_REFERENCE__3_5b226765745370656369616c69737473225d_call_directImport_asiSafe1__._undefined17351747__WEBPACK_MODULE_REFERENCE__3_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined17781789__WEBPACK_MODULE_REFERENCE__3_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined32313234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined33273331__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined34543457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35653569__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37573760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39833986__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined39884011__WEBPACK_MODULE_REFERENCE__8_5b225370656369616c6973747346696c74657273436c69656e74225d_directImport_asiSafe1__._undefined45534557__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined47504753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48634867__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53115314__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54515454__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56565659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined58695883__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined61436147__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined64296432__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64346437__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined67676770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67726795__WEBPACK_MODULE_REFERENCE__7_5b224661766f726974655370656369616c697374427574746f6e225d_directImport_asiSafe1__._undefined72257229__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined74457448__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined77677770__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82048208__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined84348437__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined87708774__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined90889091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90939101__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined95749577__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95799587__WEBPACK_MODULE_REFERENCE__9_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1006910073__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1046010463__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102011024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1130711310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1168811691__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1227112275__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1263912642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1321313217__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1357713580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1444314447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1469714700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1508315087__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1563915642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1596315966__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1611416127__WEBPACK_MODULE_REFERENCE__6_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined1639016393__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1664816651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1665316656__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined173255(0,headers/* cookies */.UL)undefined343441(0,translations/* getTranslations */.$)undefined10281124(0,api/* getSpecialists */.F7)undefined13601454(0,api/* getCategories */.bW)undefined14851577(0,api/* getLocations */.Vs)undefined30193093(0,react_jsx_runtime.jsx)undefined31863262(0,react_jsx_runtime.jsxs)undefined33853459(0,react_jsx_runtime.jsx)undefined35673643(0,react_jsx_runtime.jsxs)undefined38313905(0,react_jsx_runtime.jsx)undefined41284202(0,react_jsx_runtime.jsx)undefined42044315SpecialistsFiltersClient.SpecialistsFiltersClientundefined48574933(0,react_jsx_runtime.jsxs)undefined51265200(0,react_jsx_runtime.jsx)undefined53105386(0,react_jsx_runtime.jsxs)undefined58305904(0,react_jsx_runtime.jsx)undefined60416115(0,react_jsx_runtime.jsx)undefined63176391(0,react_jsx_runtime.jsx)undefined66016699formatShortNameundefined69597035(0,react_jsx_runtime.jsxs)undefined73177391(0,react_jsx_runtime.jsx)undefined73937470(link_default())undefined78007874(0,react_jsx_runtime.jsx)undefined78767987FavoriteSpecialistButton.FavoriteSpecialistButtonundefined84178493(0,react_jsx_runtime.jsxs)undefined87098783(0,react_jsx_runtime.jsx)undefined91029176(0,react_jsx_runtime.jsx)undefined96109686(0,react_jsx_runtime.jsxs)undefined99129986(0,react_jsx_runtime.jsx)undefined1031910395(0,react_jsx_runtime.jsxs)undefined1070910783(0,react_jsx_runtime.jsx)undefined1078510866PlanBadgeundefined1133911413(0,react_jsx_runtime.jsx)undefined1141511496PlanBadgeundefined1197812054(0,react_jsx_runtime.jsxs)undefined1244112515(0,react_jsx_runtime.jsx)undefined1307213148(0,react_jsx_runtime.jsxs)undefined1343113505(0,react_jsx_runtime.jsx)undefined1388313957(0,react_jsx_runtime.jsx)undefined1453714613(0,react_jsx_runtime.jsxs)undefined1497715051(0,react_jsx_runtime.jsx)undefined1562215698(0,react_jsx_runtime.jsxs)undefined1605816132(0,react_jsx_runtime.jsx)undefined1699517071(0,react_jsx_runtime.jsxs)undefined1732117395(0,react_jsx_runtime.jsx)undefined1777817854(0,react_jsx_runtime.jsxs)undefined1840618480(0,react_jsx_runtime.jsx)undefined1880118875(0,react_jsx_runtime.jsx)undefined1902319119formatLastSeenundefined1938219456(0,react_jsx_runtime.jsx)undefined1971119785(0,react_jsx_runtime.jsx)undefined1978719864(link_default())undefined;=, /***/ 63033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) ,/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }) -0 123\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");24, /***/ 74075:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("zlib");  /***/ }) #O/***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }) $' ()*!module.exports = require("zlib");)+, /***/ 79428:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("buffer");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ })   !#module.exports = require("buffer"); ", /***/ 79551:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("url");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("url"); /***/ })   module.exports = require("url");, /***/ 79646:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; *module.exports = require("child_process");  /***/ }) X/***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ })     *module.exports = require("child_process");, /***/ 81045:  s webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @bb{_:S. ^`JL@B_  []   P R B D " _,.Dcub ,12Ms_;HFU 1 !#"("6".+;+,_,334%4X4W455i6}67 778E8m8|8`999; >>UBbByCCUFyF}FFF_GJJRRSSzYYf^w^____ `+`aa-b8bbbddddggujjp_ppprrrsRuZu!{/{w1>es "ĒTc3_>ER ʢۢ>MQ`0;\r?)8zP Plz%Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(33873).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceconst module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map E&2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined40664288Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined44924514undefined45164652undefined46544676undefined47074725__webpack_require__undefined47834789undefined48905016undefined50185103undefined51055218undefined52815287undefined53125329next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined53655373next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined56415676".next"undefined568156820undefined57095747 falseundefined57595765undefined60516071falseundefined60746138{}undefined62846323falseundefined63556368(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined64596472(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined72387253(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined76407649(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined76857700(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined78457858(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79047930next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined81098122(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined81688177next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined82178241(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined84218440(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined86328739 falseundefined874487580undefined1105411067(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1145211479(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1326413281(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1334113349next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1340013399: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1376813797(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1392913949(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1408314091(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1439114405next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1444514460next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1468814725falseundefined1472815303{}undefined1588115894next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1698116994(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1727317286(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1800518041 trueundefined1804518064(__webpack_require__(33873).join)undefined18143181940undefined1915519168(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2100921022(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2144621467next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2290622920next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2416624183(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2447224483next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2449824502(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2460824619next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2505325064next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2513325144next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2523325244next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2583325847next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2649926507next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2725327274(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2880228816next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2885528866next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2936829381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2943829459(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3003430042next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3152131535next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3288732910next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3537735390next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3568535699next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3658236605next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3687736898next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3701637037next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3726737282(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3751037521next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3755037572next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3822838243(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3845138462next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3872538738(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3918639199(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4006940090next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4096940990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4110041121next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167441691next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4189541918next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4281442829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4385743872(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4408044091next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4412444146next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4486344975falseundefined4497845328{}undefined4535345368(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4631246323next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4645846473(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4708447111falseundefined4711447184{}undefined4849248506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4943049445(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5032050333next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5043250439next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5069550709next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5092150939(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map /***/ })   e#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); #const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map E&2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined40664288Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined44924514undefined45164652undefined46544676undefined47074725__webpack_require__undefined47834789undefined48905016undefined50185103undefined51055218undefined52815287undefined53125329next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined53655373next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined56415676".next"undefined568156820undefined57095747 falseundefined57595765undefined60516071falseundefined60746138{}undefined62846323falseundefined63556368(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined64596472(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined72387253(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined76407649(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined76857700(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined78457858(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79047930next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined81098122(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined81688177next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined82178241(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined84218440(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined86328739 falseundefined874487580undefined1105411067(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1145211479(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1326413281(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1334113349next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1340013399: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1376813797(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1392913949(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1408314091(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1439114405next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1444514460next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1468814725falseundefined1472815303{}undefined1588115894next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1698116994(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1727317286(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1800518041 trueundefined1804518064(__webpack_require__(33873).join)undefined18143181940undefined1915519168(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2100921022(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2144621467next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2290622920next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2416624183(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2447224483next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2449824502(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2460824619next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2505325064next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2513325144next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2523325244next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2583325847next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2649926507next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2725327274(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2880228816next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2885528866next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2936829381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2943829459(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3003430042next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3152131535next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3288732910next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3537735390next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3568535699next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3658236605next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3687736898next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3701637037next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3726737282(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3751037521next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3755037572next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3822838243(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3845138462next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3872538738(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3918639199(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4006940090next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4096940990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4110041121next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167441691next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4189541918next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4281442829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4385743872(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4408044091next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4412444146next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4486344975falseundefined4497845328{}undefined4535345368(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4631246323next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4645846473(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4708447111falseundefined4711447184{}undefined4849248506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4943049445(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5032050333next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5043250439next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5069550709next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5092150939(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 81630:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("http");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("http"); /***/ })  !module.exports = require("http");, /***/ 83997:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("tty");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ })   module.exports = require("tty");, /***/ 84237:  Ewebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource )webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } a!N_  OQDK GJ _OSdgiz KNil@(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .VbuffersourcesizemapshashM)/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); /* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); ReplaceSourceRawSource!/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13481355(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14331440(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15201527(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34753479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36013604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36553658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40314035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41084111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43084311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43134330_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined46874691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47644767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49644967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694986_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53285332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54055408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58615865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60726075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64756478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67616764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73077310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78407843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81128115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) )/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); /* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } /***/ })   H]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); !/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13481355(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14331440(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15201527(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34753479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36013604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36553658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40314035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41084111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43084311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43134330_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined46874691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47644767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49644967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694986_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53285332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54055408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58615865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60726075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64756478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67616764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73077310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78407843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81128115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 86439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict";  module.exports = require("net");  /***/ }) N/***/ ((module) => { "use strict"; module.exports = require("net"); /***/ })   module.exports = require("net");, /***/ 94735:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("events");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("events"); /***/ })  #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,727,892,902,112,22], () => (__webpack_exec__(81045))); ,module.exports = __webpack_exports__; })(); (() => { var exports = {}; exports.id = 755; exports.ids = [755]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ }), /***/ 10846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 17320: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23)); /***/ }), /***/ 19121: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ }), /***/ 26713: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ }), /***/ 27910: /***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ }), /***/ 28354: /***/ ((module) => { "use strict"; module.exports = require("util"); /***/ }), /***/ 29021: /***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ }), /***/ 29294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }), /***/ 30284: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)(); const [isFavorite, setIsFavorite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialFavorite); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)(specialistId); setIsFavorite(false); } else { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); } /***/ }), /***/ 30472: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23)); /***/ }), /***/ 33873: /***/ ((module) => { "use strict"; module.exports = require("path"); /***/ }), /***/ 34631: /***/ ((module) => { "use strict"; module.exports = require("tls"); /***/ }), /***/ 41025: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }), /***/ 50815: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const SpecialistsFiltersClient = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", ); /***/ }), /***/ 55511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 55591: /***/ ((module) => { "use strict"; module.exports = require("https"); /***/ }), /***/ 57650: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. const FavoriteSpecialistButton = (0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", ); /***/ }), /***/ 60928: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ SpecialistsPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5939); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(3498); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/headers.js var headers = __webpack_require__(56057); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(59902); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(75112); ;// ./src/lib/formatName.ts /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!fullName?.trim()) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return `${parts[0]} ${parts[1][0].toUpperCase()}.`; } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName?.trim()) { const l = lastName?.trim(); return l ? `${firstName.trim()} ${l[0].toUpperCase()}.` : firstName.trim(); } return shortName(fallbackName); } ;// ./src/lib/formatLastSeen.ts function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } // EXTERNAL MODULE: ./src/components/FavoriteSpecialistButton.tsx var FavoriteSpecialistButton = __webpack_require__(57650); // EXTERNAL MODULE: ./src/components/SpecialistsFiltersClient.tsx var SpecialistsFiltersClient = __webpack_require__(50815); ;// ./src/components/PlanBadge.tsx const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-blue-100 text-blue-700 border border-blue-200', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge({ tier, verified, size = 'sm', className = '' }) { if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center gap-1 rounded-full font-semibold ${sizeClass} ${tierConfig[tier].class} ${className}`, children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: `inline-flex items-center gap-0.5 rounded-full font-semibold ${sizeClass} bg-blue-100 text-blue-700 border border-blue-200 ${className}`, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: `inline-flex items-center rounded-full font-semibold ${sizeClass} ${cfg.class} ${className}`, children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon({ className = '' }) { return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } ;// ./src/app/specialists/page.tsx async function SpecialistsPage({ searchParams }) { const params = await searchParams; const page = Number(params.page || 1); const cookieStore = await (0,headers/* cookies */.UL)(); const locale = cookieStore.get('canhelp_locale')?.value ?? 'el'; const t = (0,translations/* getTranslations */.$)(locale); const cookieLocation = decodeURIComponent(cookieStore.get('canhelp_location')?.value ?? ''); // Location filter only applies when explicitly set in URL params, not from cookie const effectiveLocation = params.location; let specialists = []; let total = 0; let catTree = []; let locationTree = []; let favoriteIds = new Set(); const BASE = "https://api.canhelp.gr" || 0; const cookieHeader = cookieStore.getAll().map((c)=>`${c.name}=${c.value}`).join('; '); try { const [result, cats, locs] = await Promise.all([ (0,api/* getSpecialists */.F7)({ page: String(page), limit: '20', ...params, ...effectiveLocation ? { location: effectiveLocation } : {} }), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]); console.log('[SpecialistsPage] got', result.total, 'specialists, data.length=', result.data.length); specialists = result.data; total = result.total; catTree = cats; locationTree = locs; } catch (err) { console.error('[SpecialistsPage] fetch error:', err); } if (cookieHeader) { try { const favRes = await fetch(`${BASE}/api/favorites/specialists`, { headers: { Cookie: cookieHeader } }); if (favRes.ok) { const favData = await favRes.json(); favoriteIds = new Set(favData.map((row)=>row.specialist?.id).filter(Boolean)); } } catch {} } const totalPages = Math.ceil(total / 20); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const buildUrl = (overrides)=>{ const merged = { ...params, ...effectiveLocation ? { location: effectiveLocation } : {}, ...overrides }; const qs = Object.entries(merged).filter(([, v])=>v !== undefined && v !== '').map(([k, v])=>`${k}=${encodeURIComponent(v)}`).join('&'); return `/specialists${qs ? '?' + qs : ''}`; }; return /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row gap-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("aside", { className: "md:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { className: "font-semibold text-gray-900 mb-4", children: t('tasks.search') }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(SpecialistsFiltersClient.SpecialistsFiltersClient, { catTree: catTree, locations: locationTree, initialQ: params.q, initialCategory: params.category, initialLocation: params.location, initialLanguages: params.language ? params.language.split(',').filter(Boolean) : [] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex-1", children: [ (params.q || params.category || params.location || params.language) && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("h1", { className: "text-xl font-bold text-white", children: [ total, " ", t('specialists.title').toLowerCase() ] }) }), specialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-lg", children: t('specialists.empty') }) }) : /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: specialists.map((user)=>{ const displayName = formatShortName(user.firstName, user.lastName, user.name); const initials = `${user.firstName?.[0] ?? ''}${user.lastName?.[0] ?? ''}`.toUpperCase() || user.name?.[0]?.toUpperCase() || '?'; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: `/users/${user.id}`, className: "absolute inset-0 rounded-xl", "aria-label": displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(FavoriteSpecialistButton.FavoriteSpecialistButton, { specialistId: user.id, initialFavorite: favoriteIds.has(user.id), favoriteLabel: t('specialist.favorite'), unfavoriteLabel: t('specialist.unfavorite') }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100", children: user.image ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-900 truncate", children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,react_jsx_runtime.jsx)(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now') ] }), user.rating && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-yellow-400 text-sm", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-700", children: Number(user.rating).toFixed(1) }) ] }), user.todayStatus === 'available' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), user.todayStatus === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), user.cards && user.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: [ user.cards.slice(0, 2).map((card)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium", children: card.title }, card.id)), user.cards.length > 2 && /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("span", { className: "text-xs text-gray-400", children: [ "+", user.cards.length - 2 ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 line-clamp-2 flex-1 mt-1", children: user.bio || t('specialists.no_bio') }), user.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-3", children: formatLastSeen(user.lastSeenAt, t) }) ] }, user.id); }) }), totalPages > 1 && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "flex justify-center gap-2 mt-8", children: Array.from({ length: totalPages }, (_, i)=>i + 1).map((p)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)((link_default()), { href: buildUrl({ page: String(p) }), className: `w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${p === page ? 'bg-blue-600 text-white' : 'bg-white border border-gray-200 text-gray-700 hover:border-blue-400'}`, children: p }, p)) }) ] }) ] }) }); } /***/ }), /***/ 63033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 74075: /***/ ((module) => { "use strict"; module.exports = require("zlib"); /***/ }), /***/ 79428: /***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }), /***/ 79551: /***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }), /***/ 79646: /***/ ((module) => { "use strict"; module.exports = require("child_process"); /***/ }), /***/ 81045: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map /***/ }), /***/ 81630: /***/ ((module) => { "use strict"; module.exports = require("http"); /***/ }), /***/ 83997: /***/ ((module) => { "use strict"; module.exports = require("tty"); /***/ }), /***/ 84237: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); /* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .W, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } /***/ }), /***/ 86439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 91645: /***/ ((module) => { "use strict"; module.exports = require("net"); /***/ }), /***/ 94735: /***/ ((module) => { "use strict"; module.exports = require("events"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,727,892,902,112,22], () => (__webpack_exec__(81045))); module.exports = __webpack_exports__; })(); {} @.b(() => { var exports = {}; exports.id = 755; exports.ids = [755]; exports.modules = { /***/ 261: $/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 3295: $/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 10846: Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 17320: V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { import(/* webpackMode: "eager", webpackExports: ["FavoriteSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["SpecialistsFiltersClient"] */ "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); Q0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 30284))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 84237))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 94496, 23))undefined, /***/ 19121: Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 26713: Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");, /***/ 27910: #module.exports = require("stream");, /***/ 28354: !module.exports = require("util");, /***/ 29021: module.exports = require("fs");, /***/ 29294: Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 30284: _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; j/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13260); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91864); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useState } from 'react'; import { useSession } from '@/lib/auth'; import { addSpecialistFavorite, removeSpecialistFavorite } from '@/lib/api'; export function FavoriteSpecialistButton({ specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel }) { const { data: session } = useSession(); const [isFavorite, setIsFavorite] = useState(initialFavorite); const [loading, setLoading] = useState(false); if (!session) return null; async function toggle(e) { e.preventDefault(); e.stopPropagation(); setLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(specialistId); setIsFavorite(false); } else { await addSpecialistFavorite(specialistId); setIsFavorite(true); } } catch {} setLoading(false); } return /*#__PURE__*/ _jsx("button", { onClick: toggle, disabled: loading, title: isFavorite ? unfavoriteLabel : favoriteLabel, className: `absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${isFavorite ? 'bg-pink-50 text-pink-500 hover:bg-pink-100' : 'bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50'}`, children: isFavorite ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined427436(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined542549(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770793(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined891911(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10571060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 30472: P0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 57650))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 50815))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3498, 23))undefined, /***/ 33873: !module.exports = require("path");, /***/ 34631:  module.exports = require("tls");, /***/ 41025: amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 50815: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); L// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const SpecialistsFiltersClient = registerClientReference( function() { throw new Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx", "SpecialistsFiltersClient", );61134undefined136142undefined176198(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined, /***/ 55511: #module.exports = require("crypto");, /***/ 55591: "module.exports = require("https");, /***/ 57650: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FavoriteSpecialistButton: () => (/* binding */ FavoriteSpecialistButton) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); L// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export const FavoriteSpecialistButton = registerClientReference( function() { throw new Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx", "FavoriteSpecialistButton", );, /***/ 60928: , /***/ 63033: \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 74075: !module.exports = require("zlib");, /***/ 79428: #module.exports = require("buffer");, /***/ 79551:  module.exports = require("url");, /***/ 79646: *module.exports = require("child_process");, /***/ 81045: #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(58671); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/layout.tsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/not-found.tsx"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialists/page.tsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: [ 'specialists', { children: ['__PAGE__', {}, { page: [page5, "/opt/canhelp/apps/web/src/app/specialists/page.tsx"], }] }, { metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }, { 'layout': [module0, "/opt/canhelp/apps/web/src/app/layout.tsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "/opt/canhelp/apps/web/src/app/not-found.tsx"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], metadata: { icon: [(async (props) => (await import(/* webpackMode: "eager" */ "next-metadata-image-loader?type=icon&segment=&basePath=&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js!/opt/canhelp/apps/web/src/app/icon.svg?__next_metadata__")).default(props))], apple: [], openGraph: [], twitter: [], manifest: undefined } } ] }.children; const pages = ["/opt/canhelp/apps/web/src/app/specialists/page.tsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/specialists/page", pathname: "/specialists", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/specialists/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? Boolean(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map E&2298Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570))undefined123210Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 58671, 23))undefined235314Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506))undefined339423Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23))undefined448535Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23))undefined558644Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 60928))undefined647787undefined789903undefined905981undefined9831054undefined10561118undefined11201189undefined11911267undefined12691354undefined13561439undefined14411517undefined15191600undefined16021695undefined16971801undefined18031883undefined18851963undefined19652056undefined20582239undefined22412317undefined23192384undefined23862459undefined24612518undefined25202626undefined26282701undefined27032767undefined27692850undefined32693491Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined40664288Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91946))undefined44924514undefined45164652undefined46544676undefined47074725__webpack_require__undefined47834789undefined48905016undefined50185103undefined51055218undefined52815287undefined53125329next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined53655373next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined56415676".next"undefined568156820undefined57095747 falseundefined57595765undefined60516071falseundefined60746138{}undefined62846323falseundefined63556368(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined64596472(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined72387253(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)undefined76407649(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)undefined76857700(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)undefined78457858(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79047930next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADERundefined81098122(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined81688177next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADERundefined82178241(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)undefined84218440(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined86328739 falseundefined874487580undefined1105411067(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1145211479(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)undefined1326413281(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1334113349next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__undefined1340013399: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_25___default())undefined1376813797(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)undefined1392913949(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)undefined1408314091(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1439114405next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1444514460next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1468814725falseundefined1472815303{}undefined1588115894next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1698116994(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1727317286(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1800518041 trueundefined1804518064(__webpack_require__(33873).join)undefined18143181940undefined1915519168(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2100921022(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2144621467next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined2290622920next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2416624183(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)undefined2447224483next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2449824502(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)undefined2460824619next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2505325064next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2513325144next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2523325244next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2577725788next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackModeundefined2583325847next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined2649926507next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2725327274(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined2880228816next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined2885528866next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined2936829381(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2943829459(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)undefined3003430042next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3152131535next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3288732910next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADERundefined3537735390next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEARundefined3568535699next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined3658236605next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined3687736898next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3701637037next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined3726737282(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3751037521next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3755037572next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined3822838243(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined3845138462next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined3872538738(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3918639199(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined4006940090next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4096940990next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4110041121next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADERundefined4167441691next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCodeundefined4189541918next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADERundefined4281442829(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4385743872(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4408044091next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"]undefined4412444146next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADERundefined4486344975falseundefined4497845328{}undefined4535345368(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4631246323next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGSundefined4645846473(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined4708447111falseundefined4711447184{}undefined4849248506next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKindundefined4943049445(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)undefined5032050333next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5043250439next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5069550709next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackErrorundefined5092150939(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 81630: !module.exports = require("http");, /***/ 83997:  module.exports = require("tty");, /***/ 84237: ]/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpecialistsFiltersClient: () => (/* binding */ SpecialistsFiltersClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96484); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88142); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53863); !/* __next_internal_client_entry_do_not_use__ SpecialistsFiltersClient auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; const LANG_OPTIONS = [ { code: 'el', label: 'Ελληνικά' }, { code: 'en', label: 'English' }, { code: 'ru', label: 'Русский' }, { code: 'uk', label: 'Українська' }, { code: 'de', label: 'Deutsch' }, { code: 'fr', label: 'Français' }, { code: 'it', label: 'Italiano' }, { code: 'es', label: 'Español' }, { code: 'ar', label: 'العربية' }, { code: 'zh', label: '中文' } ]; export function SpecialistsFiltersClient({ catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] }) { const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory ?? ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation ?? ''); const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages); const hasFilter = !!(initialQ || initialCategory || initialLocation || initialLanguages.length); const navigate = (q, category, location, languages)=>{ const qs = new URLSearchParams(); if (q) qs.set('q', q); if (category) qs.set('category', category); if (location) qs.set('location', location); if (languages.length) qs.set('language', languages.join(',')); router.push(`/specialists${qs.toString() ? '?' + qs.toString() : ''}`); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ ?? '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ ?? '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ ?? '', selectedCategory, selectedLocation, next); }; const handleSubmit = (e)=>{ e.preventDefault(); const fd = new FormData(e.currentTarget); const q = fd.get('q') || ''; navigate(q, selectedCategory, selectedLocation, selectedLanguages); }; const handleReset = ()=>{ setSelectedCategory(''); setSelectedLocation(''); setSelectedLanguages([]); router.push('/specialists'); }; const locationAnyLabel = t('create.field.location.any'); const locationAllLabel = t('create.field.location.all'); const catPlaceholder = t('filter.category.all'); const catLabel = t('create.field.category'); const locLabel = t('filter.location'); const langLabel = t('filter.language'); const resetLabel = t('tasks.filter.reset'); return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("input", { name: "q", defaultValue: initialQ, placeholder: t('specialists.search'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) }), catTree.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: catLabel }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: catTree, locale: catLocale, value: selectedCategory, onChange: handleCategoryChange, placeholder: catPlaceholder }) ] }), locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: locLabel }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: handleLocationChange, anyLabel: locationAnyLabel, allLabel: locationAllLabel }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-2", children: langLabel }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: LANG_OPTIONS.map((lang)=>{ const checked = selectedLanguages.includes(lang.code); return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer group py-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: `w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${checked ? 'bg-blue-600 border-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, onClick: ()=>toggleLanguage(lang.code), children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-2.5 h-2.5 text-white", viewBox: "0 0 10 8", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M1 4l3 3 5-6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm select-none transition-colors ${checked ? 'text-blue-700 font-medium' : 'text-gray-700'}`, onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700", children: t('specialists.search.btn') }), hasFilter && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleReset, className: "w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors", children: resetLabel }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11661174(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12051213(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13481355(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14331440(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15201527(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34753479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36013604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36553658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40314035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined41084111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43084311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43134330_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined46874691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined47644767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49644967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694986_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined53285332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54055408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58615865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60726075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64756478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67616764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73077310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78407843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81128115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 86439: Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 91645:  module.exports = require("net");, /***/ 94735: #module.exports = require("events");w }; ; // load runtime var __webpack_require__ = require("../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [901,727,892,902,112,22], () => (__webpack_exec__(81045))); ,module.exports = __webpack_exports__; })();o )v(()=>{var a={};a.id=755,a.ids=[755],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},17320:(a,b,c)=>{Promise.resolve().then(c.bind(c,30284)),Promise.resolve().then(c.bind(c,84237)),Promise.resolve().then(c.t.bind(c,94496,23))},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30284:(a,b,c)=>{"use strict";c.d(b,{FavoriteSpecialistButton:()=>h});var d=c(78157),e=c(31768),f=c(13260),g=c(91864);function h({specialistId:a,initialFavorite:b=!1,favoriteLabel:c,unfavoriteLabel:h}){let{data:i}=(0,f.wV)(),[j,k]=(0,e.useState)(b),[l,m]=(0,e.useState)(!1);if(!i)return null;async function n(b){b.preventDefault(),b.stopPropagation(),m(!0);try{j?(await (0,g.sD)(a),k(!1)):(await (0,g.V)(a),k(!0))}catch{}m(!1)}return(0,d.jsx)("button",{onClick:n,disabled:l,title:j?h:c,className:`absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ${j?"bg-pink-50 text-pink-500 hover:bg-pink-100":"bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50"}`,children:j?"❤️":"\uD83E\uDD0D"})}},30472:(a,b,c)=>{Promise.resolve().then(c.bind(c,57650)),Promise.resolve().then(c.bind(c,50815)),Promise.resolve().then(c.t.bind(c,3498,23))},33873:a=>{"use strict";a.exports=require("path")},34631:a=>{"use strict";a.exports=require("tls")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},50815:(a,b,c)=>{"use strict";c.d(b,{SpecialistsFiltersClient:()=>d});let d=(0,c(25459).registerClientReference)(function(){throw Error("Attempted to call SpecialistsFiltersClient() from the server but SpecialistsFiltersClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx","SpecialistsFiltersClient")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57650:(a,b,c)=>{"use strict";c.d(b,{FavoriteSpecialistButton:()=>d});let d=(0,c(25459).registerClientReference)(function(){throw Error("Attempted to call FavoriteSpecialistButton() from the server but FavoriteSpecialistButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx","FavoriteSpecialistButton")},60928:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>p});var d=c(5939),e=c(3498),f=c.n(e),g=c(56057),h=c(59902),i=c(75112),j=c(57650),k=c(50815);let l={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-blue-100 text-blue-700 border border-blue-200",icon:(0,d.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,d.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,d.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,d.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function m({tier:a,verified:b,size:c="sm",className:e=""}){if("free"===a&&!b)return null;let f="sm"===c?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(b&&"free"!==a)return(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-full font-semibold ${f} ${l[a].class} ${e}`,children:["ultimate"===a?(0,d.jsx)(n,{className:"w-3 h-3 fill-gray-900"}):(0,d.jsx)(o,{className:"w-3 h-3"}),l[a].label]});if(b)return(0,d.jsx)("span",{className:`inline-flex items-center gap-0.5 rounded-full font-semibold ${f} bg-blue-100 text-blue-700 border border-blue-200 ${e}`,children:(0,d.jsx)(o,{className:"w-3 h-3"})});let g=l[a];return(0,d.jsxs)("span",{className:`inline-flex items-center rounded-full font-semibold ${f} ${g.class} ${e}`,children:["pro"===a&&(0,d.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===a&&(0,d.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),g.label]})}function n({className:a=""}){return(0,d.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:a,children:(0,d.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function o({className:a=""}){return(0,d.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:a,children:[(0,d.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,d.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}async function p({searchParams:a}){let b=await a,c=Number(b.page||1),e=await (0,g.UL)(),l=e.get("canhelp_locale")?.value??"el",n=(0,i.$)(l);decodeURIComponent(e.get("canhelp_location")?.value??"");let o=b.location,p=[],q=0,r=[],s=[],t=new Set,u=e.getAll().map(a=>`${a.name}=${a.value}`).join("; ");try{let[a,d,e]=await Promise.all([(0,h.F7)({page:String(c),limit:"20",...b,...o?{location:o}:{}}),(0,h.bW)().catch(()=>[]),(0,h.Vs)().catch(()=>[])]);console.log("[SpecialistsPage] got",a.total,"specialists, data.length=",a.data.length),p=a.data,q=a.total,r=d,s=e}catch(a){console.error("[SpecialistsPage] fetch error:",a)}if(u)try{let a=await fetch("https://api.canhelp.gr/api/favorites/specialists",{headers:{Cookie:u}});if(a.ok){let b=await a.json();t=new Set(b.map(a=>a.specialist?.id).filter(Boolean))}}catch{}let v=Math.ceil(q/20);return(0,d.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:(0,d.jsxs)("div",{className:"flex flex-col md:flex-row gap-8",children:[(0,d.jsx)("aside",{className:"md:w-64 shrink-0",children:(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 sticky top-24",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-900 mb-4",children:n("tasks.search")}),(0,d.jsx)(k.SpecialistsFiltersClient,{catTree:r,locations:s,initialQ:b.q,initialCategory:b.category,initialLocation:b.location,initialLanguages:b.language?b.language.split(",").filter(Boolean):[]})]})}),(0,d.jsxs)("div",{className:"flex-1",children:[(b.q||b.category||b.location||b.language)&&(0,d.jsx)("div",{className:"mb-6",children:(0,d.jsxs)("h1",{className:"text-xl font-bold text-white",children:[q," ",n("specialists.title").toLowerCase()]})}),0===p.length?(0,d.jsx)("div",{className:"text-center py-20 text-white/70",children:(0,d.jsx)("p",{className:"text-lg",children:n("specialists.empty")})}):(0,d.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:p.map(a=>{let b=function(a,b,c){if(a?.trim()){let c=b?.trim();return c?`${a.trim()} ${c[0].toUpperCase()}.`:a.trim()}if(!c?.trim())return"—";let d=c.trim().split(/\s+/);return d.length<2||!d[1]?d[0]:`${d[0]} ${d[1][0].toUpperCase()}.`}(a.firstName,a.lastName,a.name),c=`${a.firstName?.[0]??""}${a.lastName?.[0]??""}`.toUpperCase()||a.name?.[0]?.toUpperCase()||"?";return(0,d.jsxs)("div",{className:"relative bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-blue-300 transition flex flex-col",children:[(0,d.jsx)(f(),{href:`/users/${a.id}`,className:"absolute inset-0 rounded-xl","aria-label":b}),(0,d.jsx)(j.FavoriteSpecialistButton,{specialistId:a.id,initialFavorite:t.has(a.id),favoriteLabel:n("specialist.favorite"),unfavoriteLabel:n("specialist.unfavorite")}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,d.jsx)("div",{className:"w-12 h-12 rounded-full bg-blue-100 flex-shrink-0 flex items-center justify-center text-blue-700 font-bold text-sm overflow-hidden border border-gray-100",children:a.image?(0,d.jsx)("img",{src:a.image,alt:b,className:"w-full h-full object-cover"}):c}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-900 truncate",children:b}),(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[a.planTier&&"free"!==a.planTier&&(0,d.jsx)(m,{tier:a.planTier,verified:a.hasVerifiedBadge,size:"sm"}),a.hasVerifiedBadge&&"free"===a.planTier&&(0,d.jsx)(m,{tier:"free",verified:!0,size:"sm"}),Array.isArray(a.activeStatuses)&&a.activeStatuses.includes("can_help_now")&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),n("status.can_help_now")]}),a.rating&&(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"text-yellow-400 text-sm",children:"★"}),(0,d.jsx)("span",{className:"text-sm font-medium text-gray-700",children:Number(a.rating).toFixed(1)})]}),"available"===a.todayStatus&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-100 px-2 py-0.5 rounded-full",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 inline-block"}),n("schedule.available")]}),"busy"===a.todayStatus&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-100 px-2 py-0.5 rounded-full",children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 inline-block"}),n("schedule.busy")]})]})]})]}),a.cards&&a.cards.length>0&&(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[a.cards.slice(0,2).map(a=>(0,d.jsx)("span",{className:"text-xs bg-gray-100 text-gray-700 px-2 py-0.5 rounded-full font-medium",children:a.title},a.id)),a.cards.length>2&&(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["+",a.cards.length-2]})]}),(0,d.jsx)("p",{className:"text-sm text-gray-500 line-clamp-2 flex-1 mt-1",children:a.bio||n("specialists.no_bio")}),a.lastSeenAt&&(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-3",children:function(a,b){if(!a)return"";let c=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(c<5)return b("user.online");if(c<60)return b("user.seen_minutes").replace("{n}",String(c));let d=Math.floor(c/60);if(d<24)return b("user.seen_hours").replace("{n}",String(d));let e=Math.floor(d/24);return 1===e?b("user.seen_yesterday"):b("user.seen_days").replace("{n}",String(e))}(a.lastSeenAt,n)})]},a.id)})}),v>1&&(0,d.jsx)("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:v},(a,b)=>b+1).map(a=>(0,d.jsx)(f(),{href:(a=>{let c=Object.entries({...b,...o?{location:o}:{},...a}).filter(([,a])=>void 0!==a&&""!==a).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`/specialists${c?"?"+c:""}`})({page:String(a)}),className:`w-10 h-10 flex items-center justify-center rounded-lg text-sm font-medium ${a===c?"bg-blue-600 text-white":"bg-white border border-gray-200 text-gray-700 hover:border-blue-400"}`,children:a},a))})]})]})})}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{"use strict";a.exports=require("zlib")},79428:a=>{"use strict";a.exports=require("buffer")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},81045:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>J,handler:()=>L,pages:()=>I,routeModule:()=>K,tree:()=>H});var d=c(73653),e=c(97714),f=c(85250),g=c(37587),h=c(22369),i=c(1889),j=c(96232),k=c(22841),l=c(46537),m=c(46027),n=c(78559),o=c(75928),p=c(19374),q=c(65971),r=c(261),s=c(79898),t=c(32967),u=c(26713),v=c(40139),w=c(14248),x=c(59580),y=c(57749),z=c(53123),A=c(89745),B=c(86439),C=c(58671),D=c.n(C),E=c(18283),F=c(39818),G={};for(let a in E)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(G[a]=()=>E[a]);c.d(b,G);let H={children:["",{children:["specialists",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,60928)),"/opt/canhelp/apps/web/src/app/specialists/page.tsx"]}]},{metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,91946))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,47570)),"/opt/canhelp/apps/web/src/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,58671,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,33506)),"/opt/canhelp/apps/web/src/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,15034,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,54693,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,91946))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,I=["/opt/canhelp/apps/web/src/app/specialists/page.tsx"],J={require:c,loadChunk:()=>Promise.resolve()},K=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/specialists/page",pathname:"/specialists",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:H},distDir:".next",relativeProjectDir:""});async function L(a,b,d){var C;let G="/specialists/page";"/index"===G&&(G="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await K.prepare(a,b,{srcPage:G,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,interceptionRoutePatterns:ae}=O,af=S.pathname||"/",ag=(0,r.normalizeAppPath)(G),{isOnDemandRevalidate:ah}=O,ai=K.match(af,$),aj=!!$.routes[aa],ak=!!(ai||aj||$.routes[ag]),al=a.headers["user-agent"]||"",am=(0,u.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],aq=(0,s.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr)&&(null==(C=$.routes[ag]??$.dynamicRoutes[ag])?void 0:C.renderingMode)==="PARTIALLY_STATIC",as=!1,at=!1,au=ar?M:void 0,av=ar&&ap&&!ao,aw=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ax=!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots);an&&ar&&(ak=!1,ax=!1);let ay=!0===K.isDev||!ak||"string"==typeof M||av,az=an&&ar,aA=null;_||!ak||ay||aq||au||av||(aA=aa);let aB=aA;!aB&&K.isDev&&(aB=aa),K.isDev||_||!ak||!ap||av||(0,k.d)(a.headers);let aC={...E,tree:H,pages:I,GlobalError:D(),handler:L,routeModule:K,__next_app__:J};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:G,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aD=a.method||"GET",aE=(0,g.getTracer)(),aF=aE.getActiveScopeSpan();try{let f=K.getVaryHeader(aa,ae);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return K.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aE.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aD} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aD} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ag,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aC,Component:(0,j.T)(aC),params:R,routeModule:K,page:G,postponed:f,shouldWaitOnAllReady:az,serveStreamingMetadata:ax,supportsDynamicResponse:"string"==typeof f||ay,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ac?void 0:ac.setIsrStatus,dir:c(33873).join(process.cwd(),K.relativeProjectDir),isDraftMode:_,isRevalidate:ak&&!f&&!av,botType:am,isOnDemandRevalidate:ah,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,previewProps:$.preview,deploymentId:ad.deploymentId,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,devtoolSegmentExplorer:ad.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ad.experimental.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...as?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:as}:{},experimental:{isRoutePPREnabled:ar,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,cacheComponents:!!ad.experimental.cacheComponents,clientSegmentCache:!!ad.experimental.clientSegmentCache,clientParamParsing:!!ad.experimental.clientParamParsing,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>K.onRequestError(a,b,d,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:K.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,ak&&(null==n?void 0:n.revalidate)===0&&!K.isDev&&!ar){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""} see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},o=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===K.isDev,l=c||b.writableEnded;if(ah&&ab&&!f&&!N)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ai&&(j=(0,w.parseFallbackField)(ai.fallback)),j===w.FallbackMode.PRERENDER&&(0,u.isBot)(al)&&(!ar||an)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ah=!0),ah&&(j!==w.FallbackMode.NOT_FOUND||f)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),!N&&j!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aB&&!l&&!_&&T&&(k||!aj)){let b;if((k||ai)&&j===w.FallbackMode.NOT_FOUND)throw new B.NoFallbackError;if(ar&&!ap){let c="string"==typeof(null==ai?void 0:ai.fallback)?ai.fallback:k?ag:null;if(b=await K.handleResponse({cacheKey:c,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:ar,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||at?(0,n.u)(ag):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let o=ah||g||!au?void 0:au;if(as&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=T&&ar&&((0,h.getRequestMeta)(a,"renderFallbackShell")||at)?(0,n.u)(af):null;return m({span:i,postponed:o,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,n=await K.handleResponse({cacheKey:aA,responseGenerator:a=>o({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ah,isRoutePPREnabled:ar,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),K.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!n){if(aA)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof n.value.postponed;ak&&!av&&(!p||ao)&&(N||b.setHeader("x-nextjs-cache",ah?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=n;if(au)l={revalidate:0,expire:void 0};else if(N&&ap&&!ao&&ar)l={revalidate:0,expire:void 0};else if(!K.isDev)if(_)l={revalidate:0,expire:void 0};else if(ak){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:y.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(n.cacheControl=l,"string"==typeof aw&&(null==q?void 0:q.kind)===v.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];N&&ak&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(aw);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...n,value:{...n.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&au)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(N&&ak||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(N&&ak&&s&&"string"==typeof s&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,s),!q.status||ap&&ar||(b.statusCode=q.status),!N&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),p&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:av?{revalidate:0,expire:void 0}:n.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(q.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let u=q.html;if(!p||N||ap)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:n.cacheControl});if(as)return u.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}});let w=new TransformStream;return u.push(w.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(w.writable)}).catch(a=>{w.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}})};if(!aF)return await aE.withPropagatedContext(a.headers,()=>aE.trace(i.BaseServerSpan.handleRequest,{spanName:`${aD} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aD,"http.target":a.url}},p));await p(aF)}catch(b){throw b instanceof B.NoFallbackError||await K.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:ak,isOnDemandRevalidate:ah})},ac),b}}},81630:a=>{"use strict";a.exports=require("http")},83997:a=>{"use strict";a.exports=require("tty")},84237:(a,b,c)=>{"use strict";c.d(b,{SpecialistsFiltersClient:()=>k});var d=c(78157),e=c(31768),f=c(71159),g=c(96484),h=c(88142),i=c(53863);let j=[{code:"el",label:"Ελληνικά"},{code:"en",label:"English"},{code:"ru",label:"Русский"},{code:"uk",label:"Українська"},{code:"de",label:"Deutsch"},{code:"fr",label:"Fran\xe7ais"},{code:"it",label:"Italiano"},{code:"es",label:"Espa\xf1ol"},{code:"ar",label:"العربية"},{code:"zh",label:"中文"}];function k({catTree:a,locations:b,initialQ:c,initialCategory:k,initialLocation:l,initialLanguages:m=[]}){let n=(0,f.useRouter)(),{t:o,locale:p}=(0,g.Y)(),[q,r]=(0,e.useState)(k??""),[s,t]=(0,e.useState)(l??""),[u,v]=(0,e.useState)(m),w=!!(c||k||l||m.length),x=(a,b,c,d)=>{let e=new URLSearchParams;a&&e.set("q",a),b&&e.set("category",b),c&&e.set("location",c),d.length&&e.set("language",d.join(",")),n.push(`/specialists${e.toString()?"?"+e.toString():""}`)},y=a=>{let b=u.includes(a)?u.filter(b=>b!==a):[...u,a];v(b),x(c??"",q,s,b)},z=o("create.field.location.any"),A=o("create.field.location.all"),B=o("filter.category.all"),C=o("create.field.category"),D=o("filter.location"),E=o("filter.language"),F=o("tasks.filter.reset");return(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),x(new FormData(a.currentTarget).get("q")||"",q,s,u)},className:"space-y-4",children:[(0,d.jsx)("div",{children:(0,d.jsx)("input",{name:"q",defaultValue:c,placeholder:o("specialists.search"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})}),a.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:C}),(0,d.jsx)(h.W,{categories:a,locale:"en"===p?"en":"ru"===p?"ru":"el",value:q,onChange:a=>{r(a),x(c??"",a,s,u)},placeholder:B})]}),b.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:D}),(0,d.jsx)(i.V,{locations:b,value:s,onChange:a=>{t(a),x(c??"",q,a,u)},anyLabel:z,allLabel:A})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-2",children:E}),(0,d.jsx)("div",{className:"space-y-1",children:j.map(a=>{let b=u.includes(a.code);return(0,d.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer group py-0.5",children:[(0,d.jsx)("span",{className:`w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ${b?"bg-blue-600 border-blue-600":"border-gray-300 group-hover:border-blue-400"}`,onClick:()=>y(a.code),children:b&&(0,d.jsx)("svg",{className:"w-2.5 h-2.5 text-white",viewBox:"0 0 10 8",fill:"none",children:(0,d.jsx)("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,d.jsx)("span",{className:`text-sm select-none transition-colors ${b?"text-blue-700 font-medium":"text-gray-700"}`,onClick:()=>y(a.code),children:a.label})]},a.code)})})]}),(0,d.jsx)("button",{type:"submit",className:"w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-blue-700",children:o("specialists.search.btn")}),w&&(0,d.jsx)("button",{type:"button",onClick:()=>{r(""),t(""),v([]),n.push("/specialists")},className:"w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors",children:F})]})}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[901,727,892,902,112,22],()=>b(b.s=81045));module.exports=c})();